Documentation ¶
Index ¶
- Variables
- func AuthMiddleware(verifyFn VerifyTokenFunc) func(next http.Handler) http.Handler
- func GetClientIDFromContext(ctx context.Context) (string, bool)
- func GetTokenInfoFromContext(ctx context.Context) (*client.TokenInfo, bool)
- func GetUserIDFromContext(ctx context.Context) (string, bool)
- func GokitAuthMiddleware(verifyFn VerifyTokenFunc) endpoint.Middleware
- func SetTokenInfoToContext(ctx context.Context, info *client.TokenInfo) context.Context
- func VerifyJWT(signingKey string) func(string, client.TokenType) (*client.TokenInfo, error)
- type ContextKey
- type VerifyTokenFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var TokenInfoKey = ContextKey{}
TokenInfoKey is a key for token info in context.
Functions ¶
func AuthMiddleware ¶
func AuthMiddleware(verifyFn VerifyTokenFunc) func(next http.Handler) http.Handler
AuthMiddleware is a middleware that checks if the request is authorized.
func GetClientIDFromContext ¶
GetClientIDFromContext gets client id from context.
func GetTokenInfoFromContext ¶
GetTokenInfoFromContext gets token info from context.
func GetUserIDFromContext ¶
GetUserIDFromContext gets user id from context.
func GokitAuthMiddleware ¶
func GokitAuthMiddleware(verifyFn VerifyTokenFunc) endpoint.Middleware
GokitAuthMiddleware is a middleware for gokit
func SetTokenInfoToContext ¶
SetTokenInfoToContext sets token info to context.
Types ¶
Click to show internal directories.
Click to hide internal directories.