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.
Click to show internal directories.
Click to hide internal directories.