Documentation ¶
Index ¶
- Variables
- func GetAuthorizationTokenFromMetadata(md metadata.MD) (string, error)
- func GetClientIP(ctx context.Context) (string, error)
- func GetCtxTokenClaims(ctx context.Context) (*jwt.MapClaims, error)
- func GetCtxTokenClaimsJwtId(ctx context.Context) (string, error)
- func GetCtxTokenClaimsSharedUserId(ctx context.Context) (string, error)
- func GetCtxTokenClaimsUserId(ctx context.Context) (string, error)
- func GetCtxTokenString(ctx context.Context) (string, error)
- func GetGCloudAuthorizationTokenFromMetadata(md metadata.MD) (string, error)
- func GetTokenFromMetadata(md metadata.MD, tokenKey string) (string, error)
- func SetCtxTokenClaims(ctx context.Context, claims *jwt.MapClaims) context.Context
- func SetCtxTokenString(ctx context.Context, token string) context.Context
Constants ¶
This section is empty.
Variables ¶
var ( MissingTokenError = errors.New("missing token") UnexpectedTokenTypeError = errors.New("unexpected type") MissingTokenClaimsError = errors.New("missing token claims") MissingTokenClaimsUserIdError = errors.New("missing token claims user id") MissingTokenClaimsIdError = errors.New("missing token claims id") UnexpectedTokenClaimsTypeError = errors.New("unexpected token claims type") FailedToGetPeerFromContextError = errors.New("failed to get peer from context") )
Functions ¶
func GetAuthorizationTokenFromMetadata ¶
GetAuthorizationTokenFromMetadata gets the authorization token from the metadata
func GetClientIP ¶ added in v0.6.28
GetClientIP extracts the client IP address from the context
func GetCtxTokenClaims ¶
GetCtxTokenClaims gets the token claims from the context
func GetCtxTokenClaimsJwtId ¶ added in v0.6.22
GetCtxTokenClaimsJwtId gets the token claims JWT ID from the context
func GetCtxTokenClaimsSharedUserId ¶ added in v0.6.22
GetCtxTokenClaimsSharedUserId gets the token claims shared user ID from the context
func GetCtxTokenClaimsUserId ¶ added in v0.6.22
GetCtxTokenClaimsUserId gets the token claims user ID from the context
func GetCtxTokenString ¶
GetCtxTokenString gets the token string from the context
func GetGCloudAuthorizationTokenFromMetadata ¶
GetGCloudAuthorizationTokenFromMetadata gets the GCloud authorization token from the metadata
func GetTokenFromMetadata ¶
GetTokenFromMetadata gets the token from the metadata
func SetCtxTokenClaims ¶
SetCtxTokenClaims sets the token claims to the context
Types ¶
This section is empty.