Documentation ¶
Index ¶
- func AddContextValue(req *http.Request, key, val interface{})
- func GetContextValue(req *http.Request, key interface{}, defaultValue interface{}) interface{}
- func JwtClaim(req *http.Request) *jwtclaim.ScopeClaims
- func Scopes(req *http.Request) []string
- func SetJwtClaim(req *http.Request, jwtClaim *jwtclaim.ScopeClaims)
- func SetScopes(req *http.Request, scopes []string)
- func SetUsername(req *http.Request, username string)
- func Username(req *http.Request) string
- type MiddlewareContextKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddContextValue ¶
Add a context value to an http request without having to override request by yourself
func GetContextValue ¶
func JwtClaim ¶
func JwtClaim(req *http.Request) *jwtclaim.ScopeClaims
retrieve jwt claim from request context
func SetJwtClaim ¶
func SetJwtClaim(req *http.Request, jwtClaim *jwtclaim.ScopeClaims)
set jwt claim to a request context
func SetUsername ¶
Set the username to a request context
Types ¶
type MiddlewareContextKey ¶
type MiddlewareContextKey int
const ( ScopeContextKey MiddlewareContextKey = iota UsernameContextKey JwtClaimContextKey )
Click to show internal directories.
Click to hide internal directories.