feat: add network_ids support to FirewallZonePolicyDestination

- Add NetworkIDs and MatchOppositeNetworks fields to destination struct
- Add NETWORK to MatchingTarget validation for destination
- Update codegen schema to include destination network targeting
- Add AggregateNumPorts to DevicePortOverrides (compatibility fix)

This enables firewall zone policies to target specific destination
networks, matching the existing source.network_ids functionality.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
shadyeip
2026-02-05 13:26:28 -05:00
parent 9883ad7f2c
commit 74c1746ff5
3 changed files with 20 additions and 15 deletions

View File

@@ -13,8 +13,10 @@
"ip_group_id": "", "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])$|^$"], "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])$|^$"],
"match_opposite_ips": "true|false", "match_opposite_ips": "true|false",
"match_opposite_networks": "true|false",
"match_opposite_ports": "true|false", "match_opposite_ports": "true|false",
"matching_target": "ANY|APP|APP_CATEGORY|IP|REGION|WEB", "matching_target": "ANY|APP|APP_CATEGORY|IP|NETWORK|REGION|WEB",
"network_ids": [""],
"matching_target_type": "ANY|OBJECT|SPECIFIC", "matching_target_type": "ANY|OBJECT|SPECIFIC",
"port": "^[0-9]+(?:-[0-9]+)?(?:,[0-9]+(?:-[0-9]+)?)*$", "port": "^[0-9]+(?:-[0-9]+)?(?:,[0-9]+(?:-[0-9]+)?)*$",
"port_group_id": "", "port_group_id": "",

View File

@@ -308,6 +308,7 @@ func (dst *DeviceOutletOverrides) UnmarshalJSON(b []byte) error {
type DevicePortOverrides struct { type DevicePortOverrides struct {
AggregateMembers []int `json:"aggregate_members,omitempty"` // [1-9]|[1-4][0-9]|5[0-6] AggregateMembers []int `json:"aggregate_members,omitempty"` // [1-9]|[1-4][0-9]|5[0-6]
AggregateNumPorts int `json:"aggregate_num_ports,omitempty"`
Autoneg bool `json:"autoneg,omitempty"` Autoneg bool `json:"autoneg,omitempty"`
Dot1XCtrl string `json:"dot1x_ctrl,omitempty" validate:"omitempty,oneof=auto force_authorized force_unauthorized mac_based multi_host"` // auto|force_authorized|force_unauthorized|mac_based|multi_host Dot1XCtrl string `json:"dot1x_ctrl,omitempty" validate:"omitempty,oneof=auto force_authorized force_unauthorized mac_based multi_host"` // auto|force_authorized|force_unauthorized|mac_based|multi_host
Dot1XIDleTimeout int `json:"dot1x_idle_timeout,omitempty"` // [0-9]|[1-9][0-9]{1,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5] Dot1XIDleTimeout int `json:"dot1x_idle_timeout,omitempty"` // [0-9]|[1-9][0-9]{1,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]

View File

@@ -65,20 +65,22 @@ func (dst *FirewallZonePolicy) UnmarshalJSON(b []byte) error {
} }
type FirewallZonePolicyDestination struct { type FirewallZonePolicyDestination struct {
AppCategoryIDs []string `json:"app_category_ids,omitempty"` AppCategoryIDs []string `json:"app_category_ids,omitempty"`
AppIDs []string `json:"app_ids,omitempty"` AppIDs []string `json:"app_ids,omitempty"`
IPGroupID string `json:"ip_group_id,omitempty"` 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])$|^$ 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])$|^$
MatchOppositeIPs bool `json:"match_opposite_ips"` MatchOppositeIPs bool `json:"match_opposite_ips"`
MatchOppositePorts bool `json:"match_opposite_ports"` MatchOppositeNetworks bool `json:"match_opposite_networks"`
MatchingTarget string `json:"matching_target,omitempty" validate:"omitempty,oneof=ANY APP APP_CATEGORY IP REGION WEB"` // ANY|APP|APP_CATEGORY|IP|REGION|WEB MatchOppositePorts bool `json:"match_opposite_ports"`
MatchingTargetType string `json:"matching_target_type,omitempty" validate:"omitempty,oneof=ANY OBJECT SPECIFIC"` // ANY|OBJECT|SPECIFIC MatchingTarget string `json:"matching_target,omitempty" validate:"omitempty,oneof=ANY APP APP_CATEGORY IP NETWORK REGION WEB"` // ANY|APP|APP_CATEGORY|IP|NETWORK|REGION|WEB
Port string `json:"port,omitempty"` // ^[0-9]+(?:-[0-9]+)?(?:,[0-9]+(?:-[0-9]+)?)*$ MatchingTargetType string `json:"matching_target_type,omitempty" validate:"omitempty,oneof=ANY OBJECT SPECIFIC"` // ANY|OBJECT|SPECIFIC
PortGroupID string `json:"port_group_id,omitempty"` NetworkIDs []string `json:"network_ids,omitempty"`
PortMatchingType string `json:"port_matching_type,omitempty" validate:"omitempty,oneof=ANY SPECIFIC OBJECT"` // ANY|SPECIFIC|OBJECT Port string `json:"port,omitempty"` // ^[0-9]+(?:-[0-9]+)?(?:,[0-9]+(?:-[0-9]+)?)*$
Regions []string `json:"regions,omitempty"` PortGroupID string `json:"port_group_id,omitempty"`
WebDomains []string `json:"web_domains,omitempty"` PortMatchingType string `json:"port_matching_type,omitempty" validate:"omitempty,oneof=ANY SPECIFIC OBJECT"` // ANY|SPECIFIC|OBJECT
ZoneID string `json:"zone_id"` Regions []string `json:"regions,omitempty"`
WebDomains []string `json:"web_domains,omitempty"`
ZoneID string `json:"zone_id"`
} }
func (dst *FirewallZonePolicyDestination) UnmarshalJSON(b []byte) error { func (dst *FirewallZonePolicyDestination) UnmarshalJSON(b []byte) error {