Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Authn ¶
func Authn() gin.HandlerFunc
Authn is an authentication Gin middleware used to extract and validate a token from gin.Context If the token is valid, it sets the `sub` from the token as the <username> in gin.Context's XUsernameKey key
func Authz ¶
func Authz(a Auther) gin.HandlerFunc
Authz is the middleware that authorizes the parsed request path with casbin
func Cors ¶
Cors is a Gin middleware used to set the headers for OPTIONS requests then exit the middleware chain and complete the request (for handling browser cross-origin requests).
func NoCache ¶
NoCache is a Gin middleware used to disable client-side caching of HTTP request response
func RequestID ¶
func RequestID() gin.HandlerFunc
RequestID is a Gin middleware used to inject the `X-Request-ID` key-value pair into the context and response of each HTTP request