context

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: GPL-3.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MissingTokenError              = errors.New("missing token")
	UnexpectedTokenTypeError       = errors.New("unexpected type")
	MissingTokenClaimsError        = errors.New("missing token claims")
	MissingTokenClaimsSubjectError = errors.New("missing token claims subject")
	MissingTokenClaimsIdError      = errors.New("missing token claims id")
	UnexpectedTokenClaimsTypeError = errors.New("unexpected token claims type")
)

Functions

func GetCtxRawToken

func GetCtxRawToken(ctx context.Context) (string, error)

GetCtxRawToken gets the raw token from the context

func GetCtxTokenClaims

func GetCtxTokenClaims(ctx context.Context) (*jwt.MapClaims, error)

GetCtxTokenClaims gets the token claims from the context

func GetCtxTokenClaimsJwtId

func GetCtxTokenClaimsJwtId(ctx context.Context) (string, error)

GetCtxTokenClaimsJwtId gets the token claims JWT ID from the context

func GetCtxTokenClaimsSubject

func GetCtxTokenClaimsSubject(ctx context.Context) (string, error)

GetCtxTokenClaimsSubject gets the token claims subject from the context

func SetCtxRawToken

func SetCtxRawToken(ctx context.Context, token string) context.Context

SetCtxRawToken sets the raw token to the context

func SetCtxTokenClaims

func SetCtxTokenClaims(
	ctx context.Context,
	claims *jwt.MapClaims,
) context.Context

SetCtxTokenClaims sets the token claims to the context

Types

This section is empty.

Jump to

Keyboard shortcuts

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