Skip to content

Commit

Permalink
Merge pull request #1463 from rexscaria/rex/gateway-rules-notificatio…
Browse files Browse the repository at this point in the history
…n-settings-update

feat: added gateway rule notification settings
  • Loading branch information
jacobbednarz committed Dec 19, 2023
2 parents 88fe38f + 25fc8f3 commit 05bc5e6
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .changelog/1463.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
teams_rules: Added support for notification settings in a gateway rule
```
8 changes: 8 additions & 0 deletions teams_rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ type TeamsRuleSettings struct {

// Resolver policy settings.
DnsResolverSettings *TeamsDnsResolverSettings `json:"dns_resolvers,omitempty"`

NotificationSettings *TeamsNotificationSettings `json:"notification_settings"`
}

type TeamsGatewayUntrustedCertAction string
Expand All @@ -77,6 +79,12 @@ type UntrustedCertSettings struct {
Action TeamsGatewayUntrustedCertAction `json:"action"`
}

type TeamsNotificationSettings struct {
Enabled *bool `json:"enabled,omitempty"`
Message string `json:"msg"`
SupportURL string `json:"support_url"`
}

type AuditSSHRuleSettings struct {
CommandLogging bool `json:"command_logging"`
}
Expand Down
10 changes: 10 additions & 0 deletions teams_rules_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ func TestTeamsRules(t *testing.T) {
"ipv6": [
{"ip": "2460::1"}
]
},
"notification_settings": {
"enabled": true,
"msg": "message",
"support_url": "https://hello.com"
}
}
},
Expand Down Expand Up @@ -161,6 +166,11 @@ func TestTeamsRules(t *testing.T) {
},
},
},
NotificationSettings: &TeamsNotificationSettings{
Enabled: BoolPtr(true),
Message: "message",
SupportURL: "https://hello.com",
},
},
CreatedAt: &createdAt,
UpdatedAt: &updatedAt,
Expand Down

0 comments on commit 05bc5e6

Please sign in to comment.