Skip to content

feat: Support For Network ACL Endpoints #706

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

Merged
merged 2 commits into from
Jul 2, 2025
Merged

Conversation

kishore7snehil
Copy link
Contributor

@kishore7snehil kishore7snehil commented Jun 25, 2025

Changes

  • Added Support For Network Acls Endpoints
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

Testing

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

Manual Verification (Flask test server)

You can spin up a simple Flask app that exercises each of the new network_acls methods. :

from auth0.management import Auth0

domain = "<YOUR_DOMAIN>"
mgmt_api_token = "<YOUR_MGMT_API_TOKEN>"
auth0 = Auth0(domain, mgmt_api_token)

app = Flask(__name__)
app.secret_key = "super-secret-key"

@app.route("/network-acls", methods=["POST"])
def create_network_acl():
    try:
        result = auth0.network_acls.create(request.json)
        return jsonify(result), 201
    except Exception as e:
        return jsonify({"error": str(e)}), 500

@app.route("/network-acls", methods=["GET"])
def get_network_acls():
    try:
        result = auth0.network_acls.all(
            page=request.args.get("page", 0),
            per_page=request.args.get("per_page", 10),
            include_totals=request.args.get("include_totals", "false")
        )
        return jsonify(result), 200
    except Exception as e:
        return jsonify({"error": str(e)}), 500

@app.route("/network-acls/<acl_id>", methods=["PUT"])
def update_acl(acl_id):
    try:
        updated = auth0.network_acls.update(acl_id, body=request.json)
        return jsonify(updated), 200
    except Exception as e:
        return jsonify({"error": str(e)}), 500

@app.route("/network-acls/<acl_id>", methods=["PATCH"])
def partial_update_acl(acl_id):
    try:
        patched = auth0.network_acls.update_partial(acl_id, body=request.json)
        return jsonify(patched), 200
    except Exception as e:
        return jsonify({"error": str(e)}), 500

if __name__ == "__main__":
    app.run(debug=True, host="0.0.0.0", port=3000)

Checklist

@kishore7snehil kishore7snehil requested a review from a team as a code owner June 25, 2025 10:13
@kishore7snehil kishore7snehil merged commit 49da078 into master Jul 2, 2025
9 checks passed
@kishore7snehil kishore7snehil deleted the feat/tenant_acl branch July 2, 2025 16:13
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.

2 participants