middleware

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCORS

func NewCORS(cfg CORSConfig) emir.RequestHandler

func NewJWT

func NewJWT(cfg JWTConfig) emir.RequestHandler

func NewJWTWithCustomClaims

func NewJWTWithCustomClaims(cfg JWTWithCustomConfig) emir.RequestHandler

func NewRequestID added in v0.0.4

func NewRequestID() emir.RequestHandler

Types

type CORSConfig

type CORSConfig struct {
	AllowedOrigins   []string
	AllowedMethods   []string
	AllowedHeaders   []string
	AllowCredentials bool
	AllowMaxAge      int
	ExposedHeaders   []string
}

type JWTConfig

type JWTConfig struct {
	TokenLookupIn   string
	TokenLookupName string
	Key             []byte
	Algo            string
	AuthScheme      []byte
	ClaimsKey       string
}

type JWTWithCustomConfig

type JWTWithCustomConfig struct {
	TokenLookupIn   string
	TokenLookupName string
	Key             []byte
	Algo            string
	AuthScheme      []byte
	ClaimsKey       string
	ClaimFactory    func() interface{}
	ClaimReleaser   func(interface{})
	Validator       jwt.ValidatorFunction
}

Jump to

Keyboard shortcuts

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