feat: support list of MAC addresses for Firewall Zone Policy (#56)

This commit is contained in:
Mateusz Filipowicz
2025-03-20 19:54:13 +01:00
committed by GitHub
parent 1def1e4ec4
commit 12bf4bae30
2 changed files with 2 additions and 0 deletions

View File

@@ -44,6 +44,7 @@
"client_macs": ["^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})$"],
"ip_group_id": "",
"ips": ["^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$|^$"],
"macs": ["^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})$"],
"mac": "^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})$",
"match_mac": "true|false",
"match_opposite_ports": "true|false",

View File

@@ -132,6 +132,7 @@ type FirewallZonePolicySource struct {
IPGroupID string `json:"ip_group_id,omitempty"`
IPs []string `json:"ips,omitempty" validate:"omitempty,ipv4"` // ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$|^$
MAC string `json:"mac,omitempty" validate:"omitempty,mac"` // ^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})$
MACs []string `json:"macs,omitempty" validate:"omitempty,mac"` // ^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})$
MatchMAC bool `json:"match_mac"`
MatchOppositeIPs bool `json:"match_opposite_ips"`
MatchOppositeNetworks bool `json:"match_opposite_networks"`