Documentation ¶
Index ¶
- func Denylist(cfg *config.APIFWConfiguration, deniedTokens *denylist.DeniedTokens, ...) web.Middleware
- func Errors(logger *logrus.Logger) web.Middleware
- func Logger(logger *logrus.Logger) web.Middleware
- func MIMETypeIdentifier(logger *logrus.Logger) web.Middleware
- func Panics(logger *logrus.Logger) web.Middleware
- func Proxy(cfg *config.APIFWConfiguration, serverUrl *url.URL) web.Middleware
- func ShadowAPIMonitor(logger *logrus.Logger, config *config.ShadowAPI) web.Middleware
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Denylist ¶
func Denylist(cfg *config.APIFWConfiguration, deniedTokens *denylist.DeniedTokens, logger *logrus.Logger) web.Middleware
Denylist forbidden requests with tokens in the blacklist
func Errors ¶
func Errors(logger *logrus.Logger) web.Middleware
Errors handles errors coming out of the call chain. It detects normal application errors which are used to respond to the client in a uniform way. Unexpected errors (status >= 500) are logged.
func Logger ¶
func Logger(logger *logrus.Logger) web.Middleware
Logger writes some information about the request to the logs in the format: TraceID : (200) GET /foo -> IP ADDR (latency)
func MIMETypeIdentifier ¶
func MIMETypeIdentifier(logger *logrus.Logger) web.Middleware
MIMETypeIdentifier identifies the MIME type of the content in case of CT header is missing
func Panics ¶
func Panics(logger *logrus.Logger) web.Middleware
Panics recovers from panics and converts the panic to an error so it is reported in Metrics and handled in Errors.
func Proxy ¶
func Proxy(cfg *config.APIFWConfiguration, serverUrl *url.URL) web.Middleware
Proxy changes request scheme before request
func ShadowAPIMonitor ¶
ShadowAPIMonitor check each request for the params, methods or paths that are not specified in the OpenAPI specification and log each violation
Types ¶
This section is empty.