Skip to content

Commit

Permalink
Merge branch 'eft' of github.com:untangle/golang-shared into eft-to-m…
Browse files Browse the repository at this point in the history
…aster-0328
  • Loading branch information
abriles1216 committed Mar 28, 2024
2 parents 316421a + f5140ee commit 00c9fcf
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
5 changes: 2 additions & 3 deletions services/settings/policy/object.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,13 @@ func (obj *Object) UnmarshalJSON(data []byte) error {
case IPObjectType:
defer setList[utilNet.IPSpecifierString](obj)()
case ApplicationGroupType, GeoIPObjectType, GeoIPObjectGroupType, IPAddressGroupType, ServiceEndpointGroupType,
HostType, HostGroupType, DomainType, DomainGroupType, VLANTagType, VLANTagGroupType:
HostType, HostGroupType, DomainType, DomainGroupType, VLANTagType, VLANTagGroupType, InterfaceObjectType,
InterfaceObjectGroupType:
defer setList[string](obj)()
case ServiceEndpointObjectType:
defer setList[ServiceEndpoint](obj)()
case ApplicationType:
defer setList[ApplicationObject](obj)()
case InterfaceObjectType:
defer setList[string](obj)()
case ConditionType:
defer setList[*PolicyCondition](obj)()
case ConditionGroupType:
Expand Down
30 changes: 30 additions & 0 deletions services/settings/policy/policy_settings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,36 @@ func TestGroupUnmarshalEdges(t *testing.T) {
Items: []string{"AristaCorp"},
},
},
{
name: "interfacezone group object",
json: `{
"description": "interface zone group",
"id": "f4629ffa-2a7d-464a-aa5e-ca1cc3303137",
"items": [
"05b7c6a1-87bd-408c-a93c-c57a37f0ed38",
"12d18c78-a58b-4d68-ab44-f8406b5cb878",
"e20332db-76be-4eec-81d0-68b7e3a6e322",
"fd6dff22-cf7e-4b2e-a048-ea13d08386bf",
"37527b0f-e70d-4f6a-8adf-ddc4d3aea250"
],
"name": "Ruby Solution Test - Local Zones",
"type": "mfw-object-interfacezone-group"
}`,
expectedErr: false,
expected: Object{
Name: "Ruby Solution Test - Local Zones",
Description: "interface zone group",
ID: "f4629ffa-2a7d-464a-aa5e-ca1cc3303137",
Type: InterfaceObjectGroupType,
Items: []string{
"05b7c6a1-87bd-408c-a93c-c57a37f0ed38",
"12d18c78-a58b-4d68-ab44-f8406b5cb878",
"e20332db-76be-4eec-81d0-68b7e3a6e322",
"fd6dff22-cf7e-4b2e-a048-ea13d08386bf",
"37527b0f-e70d-4f6a-8adf-ddc4d3aea250",
},
},
},
{
name: "condition various types",
json: `{
Expand Down

0 comments on commit 00c9fcf

Please sign in to comment.