Documentation
¶
Index ¶
- Variables
- func ClearCtxAccessToken(ctx context.Context) (context.Context, error)
- func ClearCtxAccessTokenClaims(ctx context.Context) (context.Context, error)
- func ClearCtxAll(ctx context.Context) (context.Context, error)
- func ClearCtxRefreshToken(ctx context.Context) (context.Context, error)
- func ClearCtxRefreshTokenClaims(ctx context.Context) (context.Context, error)
- func ClearCtxToken(ctx context.Context, key string) (context.Context, error)
- func ClearCtxTokenClaims(ctx context.Context, key string) (context.Context, error)
- func ClearCtxTokens(ctx context.Context) (context.Context, error)
- func ClearCtxTokensClaims(ctx context.Context) (context.Context, error)
- func GetCtxAccessToken(ctx context.Context) (string, error)
- func GetCtxAccessTokenClaims(ctx context.Context) (jwt.MapClaims, error)
- func GetCtxAccessTokenClaimsJwtID(ctx context.Context) (string, error)
- func GetCtxAccessTokenClaimsSubject(ctx context.Context) (string, error)
- func GetCtxRefreshToken(ctx context.Context) (string, error)
- func GetCtxRefreshTokenClaims(ctx context.Context) (jwt.MapClaims, error)
- func GetCtxRefreshTokenClaimsJwtID(ctx context.Context) (string, error)
- func GetCtxRefreshTokenClaimsSubject(ctx context.Context) (string, error)
- func GetCtxToken(ctx context.Context, key string) (string, error)
- func GetCtxTokenClaims(ctx context.Context, key string) (jwt.MapClaims, error)
- func GetCtxTokenClaimsJwtID(ctx context.Context, key string) (string, error)
- func GetCtxTokenClaimsSubject(ctx context.Context, key string) (string, error)
- func SetCtxAccessToken(ctx context.Context, token string) context.Context
- func SetCtxAccessTokenClaims(ctx context.Context, claims jwt.MapClaims) context.Context
- func SetCtxRefreshToken(ctx context.Context, token string) context.Context
- func SetCtxRefreshTokenClaims(ctx context.Context, claims jwt.MapClaims) context.Context
- func SetCtxToken(ctx context.Context, key, token string) context.Context
- func SetCtxTokenClaims(ctx context.Context, key string, claims jwt.MapClaims) context.Context
Constants ¶
This section is empty.
Variables ¶
var ( ErrMissingToken = errors.New("missing token") ErrUnexpectedTokenType = errors.New("unexpected type") ErrMissingTokenClaims = errors.New("missing token claims") ErrMissingTokenClaimsSubject = errors.New("missing token claims subject") ErrMissingTokenClaimsID = errors.New("missing token claims id") ErrUnexpectedTokenClaimsType = errors.New("unexpected token claims type") )
Functions ¶
func ClearCtxAccessToken ¶ added in v0.5.3
ClearCtxAccessToken clears the raw access token from the context
Parameters:
- ctx: The context to clear the raw access token from
Returns:
- context.Context: The context with the raw access token cleared
- error: An error if the context is nil
func ClearCtxAccessTokenClaims ¶ added in v0.5.3
ClearCtxAccessTokenClaims clears the access token claims from the context
Parameters:
- ctx: The context to clear the access token claims from
Returns:
- context.Context: The context with the access token claims cleared
- error: An error if the context is nil
func ClearCtxAll ¶ added in v0.5.3
ClearCtxAll clears all tokens and claims from the context
Parameters:
- ctx: The context to clear the tokens and claims from
Returns:
- context.Context: The context with the tokens and claims cleared
- error: An error if the context is nil
func ClearCtxRefreshToken ¶ added in v0.5.3
ClearCtxRefreshToken clears the raw refresh token from the context
Parameters:
- ctx: The context to clear the raw refresh token from
Returns:
- context.Context: The context with the raw refresh token cleared
- error: An error if the context is nil
func ClearCtxRefreshTokenClaims ¶ added in v0.5.3
ClearCtxRefreshTokenClaims clears the refresh token claims from the context
Parameters:
- ctx: The context to clear the refresh token claims from
Returns:
- context.Context: The context with the refresh token claims cleared
- error: An error if the context is nil
func ClearCtxToken ¶ added in v0.5.3
ClearCtxToken clears the raw token from the context
Parameters:
- ctx: The context to clear the raw token from
- key: The key to clear the token from
Returns:
- context.Context: The context with the raw token cleared
- error: An error if the context is nil
func ClearCtxTokenClaims ¶ added in v0.5.2
ClearCtxTokenClaims clears the token claims from the context
Parameters:
- ctx: The context to clear the token claims from
- key: The key to clear the claims from
Returns:
- context.Context: The context with the token claims cleared
- error: An error if the context is nil
func ClearCtxTokens ¶ added in v0.5.3
ClearCtxTokens clears all tokens from the context
Parameters:
- ctx: The context to clear the tokens from
Returns:
- context.Context: The context with the tokens cleared
- error: An error if the context is nil
func ClearCtxTokensClaims ¶ added in v0.5.3
ClearCtxTokensClaims clears all tokens claims from the context
Parameters:
- ctx: The context to clear the tokens claims from
Returns:
- context.Context: The context with the tokens claims cleared
- error: An error if the context is nil
func GetCtxAccessToken ¶ added in v0.5.3
GetCtxAccessToken gets the raw access token from the context
Parameters:
- ctx: The context to get the raw access token from
Returns:
- string: The raw access token
- error: An error if the raw access token is not found or is of an unexpected type
func GetCtxAccessTokenClaims ¶ added in v0.5.3
GetCtxAccessTokenClaims gets the access token claims from the context
Parameters:
- ctx: The context to get the access token claims from
Returns:
- jwt.MapClaims: The access token claims
- error: An error if the access token claims are not found or are of an unexpected type
func GetCtxAccessTokenClaimsJwtID ¶ added in v0.5.3
GetCtxAccessTokenClaimsJwtID gets the access token claims JWT ID from the context
Parameters:
- ctx: The context to get the access token claims JWT ID from
Returns:
- string: The access token claims JWT ID
- error: An error if the access token claims JWT ID is not found or is of an unexpected type
func GetCtxAccessTokenClaimsSubject ¶ added in v0.5.3
GetCtxAccessTokenClaimsSubject gets the access token claims subject from the context
Parameters:
- ctx: The context to get the access token claims subject from
Returns:
- string: The access token claims subject
- error: An error if the access token claims subject is not found or is of an unexpected type
func GetCtxRefreshToken ¶ added in v0.5.3
GetCtxRefreshToken gets the raw refresh token from the context
Parameters:
- ctx: The context to get the raw refresh token from
Returns:
- string: The raw refresh token
- error: An error if the raw refresh token is not found or is of an unexpected type
func GetCtxRefreshTokenClaims ¶ added in v0.5.3
GetCtxRefreshTokenClaims gets the refresh token claims from the context
Parameters:
- ctx: The context to get the refresh token claims from
Returns:
- jwt.MapClaims: The refresh token claims
- error: An error if the refresh token claims are not found or are of an unexpected type
func GetCtxRefreshTokenClaimsJwtID ¶ added in v0.5.3
GetCtxRefreshTokenClaimsJwtID gets the refresh token claims JWT ID from the context
Parameters:
- ctx: The context to get the refresh token claims JWT ID from
Returns:
- string: The refresh token claims JWT ID
- error: An error if the refresh token claims JWT ID is not found or is of an unexpected type
func GetCtxRefreshTokenClaimsSubject ¶ added in v0.5.3
GetCtxRefreshTokenClaimsSubject gets the refresh token claims subject from the context
Parameters:
- ctx: The context to get the refresh token claims subject from
Returns:
- string: The refresh token claims subject
- error: An error if the refresh token claims subject is not found or is of an unexpected type
func GetCtxToken ¶ added in v0.5.3
GetCtxToken gets the raw token from the context
Parameters:
- ctx: The context to get the raw token from
- key: The key to get the 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 ¶
GetCtxTokenClaims gets the token claims from the context
Parameters:
- ctx: The context to get the token claims from
- key: The key to get the 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.5.3
GetCtxTokenClaimsJwtID gets the token claims JWT ID from the context
Parameters:
- ctx: The context to get the token claims JWT ID from
- key: The key to get the claims 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 ¶
GetCtxTokenClaimsSubject gets the token claims subject from the context
Parameters:
- ctx: The context to get the token claims subject from
- key: The key to get the claims 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 SetCtxAccessToken ¶ added in v0.5.3
SetCtxAccessToken sets the raw access token to the context
Parameters:
- ctx: The context to set the raw access token to
- token: The raw access token to set
Returns:
- context.Context: The context with the raw access token set
func SetCtxAccessTokenClaims ¶ added in v0.5.3
SetCtxAccessTokenClaims sets the access token claims to the context
Parameters:
- ctx: The context to set the access token claims to
- claims: The access token claims to set
Returns:
- context.Context: The context with the access token claims set
func SetCtxRefreshToken ¶ added in v0.5.3
SetCtxRefreshToken sets the raw refresh token to the context
Parameters:
- ctx: The context to set the raw refresh token to
- token: The raw refresh token to set
Returns:
- context.Context: The context with the raw refresh token set
func SetCtxRefreshTokenClaims ¶ added in v0.5.3
SetCtxRefreshTokenClaims sets the refresh token claims to the context
Parameters:
- ctx: The context to set the refresh token claims to
- claims: The refresh token claims to set
Returns:
- context.Context: The context with the refresh token claims set
func SetCtxToken ¶ added in v0.5.3
SetCtxToken sets the raw token to the context
Parameters:
- ctx: The context to set the raw token to
- key: The key to set the token under
- token: The raw token to set
Returns:
- context.Context: The context with the raw token set
func SetCtxTokenClaims ¶
SetCtxTokenClaims sets the token claims to the context
Parameters:
- ctx: The context to set the token claims to
- key: The key to set the claims under
- claims: The token claims to set
Returns:
- context.Context: The context with the token claims set
Types ¶
This section is empty.