Documentation ¶
Index ¶
- Variables
- func Authorizer(core *security.ServiceCore) func(logger *zap.SugaredLogger, scopes ...string) echo.MiddlewareFunc
- func JWTHandler(config *JwtConfig) echo.MiddlewareFunc
- func LoggerFilter(config LoggerConfig) echo.MiddlewareFunc
- func NoOpAuthorizer(logger *zap.SugaredLogger, scopes ...string) echo.MiddlewareFunc
- func RecoverWithConfig(config middleware.RecoverConfig, logger *zap.SugaredLogger) echo.MiddlewareFunc
- type JSONWebKeys
- type Jwks
- type JwtConfig
- type LoggerConfig
- type Response
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrJWTMissing = echo.NewHTTPError(http.StatusBadRequest, "missing or malformed jwt") ErrJWTInvalid = echo.NewHTTPError(http.StatusUnauthorized, "invalid or expired jwt") )
Errors
View Source
var DefaultRecoverConfig = middleware.RecoverConfig{ Skipper: middleware.DefaultSkipper, StackSize: 4 << 10, DisableStackAll: false, DisablePrintStack: false, LogLevel: 0, }
DefaultRecoverConfig is the default Recover middleware config.
Functions ¶
func Authorizer ¶
func Authorizer(core *security.ServiceCore) func(logger *zap.SugaredLogger, scopes ...string) echo.MiddlewareFunc
func JWTHandler ¶
func JWTHandler(config *JwtConfig) echo.MiddlewareFunc
func LoggerFilter ¶
func LoggerFilter(config LoggerConfig) echo.MiddlewareFunc
func NoOpAuthorizer ¶
func NoOpAuthorizer(logger *zap.SugaredLogger, scopes ...string) echo.MiddlewareFunc
func RecoverWithConfig ¶
func RecoverWithConfig(config middleware.RecoverConfig, logger *zap.SugaredLogger) echo.MiddlewareFunc
Types ¶
type JSONWebKeys ¶
type Jwks ¶
type Jwks struct {
Keys []JSONWebKeys `json:"keys"`
}
type JwtConfig ¶
type JwtConfig struct { // Skipper defines a function to skip middleware. Skipper middleware.Skipper // BeforeFunc defines a function which is executed just before the middleware. BeforeFunc middleware.BeforeFunc Cache *jwk.Cache Wellknown string Audience []string Issuer []string // This is set if Node security is enabled NodePublicKey *rsa.PublicKey NodeAudience []string NodeIssuer []string }
func (*JwtConfig) ValidateToken ¶
type LoggerConfig ¶
type LoggerConfig struct { // Skipper defines a function to skip middleware. Skipper middleware.Skipper // BeforeFunc defines a function which is executed just before the middleware. BeforeFunc middleware.BeforeFunc Logger *zap.Logger StatsdClient statsd.ClientInterface }
Click to show internal directories.
Click to hide internal directories.