Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ForceFail ¶
func ForceFail() goa.Middleware
ForceFail is a middleware illustrating the use of validation middleware with JWT auth. It checks for the presence of a "fail" query string and fails validation if set to the value "true".
func LoadJWTPublicKeys ¶
LoadJWTPublicKeys loads PEM encoded RSA public keys used to validata and decrypt the JWT.
func LogRequest ¶
func LogRequest(verbose bool, sensitiveHeaders ...string) goa.Middleware
func LogResponse ¶
func LogResponse() goa.Middleware
func NewJWTMiddleware ¶
func NewJWTMiddleware() (goa.Middleware, error)
NewJWTMiddleware creates a middleware that checks for the presence of a JWT Authorization header and validates its content. A real app would probably use goa's JWT security middleware instead.
Note: the code below assumes the example is compiled against the master branch of goa. If compiling against goa v1 the call to jwt.New needs to be:
middleware := jwt.New(keys, ForceFail(), app.NewJWTSecurity())
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.