Skip to content
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Log

## [Unreleased]

**Added**
- feat: add `Auth0Managed` curated blocklist support to `NetworkACLRuleMatch`

## [v1.45.0](https://github.com/auth0/go-auth0/tree/v1.45.0) (2026-07-16)
[Full Changelog](https://github.com/auth0/go-auth0/compare/v1.44.0...v1.45.0)

Expand Down
8 changes: 8 additions & 0 deletions management/management.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions management/management.gen_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions management/network_acl.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ type NetworkACLRuleMatch struct {
AnonymousProxy *bool `json:"anonymous_proxy,omitempty"`
// ASNs
Asns []int `json:"asns,omitempty"`
// Auth0 Managed curated blocklist categories
Auth0Managed *[]string `json:"auth0_managed,omitempty"`
// Geo Country Codes
GeoCountryCodes *[]string `json:"geo_country_codes,omitempty"`
// Geo Subdivision Codes
Expand Down
31 changes: 31 additions & 0 deletions management/network_acl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,37 @@ func TestNetworkACLManager_Create(t *testing.T) {
assert.Equal(t, expectedNetworkACL, actualNetworkACL)
}

func TestNetworkACLManager_CreateWithAuth0Managed(t *testing.T) {
configureHTTPTestRecordings(t)

expectedNetworkACL := &NetworkACL{
Description: auth0.String("some-description"),
Active: auth0.Bool(true),
Priority: auth0.Int(1),
Rule: &NetworkACLRule{
Action: &NetworkACLRuleAction{
Block: auth0.Bool(true),
},
Match: &NetworkACLRuleMatch{
Auth0Managed: &[]string{"auth0.icloud_relay_proxy"},
},
Scope: auth0.String("authentication"),
},
}

err := api.NetworkACL.Create(context.Background(), expectedNetworkACL)
assert.NoError(t, err)
assert.NotEmpty(t, expectedNetworkACL.GetID())
t.Cleanup(func() {
cleanupNetworkACL(t, expectedNetworkACL.GetID())
})

actualNetworkACL, err := api.NetworkACL.Read(context.Background(), expectedNetworkACL.GetID())
assert.NoError(t, err)
assert.Equal(t, expectedNetworkACL, actualNetworkACL)
assert.Equal(t, []string{"auth0.icloud_relay_proxy"}, actualNetworkACL.Rule.Match.GetAuth0Managed())
}

func TestNetworkACLManager_List(t *testing.T) {
configureHTTPTestRecordings(t)
expectedNetworkACL := givenANetworkACL(t)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
---
version: 2
interactions:
- id: 0
request:
proto: HTTP/1.1
proto_major: 1
proto_minor: 1
content_length: 172
transfer_encoding: []
trailer: {}
host: go-auth0-dev.eu.auth0.com
remote_addr: ""
request_uri: ""
body: |
{"description":"some-description","active":true,"priority":1,"rule":{"action":{"block":true},"match":{"auth0_managed":["auth0.icloud_relay_proxy"]},"scope":"authentication"}}
form: {}
headers:
Content-Type:
- application/json
User-Agent:
- Go-Auth0/1.16.0
url: https://go-auth0-dev.eu.auth0.com/api/v2/network-acls
method: POST
response:
proto: HTTP/2.0
proto_major: 2
proto_minor: 0
transfer_encoding: []
trailer: {}
content_length: 295
uncompressed: false
body: '{"id":"d489d9e8-6a3f-427c-89cf-59218e290745","description":"some-description","active":true,"priority":1,"rule":{"match":{"auth0_managed":["auth0.icloud_relay_proxy"]},"scope":"authentication","action":{"block":true}},"created_at":"2025-02-13T05:57:33.156Z","updated_at":"2025-02-13T05:57:33.156Z"}'
headers:
Content-Type:
- application/json; charset=utf-8
status: 201 Created
code: 201
duration: 840.036834ms
- id: 1
request:
proto: HTTP/1.1
proto_major: 1
proto_minor: 1
content_length: 0
transfer_encoding: []
trailer: {}
host: go-auth0-dev.eu.auth0.com
remote_addr: ""
request_uri: ""
body: ""
form: {}
headers:
Content-Type:
- application/json
User-Agent:
- Go-Auth0/1.16.0
url: https://go-auth0-dev.eu.auth0.com/api/v2/network-acls/d489d9e8-6a3f-427c-89cf-59218e290745
method: GET
response:
proto: HTTP/2.0
proto_major: 2
proto_minor: 0
transfer_encoding: []
trailer: {}
content_length: -1
uncompressed: true
body: '{"id":"d489d9e8-6a3f-427c-89cf-59218e290745","tenant_id":"go-auth0-dev.eu.auth0.com","description":"some-description","active":true,"priority":1,"rule":{"match":{"auth0_managed":["auth0.icloud_relay_proxy"]},"scope":"authentication","action":{"block":true}},"created_at":"2025-02-13T05:57:33.156Z","updated_at":"2025-02-13T05:57:33.156Z","deleted_at":null}'
headers:
Content-Type:
- application/json; charset=utf-8
status: 200 OK
code: 200
duration: 373.074792ms
- id: 2
request:
proto: HTTP/1.1
proto_major: 1
proto_minor: 1
content_length: 0
transfer_encoding: []
trailer: {}
host: go-auth0-dev.eu.auth0.com
remote_addr: ""
request_uri: ""
body: ""
form: {}
headers:
Content-Type:
- application/json
User-Agent:
- Go-Auth0/1.16.0
url: https://go-auth0-dev.eu.auth0.com/api/v2/network-acls/d489d9e8-6a3f-427c-89cf-59218e290745
method: DELETE
response:
proto: HTTP/2.0
proto_major: 2
proto_minor: 0
transfer_encoding: []
trailer: {}
content_length: 24
uncompressed: false
body: '{"code":204,"object":""}'
headers:
Content-Type:
- application/json; charset=utf-8
status: 200 OK
code: 200
duration: 377.957833ms
Loading