auth

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 18, 2026 License: BSD-3-Clause-Clear Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AccessTokenKey = "access_token"
	ClientIDKey    = "client_id"
)

Variables

View Source
var (
	ErrNoMetadataFound  = errors.New("no metadata found within context")
	ErrMissingClientID  = errors.New("missing authn idP clientID")
	ErrConflictClientID = errors.New("context metadata mistakenly has more than one authn idP clientID")
)

Functions

func ContextWithAuthNInfo

func ContextWithAuthNInfo(ctx context.Context, key jwk.Key, accessToken jwt.Token, raw string) context.Context

func EnrichIncomingContextMetadataWithAuthn added in v0.11.0

func EnrichIncomingContextMetadataWithAuthn(ctx context.Context, l *logger.Logger, clientID string) context.Context

EnrichIncomingContextMetadataWithAuthn adds the access token and client ID to incoming context metadata

Adding the authn info to gRPC metadata propagates it across services rather than strictly in-process within Go alone

func GetAccessTokenFromContext

func GetAccessTokenFromContext(ctx context.Context, l *logger.Logger) jwt.Token

func GetClientIDFromContext added in v0.11.0

func GetClientIDFromContext(ctx context.Context, incoming bool) (string, error)

GetClientIDFromContext retrieves the client ID from the metadata in the context

func GetJWKFromContext

func GetJWKFromContext(ctx context.Context, l *logger.Logger) jwk.Key

func GetRawAccessTokenFromContext

func GetRawAccessTokenFromContext(ctx context.Context, l *logger.Logger) string

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL