auth

package
v0.0.0-...-7389028 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2020 License: MPL-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TokenAuthenticator

type TokenAuthenticator struct {
	Enabled bool     `envconfig:"AUTH_ENABLED"`
	Tokens  []string `envconfig:"AUTH_TOKENS"`
}

TokenAuthenticator will process authentication against a static set of tokens.

func NewTokenAuthenticator

func NewTokenAuthenticator(enabled bool, tokens []string) *TokenAuthenticator

NewTokenAuthenticator will return an authenticator that will validate using a whitelisted set of tokens.

func (TokenAuthenticator) IsEnabled

func (authenticator TokenAuthenticator) IsEnabled() bool

IsEnabled will return if enabled.

func (TokenAuthenticator) Validate

func (authenticator TokenAuthenticator) Validate(ctx context.Context, token string) (context.Context, bool)

Validate will validate an incoming request token against the valid group.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL