Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Middleware ¶
type Middleware struct { // Target url to get user data using Authorization header Target string // Callback function that should perform the authorization of the authenticated user. // Called only when authentication was successful. Must return true on success, // false on failure. Optional, default to success. Authorizator func(data []byte, request *rest.Request) bool }
Middleware provides a jwt proxied authentication. On failure, a 401 HTTP response is returned. On success, the wrapped middleware is called, and the raw user data is made available as request.Env["USER_DATA"].(interface)
func (*Middleware) MiddlewareFunc ¶
func (mw *Middleware) MiddlewareFunc(handler rest.HandlerFunc) rest.HandlerFunc
MiddlewareFunc makes Middleware implement the Middleware interface.
Click to show internal directories.
Click to hide internal directories.