intercepter

package
v0.0.0-...-7cfdd99 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 10, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMethodPolicy

func GetMethodPolicy(fullMethodName string) (*pb.Policy, error)

GetMethodPolicy protobufメソッドから権限情報を取得

func PolicyVerifierInterceptor

func PolicyVerifierInterceptor(permissionVerifierClient client.PermissionVerifierClient) grpc.UnaryServerInterceptor

PolicyVerifierInterceptor 認可チェックを行うインターセプター

func ResourcePolicyInterceptor

func ResourcePolicyInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error)

ResourcePolicyInterceptor protobufオプションとリクエストからリソースを解決

func WithPolicy

func WithPolicy(ctx context.Context, resource, action string) context.Context

func WithPolicyMetadata

func WithPolicyMetadata(ctx context.Context, pm *Policy) context.Context

Types

type Policy

type Policy struct {
	Resource string
	Action   string
}

func PolicyFromContext

func PolicyFromContext(ctx context.Context) (*Policy, bool)

type RPCMethod

type RPCMethod struct {
	Service string
	Method  string
}

RPCMethod は gRPC のフルメソッド名を分解した構造体

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL