Skip to content

Commit

Permalink
feat: added gateway rule notification settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Rex Scaria committed Dec 19, 2023
1 parent 8df5e95 commit 1d686d0
Show file tree
Hide file tree
Showing 3 changed files with 22 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
11 changes: 11 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 @@ -109,6 +114,7 @@ func TestTeamsRules(t *testing.T) {
createdAt, _ := time.Parse(time.RFC3339, "2014-01-01T05:20:00.12345Z")
updatedAt, _ := time.Parse(time.RFC3339, "2014-01-01T05:20:00.12345Z")

True := true
want := []TeamsRule{{
ID: "7559a944-3dd7-41bf-b183-360a814a8c36",
Name: "rule1",
Expand Down Expand Up @@ -161,6 +167,11 @@ func TestTeamsRules(t *testing.T) {
},
},
},
NotificationSettings: &TeamsNotificationSettings{
Enabled: &True,
Message: "message",
SupportURL: "https://hello.com",
},
},
CreatedAt: &createdAt,
UpdatedAt: &updatedAt,
Expand Down

0 comments on commit 1d686d0

Please sign in to comment.