Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotAuthorized = errors.New("not authorized")
Functions ¶
This section is empty.
Types ¶
type AlwaysAllowAuthenticator ¶
type AlwaysAllowAuthenticator struct { }
AlwaysAllowAuthenticator accepts any access token.
func AlwaysAllow ¶
func AlwaysAllow() *AlwaysAllowAuthenticator
func (*AlwaysAllowAuthenticator) Authenticate ¶
func (a *AlwaysAllowAuthenticator) Authenticate(ctx context.Context, token string) error
type Authenticator ¶
type StaticAuthenticator ¶
type StaticAuthenticator struct {
AllowedTokens []string
}
StaticAuthenticator accepts a list of predetermined access tokens.
func Static ¶
func Static(tokens ...string) *StaticAuthenticator
func (*StaticAuthenticator) Authenticate ¶
func (a *StaticAuthenticator) Authenticate(ctx context.Context, token string) error
Click to show internal directories.
Click to hide internal directories.