Skip to content

Commit

Permalink
Added new Group types for WF, TP (#180)
Browse files Browse the repository at this point in the history
* Adding webfilter and TP

---------

Co-authored-by: Christian Rasmussen <crasmussen@arista.com>
  • Loading branch information
rasmussen-untangle and Christian Rasmussen authored Jul 10, 2023
1 parent fd31f3a commit 0dea35f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions services/settings/policy/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ const (
// InterfaceType is a group type where all items are interface
// IDs (integers)
InterfaceType GroupType = "Interface"

// WebFilterCategoryType means that the Items of the Group are web filter categories.
WebFilterCategoryType GroupType = "WebFilterCategory"

// ThreatPreventionType means that the Items of the Group are threat prevention score.
ThreatPreventionType GroupType = "ThreatPrevention"
)

// Group is a way to generically re-use certain lists of attributes
Expand Down Expand Up @@ -93,6 +99,10 @@ func (g *Group) UnmarshalJSON(data []byte) error {
defer setList[ServiceEndpoint](g)()
case InterfaceType:
defer setList[uint](g)()
case ThreatPreventionType:
defer setList[uint](g)()
case WebFilterCategoryType:
defer setList[uint](g)()
default:
return fmt.Errorf("error unmarshalling policy group: invalid group type: %s", typeField.Type)
}
Expand Down

0 comments on commit 0dea35f

Please sign in to comment.