Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added new rule level settings ignore_cname_category_matches to… #2621

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changelog/2621.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
```release-note:enhancement
teams_rules: Added ZT rule settings `ignore_cname_category_matches`
````

```release-note:enhancement
teams_list: Added description to ZT list item
```
5 changes: 3 additions & 2 deletions teams_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ type TeamsList struct {

// TeamsListItem represents a single list item.
type TeamsListItem struct {
Value string `json:"value"`
CreatedAt *time.Time `json:"created_at,omitempty"`
Value string `json:"value"`
Description string `json:"description,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
}

// PatchTeamsList represents a patch request for appending/removing list items.
Expand Down
3 changes: 3 additions & 0 deletions teams_rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ type TeamsRuleSettings struct {
// Turns on ip category based filter on dns if the rule contains dns category checks
IPCategories bool `json:"ip_categories"`

// Turns on for explicitly ignoring cname domain category matches
IgnoreCNAMECategoryMatches *bool `json:"ignore_cname_category_matches"`

// Allow parent MSP accounts to enable bypass their children's rules. Do not set them for non MSP accounts.
AllowChildBypass *bool `json:"allow_child_bypass,omitempty"`

Expand Down
2 changes: 2 additions & 0 deletions teams_rules_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func TestTeamsRules(t *testing.T) {
"untrusted_cert": {
"action": "error"
},
"ignore_cname_category_matches": true,
"dns_resolvers": {
"ipv4": [
{"ip": "10.0.0.2", "port": 5053},
Expand Down Expand Up @@ -142,6 +143,7 @@ func TestTeamsRules(t *testing.T) {
UntrustedCertSettings: &UntrustedCertSettings{
Action: UntrustedCertError,
},
IgnoreCNAMECategoryMatches: BoolPtr(true),
DnsResolverSettings: &TeamsDnsResolverSettings{
V4Resolvers: []TeamsDnsResolverAddressV4{
{
Expand Down
Loading