fix: use omitEmpty only on hotspot for SettingIps (#51)
This commit is contained in:
committed by
GitHub
parent
98885a12a3
commit
e41cfe08e2
@@ -487,7 +487,7 @@ customizations:
|
|||||||
customUnmarshalType: "emptyStringInt"
|
customUnmarshalType: "emptyStringInt"
|
||||||
SettingIps:
|
SettingIps:
|
||||||
fields:
|
fields:
|
||||||
_all:
|
Honeypot:
|
||||||
omitEmpty: false
|
omitEmpty: false
|
||||||
SettingMgmt:
|
SettingMgmt:
|
||||||
fields:
|
fields:
|
||||||
|
|||||||
60
unifi/setting_ips.generated.go
generated
60
unifi/setting_ips.generated.go
generated
@@ -29,19 +29,19 @@ type SettingIps struct {
|
|||||||
|
|
||||||
Key string `json:"key"`
|
Key string `json:"key"`
|
||||||
|
|
||||||
AdBlockingConfigurations []SettingIpsAdBlockingConfigurations `json:"ad_blocking_configurations"`
|
AdBlockingConfigurations []SettingIpsAdBlockingConfigurations `json:"ad_blocking_configurations,omitempty"`
|
||||||
AdBlockingEnabled bool `json:"ad_blocking_enabled"`
|
AdBlockingEnabled bool `json:"ad_blocking_enabled"`
|
||||||
AdvancedFilteringPreference string `json:"advanced_filtering_preference" validate:"omitempty,oneof=manual disabled"` // |manual|disabled
|
AdvancedFilteringPreference string `json:"advanced_filtering_preference,omitempty" validate:"omitempty,oneof=manual disabled"` // |manual|disabled
|
||||||
DNSFiltering bool `json:"dns_filtering"`
|
DNSFiltering bool `json:"dns_filtering"`
|
||||||
DNSFilters []SettingIpsDNSFilters `json:"dns_filters"`
|
DNSFilters []SettingIpsDNSFilters `json:"dns_filters,omitempty"`
|
||||||
EnabledCategories []string `json:"enabled_categories" validate:"omitempty,oneof=emerging-activex emerging-attackresponse botcc emerging-chat ciarmy compromised emerging-dns emerging-dos dshield emerging-exploit emerging-ftp emerging-games emerging-icmp emerging-icmpinfo emerging-imap emerging-inappropriate emerging-info emerging-malware emerging-misc emerging-mobile emerging-netbios emerging-p2p emerging-policy emerging-pop3 emerging-rpc emerging-scada emerging-scan emerging-shellcode emerging-smtp emerging-snmp emerging-sql emerging-telnet emerging-tftp tor emerging-useragent emerging-voip emerging-webapps emerging-webclient emerging-webserver emerging-worm exploit-kit adware-pup botcc-portgrouped phishing threatview-cs-c2 3coresec chat coinminer current-events drop hunting icmp-info inappropriate info ja3 policy scada dark-web-blocker-list malicious-hosts"` // emerging-activex|emerging-attackresponse|botcc|emerging-chat|ciarmy|compromised|emerging-dns|emerging-dos|dshield|emerging-exploit|emerging-ftp|emerging-games|emerging-icmp|emerging-icmpinfo|emerging-imap|emerging-inappropriate|emerging-info|emerging-malware|emerging-misc|emerging-mobile|emerging-netbios|emerging-p2p|emerging-policy|emerging-pop3|emerging-rpc|emerging-scada|emerging-scan|emerging-shellcode|emerging-smtp|emerging-snmp|emerging-sql|emerging-telnet|emerging-tftp|tor|emerging-useragent|emerging-voip|emerging-webapps|emerging-webclient|emerging-webserver|emerging-worm|exploit-kit|adware-pup|botcc-portgrouped|phishing|threatview-cs-c2|3coresec|chat|coinminer|current-events|drop|hunting|icmp-info|inappropriate|info|ja3|policy|scada|dark-web-blocker-list|malicious-hosts
|
EnabledCategories []string `json:"enabled_categories,omitempty" validate:"omitempty,oneof=emerging-activex emerging-attackresponse botcc emerging-chat ciarmy compromised emerging-dns emerging-dos dshield emerging-exploit emerging-ftp emerging-games emerging-icmp emerging-icmpinfo emerging-imap emerging-inappropriate emerging-info emerging-malware emerging-misc emerging-mobile emerging-netbios emerging-p2p emerging-policy emerging-pop3 emerging-rpc emerging-scada emerging-scan emerging-shellcode emerging-smtp emerging-snmp emerging-sql emerging-telnet emerging-tftp tor emerging-useragent emerging-voip emerging-webapps emerging-webclient emerging-webserver emerging-worm exploit-kit adware-pup botcc-portgrouped phishing threatview-cs-c2 3coresec chat coinminer current-events drop hunting icmp-info inappropriate info ja3 policy scada dark-web-blocker-list malicious-hosts"` // emerging-activex|emerging-attackresponse|botcc|emerging-chat|ciarmy|compromised|emerging-dns|emerging-dos|dshield|emerging-exploit|emerging-ftp|emerging-games|emerging-icmp|emerging-icmpinfo|emerging-imap|emerging-inappropriate|emerging-info|emerging-malware|emerging-misc|emerging-mobile|emerging-netbios|emerging-p2p|emerging-policy|emerging-pop3|emerging-rpc|emerging-scada|emerging-scan|emerging-shellcode|emerging-smtp|emerging-snmp|emerging-sql|emerging-telnet|emerging-tftp|tor|emerging-useragent|emerging-voip|emerging-webapps|emerging-webclient|emerging-webserver|emerging-worm|exploit-kit|adware-pup|botcc-portgrouped|phishing|threatview-cs-c2|3coresec|chat|coinminer|current-events|drop|hunting|icmp-info|inappropriate|info|ja3|policy|scada|dark-web-blocker-list|malicious-hosts
|
||||||
EnabledNetworks []string `json:"enabled_networks"`
|
EnabledNetworks []string `json:"enabled_networks,omitempty"`
|
||||||
Honeypot []SettingIpsHoneypot `json:"honeypot"`
|
Honeypot []SettingIpsHoneypot `json:"honeypot"`
|
||||||
HoneypotEnabled bool `json:"honeypot_enabled"`
|
HoneypotEnabled bool `json:"honeypot_enabled"`
|
||||||
IPsMode string `json:"ips_mode" validate:"omitempty,oneof=ids ips ipsInline disabled"` // ids|ips|ipsInline|disabled
|
IPsMode string `json:"ips_mode,omitempty" validate:"omitempty,oneof=ids ips ipsInline disabled"` // ids|ips|ipsInline|disabled
|
||||||
MemoryOptimized bool `json:"memory_optimized"`
|
MemoryOptimized bool `json:"memory_optimized"`
|
||||||
RestrictTorrents bool `json:"restrict_torrents"`
|
RestrictTorrents bool `json:"restrict_torrents"`
|
||||||
Suppression SettingIpsSuppression `json:"suppression"`
|
Suppression SettingIpsSuppression `json:"suppression,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (dst *SettingIps) UnmarshalJSON(b []byte) error {
|
func (dst *SettingIps) UnmarshalJSON(b []byte) error {
|
||||||
@@ -81,12 +81,12 @@ func (dst *SettingIpsAdBlockingConfigurations) UnmarshalJSON(b []byte) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type SettingIpsAlerts struct {
|
type SettingIpsAlerts struct {
|
||||||
Category string `json:"category"`
|
Category string `json:"category,omitempty"`
|
||||||
Gid int `json:"gid"`
|
Gid int `json:"gid,omitempty"`
|
||||||
ID int `json:"id"`
|
ID int `json:"id,omitempty"`
|
||||||
Signature string `json:"signature"`
|
Signature string `json:"signature,omitempty"`
|
||||||
Tracking []SettingIpsTracking `json:"tracking"`
|
Tracking []SettingIpsTracking `json:"tracking,omitempty"`
|
||||||
Type string `json:"type" validate:"omitempty,oneof=all track"` // all|track
|
Type string `json:"type,omitempty" validate:"omitempty,oneof=all track"` // all|track
|
||||||
}
|
}
|
||||||
|
|
||||||
func (dst *SettingIpsAlerts) UnmarshalJSON(b []byte) error {
|
func (dst *SettingIpsAlerts) UnmarshalJSON(b []byte) error {
|
||||||
@@ -111,14 +111,14 @@ func (dst *SettingIpsAlerts) UnmarshalJSON(b []byte) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type SettingIpsDNSFilters struct {
|
type SettingIpsDNSFilters struct {
|
||||||
AllowedSites []string `json:"allowed_sites"` // ^[a-zA-Z0-9.-]+$|^$
|
AllowedSites []string `json:"allowed_sites,omitempty"` // ^[a-zA-Z0-9.-]+$|^$
|
||||||
BlockedSites []string `json:"blocked_sites"` // ^[a-zA-Z0-9.-]+$|^$
|
BlockedSites []string `json:"blocked_sites,omitempty"` // ^[a-zA-Z0-9.-]+$|^$
|
||||||
BlockedTld []string `json:"blocked_tld"` // ^[a-zA-Z0-9.-]+$|^$
|
BlockedTld []string `json:"blocked_tld,omitempty"` // ^[a-zA-Z0-9.-]+$|^$
|
||||||
Description string `json:"description"`
|
Description string `json:"description,omitempty"`
|
||||||
Filter string `json:"filter" validate:"omitempty,oneof=none work family"` // none|work|family
|
Filter string `json:"filter,omitempty" validate:"omitempty,oneof=none work family"` // none|work|family
|
||||||
Name string `json:"name"`
|
Name string `json:"name,omitempty"`
|
||||||
NetworkID string `json:"network_id"`
|
NetworkID string `json:"network_id"`
|
||||||
Version string `json:"version" validate:"omitempty,oneof=v4 v6"` // v4|v6
|
Version string `json:"version,omitempty" validate:"omitempty,oneof=v4 v6"` // v4|v6
|
||||||
}
|
}
|
||||||
|
|
||||||
func (dst *SettingIpsDNSFilters) UnmarshalJSON(b []byte) error {
|
func (dst *SettingIpsDNSFilters) UnmarshalJSON(b []byte) error {
|
||||||
@@ -138,9 +138,9 @@ func (dst *SettingIpsDNSFilters) UnmarshalJSON(b []byte) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type SettingIpsHoneypot struct {
|
type SettingIpsHoneypot struct {
|
||||||
IPAddress string `json:"ip_address"`
|
IPAddress string `json:"ip_address,omitempty"`
|
||||||
NetworkID string `json:"network_id"`
|
NetworkID string `json:"network_id"`
|
||||||
Version string `json:"version" validate:"omitempty,oneof=v4 v6"` // v4|v6
|
Version string `json:"version,omitempty" validate:"omitempty,oneof=v4 v6"` // v4|v6
|
||||||
}
|
}
|
||||||
|
|
||||||
func (dst *SettingIpsHoneypot) UnmarshalJSON(b []byte) error {
|
func (dst *SettingIpsHoneypot) UnmarshalJSON(b []byte) error {
|
||||||
@@ -160,8 +160,8 @@ func (dst *SettingIpsHoneypot) UnmarshalJSON(b []byte) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type SettingIpsSuppression struct {
|
type SettingIpsSuppression struct {
|
||||||
Alerts []SettingIpsAlerts `json:"alerts"`
|
Alerts []SettingIpsAlerts `json:"alerts,omitempty"`
|
||||||
Whitelist []SettingIpsWhitelist `json:"whitelist"`
|
Whitelist []SettingIpsWhitelist `json:"whitelist,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (dst *SettingIpsSuppression) UnmarshalJSON(b []byte) error {
|
func (dst *SettingIpsSuppression) UnmarshalJSON(b []byte) error {
|
||||||
@@ -181,9 +181,9 @@ func (dst *SettingIpsSuppression) UnmarshalJSON(b []byte) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type SettingIpsTracking struct {
|
type SettingIpsTracking struct {
|
||||||
Direction string `json:"direction" validate:"omitempty,oneof=both src dest"` // both|src|dest
|
Direction string `json:"direction,omitempty" validate:"omitempty,oneof=both src dest"` // both|src|dest
|
||||||
Mode string `json:"mode" validate:"omitempty,oneof=ip subnet network"` // ip|subnet|network
|
Mode string `json:"mode,omitempty" validate:"omitempty,oneof=ip subnet network"` // ip|subnet|network
|
||||||
Value string `json:"value"`
|
Value string `json:"value,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (dst *SettingIpsTracking) UnmarshalJSON(b []byte) error {
|
func (dst *SettingIpsTracking) UnmarshalJSON(b []byte) error {
|
||||||
@@ -203,9 +203,9 @@ func (dst *SettingIpsTracking) UnmarshalJSON(b []byte) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type SettingIpsWhitelist struct {
|
type SettingIpsWhitelist struct {
|
||||||
Direction string `json:"direction" validate:"omitempty,oneof=both src dest"` // both|src|dest
|
Direction string `json:"direction,omitempty" validate:"omitempty,oneof=both src dest"` // both|src|dest
|
||||||
Mode string `json:"mode" validate:"omitempty,oneof=ip subnet network"` // ip|subnet|network
|
Mode string `json:"mode,omitempty" validate:"omitempty,oneof=ip subnet network"` // ip|subnet|network
|
||||||
Value string `json:"value"`
|
Value string `json:"value,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (dst *SettingIpsWhitelist) UnmarshalJSON(b []byte) error {
|
func (dst *SettingIpsWhitelist) UnmarshalJSON(b []byte) error {
|
||||||
|
|||||||
Reference in New Issue
Block a user