Documentation
¶
Overview ¶
Basic authentication provides a simple username/password authentication passed in authentication header.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMissingCredentials = errors.New("no credentials provided in request") ErrBadCredentials = errors.New("bad username or password") )
Functions ¶
This section is empty.
Types ¶
type Basic ¶
type Basic struct {
BasicMiddleware
Username string
Password string
}
Basic is a rudimentary backend for auth. It uses a username and password to authenticate the user. The password is generated if not provided.
type BasicMiddleware ¶
type BasicMiddleware struct {
Basic *Basic
}
func (BasicMiddleware) AuthMiddleware ¶
func (a BasicMiddleware) AuthMiddleware(next http.Handler) http.Handler
AuthMiddleware is a middleware that checks the authentication of the user
Click to show internal directories.
Click to hide internal directories.