apikey

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator

type Authenticator struct {
	// contains filtered or unexported fields
}

Authenticator authenticates the request based on the header on the following header key and value: Authorization: Apikey {api key}, where {api key} is the key.

func New

func New(val Validator) (*Authenticator, error)

New constructor.

func (*Authenticator) Authenticate

func (a *Authenticator) Authenticate(req *http.Request) (bool, error)

Authenticate parses the header for the specified key and authenticates it.

type Validator

type Validator interface {
	Validate(key string) (bool, error)
}

Validator interface for validating keys.

Jump to

Keyboard shortcuts

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