Documentation
¶
Index ¶
- func GetCtxToken(ctx context.Context) (string, error)
- func GetCtxTokenClaims(ctx context.Context) (jwt.MapClaims, error)
- func GetCtxTokenClaimsJwtID(ctx context.Context) (string, error)
- func GetCtxTokenClaimsSubject(ctx context.Context) (string, error)
- func SetCtxToken(ctx context.Context, token string) context.Context
- func SetCtxTokenClaims(ctx context.Context, claims jwt.MapClaims) context.Context
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCtxToken ¶ added in v0.7.5
GetCtxToken gets the raw token from the context
Parameters:
- ctx: The context to get the raw token from
Returns:
- string: The raw token
- error: An error if the raw token is not found or is of an unexpected type
func GetCtxTokenClaims ¶ added in v0.7.5
GetCtxTokenClaims gets the token claims from the context
Parameters:
- ctx: The context to get the token claims from
Returns:
- jwt.MapClaims: The token claims
- error: An error if the token claims are not found or are of an unexpected type
func GetCtxTokenClaimsJwtID ¶ added in v0.7.5
GetCtxTokenClaimsJwtID gets the token claims JWT ID from the context
Parameters:
- ctx: The context to get the token claims JWT ID from
Returns:
- string: The token claims JWT ID
- error: An error if the token claims JWT ID is not found or is of an unexpected type
func GetCtxTokenClaimsSubject ¶ added in v0.7.5
GetCtxTokenClaimsSubject gets the token claims subject from the context
Parameters:
- ctx: The context to get the token claims subject from
Returns:
- string: The token claims subject
- error: An error if the token claims subject is not found or is of an unexpected type
func SetCtxToken ¶ added in v0.7.5
SetCtxToken sets the raw token to the context
Parameters:
- ctx: The context to set the raw token to
- token: The raw token to set
Returns:
- context.Context: The context with the raw token set
func SetCtxTokenClaims ¶ added in v0.7.5
SetCtxTokenClaims sets the token claims to the context
Parameters:
- ctx: The context to set the token claims to
- claims: The token claims to set
Returns:
- context.Context: The context with the token claims set
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.