mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2025-11-10 17:30:27 +08:00
5秒盾“加入IP白名单”默认为true
This commit is contained in:
@@ -9,10 +9,17 @@ type UAMConfig struct {
|
|||||||
IsPrior bool `yaml:"isPrior" json:"isPrior"`
|
IsPrior bool `yaml:"isPrior" json:"isPrior"`
|
||||||
IsOn bool `yaml:"isOn" json:"isOn"`
|
IsOn bool `yaml:"isOn" json:"isOn"`
|
||||||
|
|
||||||
|
AddToWhiteList bool `yaml:"addToWhiteList" json:"addToWhiteList"` // 是否将IP加入到白名单
|
||||||
OnlyURLPatterns []*shared.URLPattern `yaml:"onlyURLPatterns" json:"onlyURLPatterns"` // 仅限的URL
|
OnlyURLPatterns []*shared.URLPattern `yaml:"onlyURLPatterns" json:"onlyURLPatterns"` // 仅限的URL
|
||||||
ExceptURLPatterns []*shared.URLPattern `yaml:"exceptURLPatterns" json:"exceptURLPatterns"` // 排除的URL
|
ExceptURLPatterns []*shared.URLPattern `yaml:"exceptURLPatterns" json:"exceptURLPatterns"` // 排除的URL
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NewUAMConfig() *UAMConfig {
|
||||||
|
return &UAMConfig{
|
||||||
|
AddToWhiteList: true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (this *UAMConfig) Init() error {
|
func (this *UAMConfig) Init() error {
|
||||||
// only urls
|
// only urls
|
||||||
for _, pattern := range this.OnlyURLPatterns {
|
for _, pattern := range this.OnlyURLPatterns {
|
||||||
|
|||||||
Reference in New Issue
Block a user