Documentation
¶
Index ¶
- Constants
- Variables
- func ContextWithAuthNInfo(ctx context.Context, key jwk.Key, accessToken jwt.Token, raw string) context.Context
- func ContextWithPublicRoute(ctx context.Context, publicRoute bool) context.Context
- func EnrichIncomingContextMetadataWithAuthn(ctx context.Context, l optionalErrorLogger, clientID string) context.Context
- func GetAccessTokenFromContext(ctx context.Context, l optionalErrorLogger) jwt.Token
- func GetClientIDFromContext(ctx context.Context, incoming bool) (string, error)
- func GetJWKFromContext(ctx context.Context, l optionalErrorLogger) jwk.Key
- func GetRawAccessTokenFromContext(ctx context.Context, l optionalErrorLogger) string
- func PublicRouteFromContext(ctx context.Context) (bool, bool)
Constants ¶
View Source
const ( AccessTokenKey = "access_token" ClientIDKey = "client_id" )
Variables ¶
Functions ¶
func ContextWithAuthNInfo ¶
func ContextWithPublicRoute ¶ added in v0.17.0
ContextWithPublicRoute returns a child context carrying whether the request matched a configured public route.
func EnrichIncomingContextMetadataWithAuthn ¶ added in v0.11.0
func EnrichIncomingContextMetadataWithAuthn(ctx context.Context, l optionalErrorLogger, clientID string) context.Context
EnrichIncomingContextMetadataWithAuthn adds the access token and client ID to incoming context metadata
This transports an already-authenticated token across internal hops. It does not validate the token again; the ConnectUnaryServerInterceptor auth middleware does that before ContextWithAuthNInfo is created.
func GetClientIDFromContext ¶ added in v0.11.0
GetClientIDFromContext retrieves the client ID from the metadata in the context
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.