sample_middleware

package
v0.0.0-...-abdcf8d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 7, 2019 License: GPL-3.0 Imports: 16 Imported by: 0

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

func LoadJWTPublicKeys() ([]*rsa.PublicKey, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL