Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppHandler ¶
type AppHandler func(w http.ResponseWriter, r *http.Request) error
AppHandler is handler that will fail if user is not authorized (based on token + required scope)
func (AppHandler) ServeHTTP ¶
func (ah AppHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
Satisfies the http.Handler interface
type AppHandlerWithUserInfo ¶
AppHandlerWithUserInfo is a handler that has extra *UserInfo as parameter
func (AppHandlerWithUserInfo) ServeHTTP ¶
func (ah AppHandlerWithUserInfo) ServeHTTP(w http.ResponseWriter, r *http.Request)
Satisfies the http.Handler interface
type AppHandlerWithUserInfoAllowAnonymous ¶
type AppHandlerWithUserInfoAllowAnonymous func(userInfo *UserInfo, w http.ResponseWriter, r *http.Request) error
AppHandlerWithUserInfoAllowAnonymous is a handler that allows user also not to be authenticated. In this case userInfo is nil
func (AppHandlerWithUserInfoAllowAnonymous) ServeHTTP ¶
func (ah AppHandlerWithUserInfoAllowAnonymous) ServeHTTP(w http.ResponseWriter, r *http.Request)
Satisfies the http.Handler interface
type Authorization ¶
type Authorization struct {
// contains filtered or unexported fields
}
Authorization object
func New ¶
func New(jwks jwk.Set, requiredScope string) (a *Authorization)
New create new AuthMiddleware object
func (*Authorization) Middleware ¶
func (a *Authorization) Middleware(h http.Handler) http.Handler
Middleware returns middleware function that can be used in router.Use()
Click to show internal directories.
Click to hide internal directories.