Versions in this module Expand all Collapse all v3 v3.7.3 Apr 29, 2020 Changes in this version + var APIKey = TokenType(enc.EncodeToString([]byte("key"))) + var AccessToken = TokenType(enc.EncodeToString([]byte("acc"))) + var AuthorizationCode = TokenType(enc.EncodeToString([]byte("aut"))) + var RefreshToken = TokenType(enc.EncodeToString([]byte("ref"))) + func GenerateID(_ context.Context) (string, error) + func GenerateKey(_ context.Context) (string, error) + func Hash(ctx context.Context, plain string) (string, error) + func JoinToken(tokenType TokenType, id, key string) string + func NewContextWithHashValidator(parent context.Context, hashValidator HashValidator) context.Context + func NewContextWithX509DN(ctx context.Context, name pkix.Name) context.Context + func Validate(hashed, plain string) (bool, error) + func X509DNFromContext(ctx context.Context) (pkix.Name, bool) + type HashValidator interface + Hash func(plain string) (string, error) + Name func() string + Validate func(hashed, plain string) (bool, error) + func HashValidatorFromContext(ctx context.Context) HashValidator + type TokenType string + func SplitToken(token string) (tokenType TokenType, id, key string, err error) + func (t TokenType) Generate(ctx context.Context, id string) (token string, err error)