underattack

package
v0.0.0-...-2091b86 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2025 License: AGPL-3.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Middleware

func Middleware(maxAge int) echo.MiddlewareFunc

Types

type Config

type Config struct {
	On          bool
	IPWhitelist string
	Rules       []*Rule // Rules[0][Path]
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig() *Config

func (*Config) FromStore

func (c *Config) FromStore(r echo.H) *Config

func (*Config) IsAllowed

func (c *Config) IsAllowed(ctx echo.Context) bool

func (*Config) Validate

func (c *Config) Validate(ctx echo.Context) error

type Rule

type Rule struct {
	Path        string
	UAWhitelist string
	Headers     map[string]string
	QueryString string // a=b&b=c
	// contains filtered or unexported fields
}

func (Rule) IsAllowed

func (r Rule) IsAllowed(ctx echo.Context) bool

IsAllowed 没有任何白名单规则时直接放行; 全部白名单规则匹配时直接放行

func (Rule) Validate

func (r Rule) Validate(ctx echo.Context) error

Jump to

Keyboard shortcuts

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