Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Middleware ¶ added in v0.10.0
type Middleware struct {
// contains filtered or unexported fields
}
Middleware is a middleware that provides Web Application Firewall (WAF) capabilities using Coraza.
func NewMiddleware ¶
func NewMiddleware(options Options) (*Middleware, error)
NewMiddleware creates a new CorazaMiddleware instance with the given options.
func (*Middleware) ServeHTTP ¶ added in v0.10.0
func (m *Middleware) ServeHTTP(ctx context.Context, c *app.RequestContext)
type Options ¶
type Options struct {
Directives string `mapstructure:"directives"`
RejectedHTTPContentType string `mapstructure:"rejected_http_content_type"`
RejectedHTTPResponseBody string `mapstructure:"rejected_http_response_body"`
IPAllowList []string `mapstructure:"ip_allow_list"`
RejectedHTTPStatusCode int `mapstructure:"rejected_http_status_code"`
}
Options defines the configuration for the Coraza WAF middleware.
Click to show internal directories.
Click to hide internal directories.