Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromAuthHeader ¶
FromAuthHeader is a "TokenExtractor" that takes a give request and extracts the JWT token from the Authorization header.
Types ¶
type Options ¶
type Options struct { // The name of the property in the request where the user information // from the JWT will be stored. // Default value: "user" XssecProperty string // The function that will be called when there's an error validating the token // Default value: ErrorHandler errorHandler // Debug flag turns on debugging output // Default: false Debug bool // Function to Validate JKU JKUValidator validation.JKUValidationFunc // Function to make xsuaa specific audience and clientId checks AudienceValidator validation.JWTValidationFunc // The function that will return the Key to validate the JWT. // It can be either a shared secret or a public key. // Default value: nil ValidationKeyGetter jwt.Keyfunc }
Options is a struct for specifying configuration options for the middleware.
type XssecMiddleware ¶
type XssecMiddleware struct { Options Options XsuaaConfig config.XsuaaConfig }
func NewXssecMiddleware ¶
func NewXssecMiddleware(xsuaaConfig config.XsuaaConfig, options ...Options) (*XssecMiddleware, error)
New constructs a new Secure instance with supplied options.
func (*XssecMiddleware) CheckJWT ¶
func (m *XssecMiddleware) CheckJWT(w http.ResponseWriter, r *http.Request) error
func (*XssecMiddleware) Handler ¶
func (m *XssecMiddleware) Handler(h http.HandlerFunc) http.HandlerFunc
Click to show internal directories.
Click to hide internal directories.