Documentation ¶
Overview ¶
Package iammember provides primitives for IAM member identifiers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResolveContextUnaryInterceptor ¶ added in v0.20.0
func ResolveContextUnaryInterceptor(resolver Resolver) grpc.UnaryServerInterceptor
ResolveContextUnaryInterceptor returns a gRPC server middleware that resolves IAM members with the provided resolver.
func WithResolvedContext ¶ added in v0.20.0
func WithResolvedContext(ctx context.Context, resolveResult ResolveResult) context.Context
WithResolvedContext returns a new context with cached IAM member resolve result.
Types ¶
type Metadata ¶ added in v0.20.0
Metadata contains IAM members partitioned by which gRPC metadata key they were resolved from.
type ResolveResult ¶ added in v0.20.0
type ResolveResult struct { // Checksum of the metadata that the members were resolved from. Checksum uint64 // Members are the resolved IAM members. Members []string // Metadata are the resolved IAM members partitioned by which metadata key they were resolved from. Metadata Metadata }
ResolveResult is the output from a Resolver.
func FromResolvedContext ¶ added in v0.20.0
func FromResolvedContext(ctx context.Context) (ResolveResult, bool)
FromResolvedContext returns the resolved IAM members and metadata from the provided context.
func (*ResolveResult) Add ¶ added in v0.20.0
func (r *ResolveResult) Add(key string, member string)
Add a member resolved from the provided metadata key and value.
func (*ResolveResult) AddAll ¶ added in v0.20.0
func (r *ResolveResult) AddAll(other ResolveResult)
AddAll adds all the resolved members from another ResolveResult.
func (*ResolveResult) AddChecksum ¶ added in v0.25.0
func (r *ResolveResult) AddChecksum(key, value string)
AddChecksum adds the provided metadata key and value to the checksum.
type Resolver ¶
type Resolver interface {
ResolveIAMMembers(context.Context) (ResolveResult, error)
}
Resolver resolves the IAM member identifiers for a caller context.
func ChainResolvers ¶ added in v0.8.0
ChainResolvers creates a single resolver out of a chain of many resolvers.
The resulting resolved members will be the union of the members resolved by each resolver.
If any resolver returns an error, that error is immediately returned and no further resolvers are called.
func FromContextResolver ¶ added in v0.20.0
func FromContextResolver() Resolver
FromContextResolver returns a Resolver that resolves cached IAM members and metadata from the current context.