Skip to content

Conversation

@tanya732
Copy link
Contributor

@tanya732 tanya732 commented Jun 11, 2025

Changes

Added tenant ACL GA support:

Path HTTP Method Method Name
/network-acls POST create
/network-acls/{id} PUT update
/network-acls/{id} DELETE delete
/network-acls GET getAll
/network-acls/{id} GET get
/network-acls/{id} PATCH patch

References

https://auth0.com/docs/api/management/v2/network-acls/get-network-acls
https://auth0.com/docs/api/management/v2/network-acls/post-network-acls
https://auth0.com/docs/api/management/v2/network-acls/get-network-acls-by-id
https://auth0.com/docs/api/management/v2/network-acls/delete-network-acls-by-id
https://auth0.com/docs/api/management/v2/network-acls/patch-network-acls-by-id
https://auth0.com/docs/api/management/v2/network-acls/put-network-acls-by-id

Manual Testing Changes

Get domain and apiToken from tenant

  1. ManagementAPI mgmt = ManagementAPI.newBuilder("{YOUR_DOMAIN}", "{YOUR_API_TOKEN}").build();
// Call the API to getAll the Network ACL
NetworkAclsPage networkAclsPage = api.networkAcls().list(new NetworkAclsFilter().withPage(0,2).withTotals(true)).execute().getBody();

// Call the API to get the Network ACL
NetworkAcls getNetworkAcls = api.networkAcls().get("<ID>").execute().getBody();

NetworkAcls networkAcls = new NetworkAcls();
networkAcls.setPriority(3);
networkAcls.setDescription("<DESC>");
networkAcls.setActive(true);

// Create the Rule object
Rule rule = new Rule();
Action action = new Action();
action.setLog(true); 
rule.setAction(action);

Match match = new Match();
List<String> countryCodes = new ArrayList<>();
countryCodes.add("<CODES>");
match.setGeoCountryCodes(countryCodes); // Set geo_country_codes
rule.setMatch(match);

rule.setScope("<SCOPE>"); // Set the scope
networkAcls.setRule(rule);

// Call the API to create the Network ACL
Request<NetworkAcls> request = api.networkAcls().create(networkAcls);
NetworkAcls createdNetworkAcl = request.execute().getBody();


NetworkAcls updateNetworkAcls = new NetworkAcls();
updateNetworkAcls.setPriority(3);
updateNetworkAcls.setDescription("<DESC>");
updateNetworkAcls.setActive(true);

// Create the Rule object
Rule updateRule = new Rule();
Action updateAction = new Action();
updateAction.setLog(true); // Set the log action
updateRule.setAction(updateAction);

Match updateMatch = new Match();
List<String> updateCountryCodes = new ArrayList<>();
updateCountryCodes.add("<CODE>");
updateCountryCodes.add("<CODE>");
updateMatch.setGeoCountryCodes(updateCountryCodes); // Set geo_country_codes
updateRule.setMatch(updateMatch);

updateRule.setScope("<SCOPE>"); // Set the scope
updateNetworkAcls.setRule(updateRule);

// Call the API to update the Network ACL
Request<NetworkAcls> updateRequest = api.networkAcls().update("<ID>", updateNetworkAcls);
NetworkAcls updatedNetworkAcl = updateRequest.execute().getBody();

NetworkAcls patchNetworkAcls = new NetworkAcls();
patchNetworkAcls.setPriority(5);

// Call the API to patch the Network ACL
Request<NetworkAcls> patchRequest = api.networkAcls().patch("<ID>", patchNetworkAcls);
NetworkAcls patchNetworkAcl = patchRequest.execute().getBody();

// Call the API to delete the Network ACL
api.networkAcls().delete("<ID>").execute();

Testing

Please describe how this can be tested by reviewers. Be specific about anything not tested and reasons why. If this library has unit and/or integration testing, tests should be added for new functionality and existing tests should complete without errors.

  • This change adds test coverage
  • This change has been tested on the latest version of the platform/language or why not

Checklist

@tanya732 tanya732 marked this pull request as ready for review June 24, 2025 07:32
@tanya732 tanya732 requested a review from a team as a code owner June 24, 2025 07:32
@tanya732 tanya732 merged commit c184149 into master Aug 5, 2025
6 checks passed
@tanya732 tanya732 deleted the sdk-6065-tenant-acl-autho-java-support-ga branch August 5, 2025 07:14
This was referenced Aug 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants