Versions in this module Expand all Collapse all v2 v2.1.0 May 2, 2026 Changes in this version + func AuthErrorDetail(err error, present bool) string + func CopyClaims(claims jwt.MapClaims) map[string]any + func FirstNonEmpty(values ...string) string + func NormalizeAlgorithms(algs []string) ([]string, error) + func OptionalBearerHandler(next http.Handler, enabled bool, log ports.Logger, ...) http.Handler + func ParseBearerToken(header string) (string, bool, error) + func ParseSkipTrustedProxies(trustedProxies []string) (identity.Resolver, error) + func ParseTokenClaims(tokenStr string, keyfunc jwt.Keyfunc, cfg TokenParserConfig) (jwt.MapClaims, error) + func RequiredBearerHandler(next http.Handler, enabled bool, log ports.Logger, ...) http.Handler + func ShouldSkipRequest(r *http.Request, policy SkipPolicy) bool + func StringClaim(claims jwt.MapClaims, key string) string + func ValidateRequiredClaims(claims jwt.MapClaims, req ClaimRequirements) error + type ClaimRequirements struct + RequireExpiration bool + RequireIssuedAt bool + RequireNotBefore bool + RequireSubject bool + func NormalizeClaimRequirements(input ClaimRequirementsInput) ClaimRequirements + type ClaimRequirementsInput struct + RequireExpiration *bool + RequireIssuedAt *bool + RequireNotBefore *bool + RequireSubject *bool + type HandlerMessages struct + FailureLog string + InvalidDetail string + MissingDetail string + SkipLog string + type SkipPolicy struct + AllowDangerousDevBypasses bool + Enabled bool + HeaderName string + Resolver identity.Resolver + type SubjectContextFunc func(ctx context.Context, token string) (context.Context, error) + type TokenFromRequestFunc func(r *http.Request) (string, bool, error) + type TokenParserConfig struct + AllowedAlgorithms []string + AllowedClockSkew time.Duration + Audience string + Issuer string + Requirements ClaimRequirements + type ValidationConfig struct + AllowDangerousDevBypasses bool + AllowedAlgorithms []string + AllowedClockSkew time.Duration + Audience string + Enabled bool + Issuer string + JWKSDescriptor string + JWKSRefreshInterval time.Duration + JWKSRefreshTimeout time.Duration + JWKSURL string + ProviderName string + RequiredClaims ClaimRequirementsInput + SkipHeaderEnabled bool + SkipHeaderName string + SkipTrustedProxies []string + type ValidationState struct + AllowedAlgorithms []string + Cancel context.CancelFunc + ClaimRequirements ClaimRequirements + Enabled bool + JWKS keyfunc.Keyfunc + SkipHeader string + SkipResolver identity.Resolver + func PrepareValidationState(ctx context.Context, cfg ValidationConfig) (ValidationState, error)