Documentation
¶
Overview ¶
Package bunnypop provides HTTP middleware for verifying incoming requests against validity criteria derived from BunnyCDN PoP source checks or required headers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BunnyPoP ¶
type Config ¶
type Config struct {
SilentStartup bool `yaml:"silentStartup"` // Suppresses startup logging noise
SilentUpdate bool `yaml:"silentUpdate"` // Suppresses background PoP list refresh logs
LogRejectedRequests bool `yaml:"logRejectedRequests"` // Log rejected requests
LogAllowedRequests bool `yaml:"logAllowedRequests"` // Log allowed requests
CheckHeaders bool `yaml:"checkHeaders"` // Validates the request headers
CheckAddr bool `yaml:"checkAddr"` // Validates the RemoteAddr against allowed values
OnlyIPV4 bool `yaml:"onlyIPV4"` // Allow only IPv4 requests
OnlyIPV6 bool `yaml:"onlyIPV6"` // Allow only IPv6 requests
OnlyLog bool `yaml:"onlyLog"` // Operates in a logging-only mode
HTTPStatusCodeDeniedRequest int `yaml:"httpStatusCodeDeniedRequest"` // Status code for rejected requests
AllowedCidr []string `yaml:"allowedCidr"` // List of explicit CIDR ranges allowed via IP check
AllowPrivateIPs bool `yaml:"allowPrivateIPs"` // Allows private/reserved IPs
UpdateInterval string `yaml:"updateInterval"` // Cache refresh interval for the PoP IP list
}
func CreateConfig ¶
func CreateConfig() *Config
type HTTPClientFetcher ¶ added in v0.0.2
type HTTPClientFetcher struct {
Client *http.Client
Config *Config
Logger *slog.Logger
Cache *Cache
}
func (*HTTPClientFetcher) GetPoPList ¶ added in v0.0.2
func (f *HTTPClientFetcher) GetPoPList(api string) ([]net.IP, error)
func (*HTTPClientFetcher) UpdatePoPList ¶ added in v1.2.2
func (f *HTTPClientFetcher) UpdatePoPList() ([]net.IP, error)
Click to show internal directories.
Click to hide internal directories.