Documentation ¶
Overview ¶
Package httpauth handles HTTP Basic authentication with supplied authentication functions
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrBasicAuthInvalid = errors.New("basic auth invalid")
ErrBasicAuthInvalid is returned when the basic authentication is invalid (missing header, invalid request, etc).
Functions ¶
Types ¶
type AuthProvider ¶
AuthProvider is a function that given a username, password and request, authenticates the user.
type BasicAuthHandler ¶
type BasicAuthHandler struct { Handler http.Handler RemoveAuth bool BypassPaths []string *BasicAuthWrapper }
BasicAuthHandler is a http.Handler that uses BasicAuthWrapper to provide basic authentication support.
func (*BasicAuthHandler) ServeHTTP ¶
func (b *BasicAuthHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP Satisfies the http.Handler interface for basicAuth.
type BasicAuthWrapper ¶
type BasicAuthWrapper struct { Cache *cache.Cache Realm string Logger *zap.Logger AuthFunc AuthProvider CacheDuration time.Duration }
BasicAuthWrapper provides a wrapper that can authenticate using basic auth headers.
Click to show internal directories.
Click to hide internal directories.