Documentation
¶
Index ¶
Constants ¶
View Source
const ( ContextUsernameKey contextKey = "username" // Does not use contextKey type because the jwt middleware improperly updates context with string key type // See https://github.com/auth0/go-jwt-middleware/blob/master/jwtmiddleware.go#L232 ContextAuthKey string = "user" )
Variables ¶
This section is empty.
Functions ¶
func GetUsernameFromContext ¶
Types ¶
type AuthorizationMiddleware ¶
func NewAuthzMiddleware ¶
func NewAuthzMiddleware(ocmClient *ocm.Client, action, resourceType string) AuthorizationMiddleware
func NewAuthzMiddlewareMock ¶
func NewAuthzMiddlewareMock() AuthorizationMiddleware
type JWTMiddleware ¶
type Middleware ¶
type Middleware struct{}
func NewAuthMiddleware ¶
func NewAuthMiddleware() (*Middleware, error)
func (*Middleware) AuthenticateAccountJWT ¶
func (a *Middleware) AuthenticateAccountJWT(next http.Handler) http.Handler
AuthenticateAccountJWT Middleware handler to validate JWT tokens and authenticate users
type MiddlewareMock ¶
type MiddlewareMock struct{}
func (*MiddlewareMock) AuthenticateAccountJWT ¶
func (a *MiddlewareMock) AuthenticateAccountJWT(next http.Handler) http.Handler
type Payload ¶
type Payload struct {
Username string `json:"username"`
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
Email string `json:"email"`
Issuer string `json:"iss"`
ClientID string `json:"clientId"`
}
AuthPayload defines the structure of the JWT payload we expect from RHD JWT tokens
Click to show internal directories.
Click to hide internal directories.