Skip to content

Commit f798967

Browse files
authored
Add Support Patch method for Network ACL update flow (#1265)
1 parent 567b218 commit f798967

9 files changed

Lines changed: 604 additions & 683 deletions

File tree

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,7 @@ vendor
3939
out/
4040

4141
# Terraform export command artifacts
42-
*.tf
42+
*.tf
43+
44+
# Copilot instructions
45+
.github/copilot-instructions.md

docs/auth0_network-acl_create.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ auth0 network-acl create [flags]
4141
--ja4-fingerprints strings Comma-separated list of JA4 fingerprints to match (Eg. t13d1516h2_8daaf6152771)
4242
--json Output in json format.
4343
--json-compact Output in compact json format.
44-
-p, --priority int Priority of the network ACL (required, 1-10)
44+
-p, --priority int Priority of the network ACL (required)
4545
--redirect-uri string URI to redirect to when action is redirect
4646
--rule string Network ACL rule configuration in JSON format (required for non-interactive mode)
4747
--scope string Scope of the rule (management, authentication, tenant)

docs/auth0_network-acl_update.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ has_toc: false
77

88
Update a network ACL.
99
To update interactively, use "auth0 network-acl update" with no arguments.
10-
To update non-interactively, supply the required parameters (description, active, priority, and rule) through flags.
11-
When updating the rule, provide a complete JSON object with action, scope, and match/not_match properties.
10+
To update non-interactively, supply the description, active, priority, and rule through flags.
11+
1212

1313
## Usage
1414
```
@@ -21,6 +21,8 @@ auth0 network-acl update [flags]
2121
auth0 network-acl update <id>
2222
auth0 network-acl update <id> --priority 5
2323
auth0 network-acl update <id> --active true
24+
auth0 network-acl update <id> --description "Updated description"
25+
auth0 network-acl update <id> --rule '{"action":{"block":true},"scope":"tenant","match":{"ipv4_cidrs":["192.168.1.0/24"]}}'
2426
auth0 network-acl update <id> --description "Complex Rule updated" --priority 1 --active true --rule '{"action":{"block":true},"scope":"tenant","match":{"ipv4_cidrs":["192.168.1.0/24"],"geo_country_codes":["US"]}}'
2527
```
2628

@@ -38,7 +40,7 @@ auth0 network-acl update [flags]
3840
--ja3-fingerprints strings Comma-separated list of JA3 fingerprints to match (Eg. deadbeef,cafebabe)
3941
--ja4-fingerprints strings Comma-separated list of JA4 fingerprints to match (Eg. t13d1516h2_8daaf6152771)
4042
--json Output in JSON format
41-
-p, --priority int Priority of the network ACL (1-10) (default 1)
43+
-p, --priority int Priority of the network ACL (default 1)
4244
--redirect-uri string URI to redirect to when action is redirect
4345
--rule string Network ACL rule configuration in JSON format
4446
--scope string Scope of the rule (management, authentication, tenant)

internal/auth0/mock/network_acl_mock.go

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/auth0/network_acl.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ type NetworkACLAPI interface {
1818
// Update an existing Network ACL.
1919
Update(ctx context.Context, id string, n *management.NetworkACL, opts ...management.RequestOption) error
2020

21+
// Patch an existing Network ACL.
22+
Patch(ctx context.Context, id string, n *management.NetworkACL, opts ...management.RequestOption) error
23+
2124
// Delete a Network ACL.
2225
Delete(ctx context.Context, id string, opts ...management.RequestOption) error
2326

0 commit comments

Comments
 (0)