Versions in this module Expand all Collapse all v2 v2.11.4 Mar 7, 2021 v2.11.3 Mar 7, 2021 Changes in this version + var ErrInvalidToken = errors.New("strategies/token: Invalid token") + var ErrNOOP = errors.New("strategies/token: NOOP") + var ErrTokenNotFound = errors.New("strategies/token: Token does not exists") + var ErrTokenScopes = errors.New(...) + func GetNamedScopes(info auth.Info) (scopes []string) + func New(fn AuthenticateFunc, ac auth.Cache, opts ...auth.Option) auth.Strategy + func NewStatic(tokens map[string]auth.Info, opts ...auth.Option) auth.Strategy + func NewStaticFromFile(path string, opts ...auth.Option) (auth.Strategy, error) + func NoOpAuthenticate(ctx context.Context, r *http.Request, token string) (auth.Info, time.Time, error) + func SetHash(h crypto.Hash, key []byte) auth.Option + func SetParser(p Parser) auth.Option + func SetScopes(scopes ...Scope) auth.Option + func SetType(t Type) auth.Option + func WithNamedScopes(info auth.Info, scopes ...string) + type AuthenticateFunc func(ctx context.Context, r *http.Request, token string) (auth.Info, time.Time, error) + type Parser interface + Token func(r *http.Request) (string, error) + func AuthorizationParser(key string) Parser + func CookieParser(key string) Parser + func JSONBodyParser(key string) Parser + func QueryParser(key string) Parser + func XHeaderParser(header string) Parser + type Scope interface + GetName func() string + Verify func(ctx context.Context, r *http.Request, info auth.Info, token string) (ok bool) + func NewScope(name, endpoint, method string) Scope + type Type string + const APIKey + const Bearer