auth

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const HarborSecret = secret.HeaderPrefix

HarborSecret is the prefix of the value of Authorization header.

Variables

View Source
var (
	// ErrInvalidCredential is returned when the auth token does not authenticate correctly.
	ErrInvalidCredential = errors.New("invalid authorization credential")
)
View Source
var (
	// ErrNoSecret ...
	ErrNoSecret = errors.New("no secret auth credentials")
)

Functions

This section is empty.

Types

type AuthenticationHandler

type AuthenticationHandler interface {

	// AuthorizeRequest ...
	AuthorizeRequest(req *http.Request) error
}

AuthenticationHandler is an interface for authorizing a request

func NewSecretHandler

func NewSecretHandler(secrets map[string]string) AuthenticationHandler

NewSecretHandler creaters a new authentiation handler which adds basic authentication credentials to a request.

Jump to

Keyboard shortcuts

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