auth

package
v0.0.0-...-e417875 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 5 Imported by: 32

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 creates a new authentication 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