Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidRequest = errors.New("invalid_request") ErrInvalidToken = errors.New("invalid_token") ErrInsufficientScope = errors.New("insufficient_scope") ErrNoAuthToken = errors.New("no_auth") )
Exported Errors
Functions ¶
This section is empty.
Types ¶
type Middleware ¶
type Middleware struct {
// contains filtered or unexported fields
}
Middleware enforces authentication on protected routes.
func NewMiddleware ¶
func NewMiddleware(root string, config *Options) (*Middleware, error)
NewMiddleware returns a middlware suitable for authentication.
func (*Middleware) LoginHandler ¶
func (m *Middleware) LoginHandler() http.Handler
LoginHandler returns a router that handles the login and logout routes.
func (*Middleware) ServeHTTP ¶
func (m *Middleware) ServeHTTP(w http.ResponseWriter, r *http.Request, n http.HandlerFunc)
Click to show internal directories.
Click to hide internal directories.