Versions in this module Expand all Collapse all v0 v0.0.4 Jul 9, 2022 Changes in this version + const AuthorizationHeader + const AuthorizationQuery + const BearerTokenType + var ProviderSet = wire.NewSet(NewTokenizer, NewTokenizerConfig) + func ExtractHeaderToken(token string) string + func FromJWTContext(ctx context.Context) (jwt string, ok bool) + func NewClaimsContext(ctx context.Context, claims *Claims) context.Context + func NewJWTContext(ctx context.Context, jwt string) context.Context + func ServerAuth(logger log.Logger) middleware.Middleware + func ServerExtract(tokenizer Tokenizer, logger log.Logger) middleware.Middleware + func ServerExtractAndAuth(tokenizer Tokenizer, logger log.Logger) middleware.Middleware + type Claims struct + ClientId string + Uid string + func ExtractAndValidate(tokenizer Tokenizer, t string) (*Claims, error) + func FromClaimsContext(ctx context.Context) (claims *Claims, ok bool) + func NewClientClaim(clientId string) *Claims + func NewUserClaim(userId string) *Claims + type Tokenizer interface + Issue func(claims *Claims, duration time.Duration) (token string, err error) + Parse func(token string) (claims *Claims, err error) + func NewTokenizer(c *TokenizerConfig) Tokenizer + type TokenizerConfig struct + ExpireDuration time.Duration + Issuer string + Secret string + func NewTokenizerConfig(c *conf.Security) *TokenizerConfig