context

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MissingTokenInContextError              = errors.New("missing token in context")
	UnexpectedTokenTypeInContextError       = errors.New("unexpected type in context")
	MissingTokenClaimsInContextError        = errors.New("missing token claims in context")
	UnexpectedTokenClaimsTypeInContextError = errors.New("unexpected token claims type in context")
)

Functions

func GetAuthorizationTokenFromMetadata

func GetAuthorizationTokenFromMetadata(md metadata.MD) (string, error)

GetAuthorizationTokenFromMetadata gets the authorization token from the metadata

func GetCtxTokenClaims

func GetCtxTokenClaims(ctx context.Context) (jwt.Claims, error)

GetCtxTokenClaims gets the token claims from the context

func GetCtxTokenString

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

GetCtxTokenString gets the token string from the context

func GetGCloudAuthorizationTokenFromMetadata

func GetGCloudAuthorizationTokenFromMetadata(md metadata.MD) (string, error)

GetGCloudAuthorizationTokenFromMetadata gets the GCloud authorization token from the metadata

func GetTokenFromMetadata

func GetTokenFromMetadata(md metadata.MD, tokenKey string) (string, error)

GetTokenFromMetadata gets the token from the metadata

func SetCtxTokenClaims

func SetCtxTokenClaims(ctx context.Context, claims jwt.Claims) context.Context

SetCtxTokenClaims sets the token claims to the context

func SetCtxTokenString

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

SetCtxTokenString sets the token string 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