Documentation ¶
Index ¶
- func Add(caller *iamv1.Caller, key string, metadata *iamv1.Caller_Metadata)
- func FromResolvedContext(ctx context.Context) (*iamv1.Caller, bool)
- func ResolveContextUnaryInterceptor(resolver Resolver) grpc.UnaryServerInterceptor
- func Validate(caller *iamv1.Caller) error
- func WithResolvedContext(ctx context.Context, resolveResult *iamv1.Caller) context.Context
- type Resolver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Add ¶
func Add(caller *iamv1.Caller, key string, metadata *iamv1.Caller_Metadata)
Add adds the metadata resolved from the provided key to the provider caller info.
func FromResolvedContext ¶
FromResolvedContext returns the resolved IAM members and metadata from the provided context.
func ResolveContextUnaryInterceptor ¶
func ResolveContextUnaryInterceptor(resolver Resolver) grpc.UnaryServerInterceptor
ResolveContextUnaryInterceptor returns a gRPC server middleware that resolves IAM members with the provided resolver.
Types ¶
type Resolver ¶
Resolver resolves the IAM caller identity for the current context.
func ChainResolvers ¶
ChainResolvers creates a single resolver out of a chain of many resolvers.
The resulting resolved caller data will be the union of the caller data resolved by each resolver.
If any resolver returns an error, that error is immediately returned and no further resolvers are called.
If multiple resolvers resolve the same metadata key, the only last encountered metadata value will be kept.
func FromContextResolver ¶
func FromContextResolver() Resolver
FromContextResolver returns a Resolver that resolves cached IAM members and metadata from the current context.