Documentation
¶
Overview ¶
Package "block regex urls" is a Traefik plugin to block access to certain urls using a list of regex values and return a defined status code.
Index ¶
- func InitializePrivateIPBlocks() []*net.IPNet
- func IsIpInList(ip net.IP, list []*net.IPNet) bool
- func IsPrivateIP(ip net.IP, privateIPBlocks []*net.IPNet) bool
- func New(ctx context.Context, next http.Handler, config *Config, name string) (http.Handler, error)
- func ParseIP(address string) (net.IP, error)
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitializePrivateIPBlocks ¶
This method initializes a list of private IP addresses. It uses a predefined range of CIDR addresses. Returns a list of private IP blocks. https://stackoverflow.com/questions/41240761/check-if-ip-address-is-in-private-network-space
func IsIpInList ¶
Checks whether a string is in a list of strings. Returns true if this is the case, otherwise returns false.
func IsPrivateIP ¶
This method checks whether a provided IP is a private IP. If this is the case it returns true, otherwise false. https://stackoverflow.com/questions/41240761/check-if-ip-address-is-in-private-network-space
Types ¶
type Config ¶
type Config struct {
AllowLocalRequests bool `yaml:"allowLocalRequests"`
Regex []string `yaml:"regex,omitempty"`
SilentStartUp bool `yaml:"silentStartUp"`
StatusCode int `yaml:"statusCode"`
}
func CreateConfig ¶
func CreateConfig() *Config
CreateConfig creates the default plugin configuration.