Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMissingAuthorization = errors.New("missing authorization") ErrInvalidCredentials = errors.New("invalid credentials") )
Functions ¶
This section is empty.
Types ¶
type Authenticator ¶
type Authenticator struct { Type string Authenticate func(*http.Request) error Forbidden func(w http.ResponseWriter, r *http.Request, err error) }
Authenticator middleware
func (Authenticator) ServeHandler ¶
func (m Authenticator) ServeHandler(h http.Handler) http.Handler
ServeHandler implements middleware interface
type BasicAuthenticator ¶
type BasicAuthenticator struct { Realm string Authenticate func(r *http.Request, username, password string) error }
BasicAuthenticator middleware
func Basic ¶
func Basic(username, password string) *BasicAuthenticator
Basic creates new basic auth middleware
func (BasicAuthenticator) ServeHandler ¶
func (m BasicAuthenticator) ServeHandler(h http.Handler) http.Handler
ServeHandler implements middleware interface
type ForwardAuthenticator ¶ added in v0.11.0
type ForwardAuthenticator struct { URL *url.URL Client *http.Client AuthRequestHeaders []string AuthResponseHeaders []string }
ForwardAuthenticator middleware
func Forward ¶ added in v0.11.0
func Forward(url *url.URL) *ForwardAuthenticator
Forward creates new auth request middleware
func (ForwardAuthenticator) ServeHandler ¶ added in v0.11.0
func (m ForwardAuthenticator) ServeHandler(h http.Handler) http.Handler
Click to show internal directories.
Click to hide internal directories.