mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2026-04-18 00:55:19 +08:00
实现WAF策略部分功能
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
package firewallconfigs
|
||||
|
||||
type HTTPFirewallOutboundConfig struct {
|
||||
IsOn bool `yaml:"isOn" json:"isOn"`
|
||||
GroupRefs []*HTTPFirewallRuleGroupRef `yaml:"groupRefs" json:"groupRefs"`
|
||||
Groups []*HTTPFirewallRuleGroup `yaml:"groups" json:"groups"`
|
||||
}
|
||||
|
||||
// 初始化
|
||||
func (this *HTTPFirewallOutboundConfig) Init() error {
|
||||
for _, group := range this.Groups {
|
||||
err := group.Init()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// 根据Code查找Group
|
||||
func (this *HTTPFirewallOutboundConfig) FindGroupWithCode(code string) *HTTPFirewallRuleGroup {
|
||||
for _, group := range this.Groups {
|
||||
if group.Code == code {
|
||||
return group
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user