Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewErrUnauthorised ¶
Types ¶
type Authenticator ¶
type Authenticator interface { // Authenticate takes a token and returns an authenticated Customer Authenticate(ctx context.Context, tokenStr string) (*Customer, *Token, error) // CanAccept takes a token and return true if it is supported. This function does not authenticate the token, only // whether the Authenticator can handle it. CanAccept(token string) bool }
type Customer ¶
type ErrUnauthorised ¶
type ErrUnauthorised struct {
// contains filtered or unexported fields
}
func (ErrUnauthorised) Error ¶
func (e ErrUnauthorised) Error() string
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider holds a slice of available authenticators
func NewProvider ¶
func NewProvider(authenticators ...Authenticator) *Provider
NewProvider returns a new Provider containing the provided authenticators
Click to show internal directories.
Click to hide internal directories.