Documentation
¶
Index ¶
- Variables
- func GetCtxIssuedAccessToken(ctx context.Context) (string, error)
- func GetCtxIssuedRefreshToken(ctx context.Context) (string, error)
- func SetCtxIssuedAccessToken(ctx context.Context, issuedAccessToken string) context.Context
- func SetCtxIssuedRefreshToken(ctx context.Context, issuedRefreshToken string) context.Context
- type ContextKey
Constants ¶
This section is empty.
Variables ¶
var ( ErrNoTokenInContext = errors.New("no token in context") ErrInvalidTokenInContext = errors.New("invalid token in context") ErrNoTokenClaimsInContext = errors.New("no token claims in context") ErrInvalidTokenClaimsInContext = errors.New("invalid token claims in context") ErrNoIssuedAccessTokenInContext = errors.New("no issued access token in context") ErrInvalidIssuedAccessTokenInContext = errors.New("invalid issued access token in context") ErrNoIssuedRefreshTokenInContext = errors.New("no issued refresh token in context") ErrInvalidIssuedRefreshTokenInContext = errors.New("invalid issued refresh token in context") )
Functions ¶
func GetCtxIssuedAccessToken ¶
GetCtxIssuedAccessToken retrieves the issued access token from the context
Parameters:
- ctx: the context
Returns:
- string: the issued access token
- error: if there was an error retrieving the issued access token
func GetCtxIssuedRefreshToken ¶
GetCtxIssuedRefreshToken retrieves the issued refresh token from the context
Parameters:
- ctx: the context
Returns:
- string: the issued refresh token - error: if there was an error retrieving the issued refresh token
func SetCtxIssuedAccessToken ¶
SetCtxIssuedAccessToken sets the issued access token flag in the context
Parameters:
- ctx: the context - issuedAccessToken: the issued access token
Returns:
- context.Context: the context with the issued access token set
func SetCtxIssuedRefreshToken ¶
SetCtxIssuedRefreshToken sets the issued refresh token flag in the context
Parameters:
- ctx: the context - issuedRefreshToken: the issued refresh token
Returns:
- context.Context: the context with the issued refresh token set
Types ¶
type ContextKey ¶
type ContextKey string
ContextKey is the type for context keys
const ( // CtxIssuedAccessTokenKey is the context key for the issued access token CtxIssuedAccessTokenKey ContextKey = "issued_access_token" // CtxIssuedRefreshTokenKey is the context key for the issued refresh token CtxIssuedRefreshTokenKey ContextKey = "issued_refresh_token" )