Versions in this module Expand all Collapse all v0 v0.1.0 Oct 2, 2026 Changes in this version + var ErrClaimsLimit = errors.New("identity: claims budget exceeded") + var ErrConflict = errors.New("identity: caller conflict") + var ErrInvalidCaller = errors.New("identity: invalid caller") + var ErrInvalidClaims = errors.New("identity: invalid claims") + func NewContext(ctx context.Context, caller Caller) (context.Context, error) + type Caller struct + func FromContext(ctx context.Context) Caller + func NewIAM(principalARN string, source Source, opts ...IAMOption) (Caller, error) + func NewJWT(claims Claims, source Source, opts ...JWTOption) (Caller, error) + func (c Caller) GoString() string + func (c Caller) IAM() (IAM, bool) + func (c Caller) JWT() (JWT, bool) + func (c Caller) Kind() Kind + func (c Caller) Source() Source + func (c Caller) String() string + type Claim struct + func (c Claim) Array() ([]Claim, bool) + func (c Claim) Bool() (value, ok bool) + func (c Claim) Float64() (float64, bool) + func (c Claim) GoString() string + func (c Claim) Kind() ClaimKind + func (c Claim) NumberText() (string, bool) + func (c Claim) Object() (Claims, bool) + func (c Claim) Representation() Representation + func (c Claim) String() string + func (c Claim) Text() (string, bool) + type ClaimKind uint8 + const ClaimArray + const ClaimBoolean + const ClaimInvalid + const ClaimNull + const ClaimNumber + const ClaimObject + const ClaimString + func (k ClaimKind) String() string + type Claims struct + func NewClaims(values map[string]any, opts ...ClaimsOption) (Claims, error) + func NewTextClaims(values map[string]string, opts ...ClaimsOption) (Claims, error) + func ParseClaims(data jsontext.Value, opts ...ClaimsOption) (Claims, error) + func (c Claims) GoString() string + func (c Claims) Len() int + func (c Claims) Lookup(name string) (Claim, bool) + func (c Claims) Names() []string + func (c Claims) String() string + type ClaimsLimitError struct + func (e *ClaimsLimitError) Error() string + func (e *ClaimsLimitError) Maximum() int64 + func (e *ClaimsLimitError) Unwrap() error + type ClaimsOption func(*claimsConfig) + func WithClaimsBudget(bytes int) ClaimsOption + type IAM struct + func (i IAM) AccountID() string + func (i IAM) GoString() string + func (i IAM) Partition() string + func (i IAM) PrincipalARN() string + func (i IAM) PrincipalID() (string, bool) + func (i IAM) PrincipalType() IAMPrincipalType + func (i IAM) Service() string + func (i IAM) String() string + type IAMOption func(*iamConfig) error + func WithIAMAccountID(account string) IAMOption + func WithIAMPrincipalID(id string) IAMOption + type IAMPrincipalType uint8 + const IAMPrincipalAssumedRole + const IAMPrincipalFederatedUser + const IAMPrincipalRoot + const IAMPrincipalUnknown + const IAMPrincipalUser + func (t IAMPrincipalType) String() string + type JWT struct + func (j JWT) Audience() ([]string, bool) + func (j JWT) Claims() Claims + func (j JWT) ClientID() (string, bool) + func (j JWT) CognitoGroups() ([]string, bool) + func (j JWT) GoString() string + func (j JWT) Issuer() string + func (j JWT) Scopes() ([]string, bool) + func (j JWT) String() string + func (j JWT) Subject() (string, bool) + func (j JWT) TokenUse() (string, bool) + type JWTOption func(*jwtConfig) error + func WithGatewayScopes(scopes []string) JWTOption + type Kind uint8 + const KindAnonymous + const KindIAM + const KindJWT + func (k Kind) String() string + type Representation uint8 + const RepresentationDecoded + const RepresentationGatewayText + const RepresentationJSON + const RepresentationUnknown + func (r Representation) String() string + type Source uint8 + const SourceCustomAssertion + const SourceGatewayAssertion + const SourceLocallyVerifiedToken + const SourceNone + const SourceVerifiedIAMProof + func (s Source) String() string