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

feature: Add BYOIPv6 block id to team locations #3738

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
3 changes: 3 additions & 0 deletions .changelog/3738.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
teams_location: add support for `dns_destination_ipv6_block_id` to the location payload
```
25 changes: 13 additions & 12 deletions teams_locations.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,19 @@ type TeamsLocationNetwork struct {
}

type TeamsLocation struct {
ID string `json:"id"`
Name string `json:"name"`
Networks []TeamsLocationNetwork `json:"networks"`
PolicyIDs []string `json:"policy_ids"`
Ip string `json:"ip,omitempty"`
Subdomain string `json:"doh_subdomain"`
AnonymizedLogsEnabled bool `json:"anonymized_logs_enabled"`
IPv4Destination string `json:"ipv4_destination"`
IPv4DestinationBackup string `json:"ipv4_destination_backup"`
DNSDestinationIPsID string `json:"dns_destination_ips_id"`
ClientDefault bool `json:"client_default"`
ECSSupport *bool `json:"ecs_support,omitempty"`
ID string `json:"id"`
Name string `json:"name"`
Networks []TeamsLocationNetwork `json:"networks"`
PolicyIDs []string `json:"policy_ids"`
Ip string `json:"ip,omitempty"`
Subdomain string `json:"doh_subdomain"`
AnonymizedLogsEnabled bool `json:"anonymized_logs_enabled"`
IPv4Destination string `json:"ipv4_destination"`
IPv4DestinationBackup string `json:"ipv4_destination_backup"`
DNSDestinationIPsID string `json:"dns_destination_ips_id"`
DNSDestinationIPv6BlockID string `json:"dns_destination_ipv6_block_id"`
ClientDefault bool `json:"client_default"`
ECSSupport *bool `json:"ecs_support,omitempty"`

CreatedAt *time.Time `json:"created_at,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
Expand Down
30 changes: 16 additions & 14 deletions teams_locations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ func TestTeamsLocations(t *testing.T) {
"ipv4_destination": "1.2.3.4",
"ipv4_destination_backup": "1.2.3.5",
"dns_destination_ips_id": "9da8e0c9-e9cc-4bbd-85c5-b351fc373354",
"dns_destination_ipv6_block_id": "8da8e0c9-e9cc-4bbd-85c5-b351fc373354",
"client_default": false,
"ecs_support": false,
"created_at": "2020-05-18T22:07:03Z",
Expand All @@ -54,20 +55,21 @@ func TestTeamsLocations(t *testing.T) {
updatedAt, _ := time.Parse(time.RFC3339, "2020-05-18T22:07:05Z")

want := []TeamsLocation{{
ID: "0f8185414dec4a5e9034f3d917c17890",
Name: "home",
Networks: []TeamsLocationNetwork{{ID: "8e4c7835436345f0ab395429b187a076", Network: "198.51.100.1/32"}},
PolicyIDs: []string{},
Ip: "2a06:98c1:54::2419",
Subdomain: "q15l7x2lbw",
AnonymizedLogsEnabled: false,
IPv4Destination: "1.2.3.4",
IPv4DestinationBackup: "1.2.3.5",
DNSDestinationIPsID: "9da8e0c9-e9cc-4bbd-85c5-b351fc373354",
ClientDefault: false,
ECSSupport: BoolPtr(false),
CreatedAt: &createdAt,
UpdatedAt: &updatedAt,
ID: "0f8185414dec4a5e9034f3d917c17890",
Name: "home",
Networks: []TeamsLocationNetwork{{ID: "8e4c7835436345f0ab395429b187a076", Network: "198.51.100.1/32"}},
PolicyIDs: []string{},
Ip: "2a06:98c1:54::2419",
Subdomain: "q15l7x2lbw",
AnonymizedLogsEnabled: false,
IPv4Destination: "1.2.3.4",
IPv4DestinationBackup: "1.2.3.5",
DNSDestinationIPsID: "9da8e0c9-e9cc-4bbd-85c5-b351fc373354",
DNSDestinationIPv6BlockID: "8da8e0c9-e9cc-4bbd-85c5-b351fc373354",
ClientDefault: false,
ECSSupport: BoolPtr(false),
CreatedAt: &createdAt,
UpdatedAt: &updatedAt,
}}

mux.HandleFunc(fmt.Sprintf("/accounts/%s/gateway/locations", testAccountID), handler)
Expand Down
Loading