Skip to content

feat: add deploy-cli support for Rate Limit Policies (EA)#1395

Open
ankita10119 wants to merge 3 commits into
masterfrom
DXCDT-1674
Open

feat: add deploy-cli support for Rate Limit Policies (EA)#1395
ankita10119 wants to merge 3 commits into
masterfrom
DXCDT-1674

Conversation

@ankita10119
Copy link
Copy Markdown
Contributor

🔧 Changes

Adds deploy-cli support for Rate Limit Policies (EA) - enabling config-as-code management of /api/v2/rate-limit-policies.

Rate limit policies allow tenants to control the number of Authentication API (/oauth/token) requests that client applications can make, with support for block, log, allow, and redirect actions.

New handler: src/tools/auth0/handlers/rateLimitPolicies.ts

  • Full CRUD: list (checkpoint pagination), create, update (PATCH sends configuration only), delete
  • Graceful 403/404/501 handling for tenants without the feature enabled
  • Identified by consumer_selector for config-as-code matching

Directory context: src/context/directory/handlers/rateLimitPolicies.ts

  • Reads/writes policies as individual JSON files under rate-limit-policies/
  • Filename derived from consumer_selector
  • Strips id, created_at, updated_at on export

YAML context: src/context/yaml/handlers/rateLimitPolicies.ts

  • Reads/writes policies inline in the YAML config
  • Strips id, created_at, updated_at on export

📚 References

🔬 Testing

Unit tests added for all three layers:

  • test/tools/auth0/handlers/rateLimitPolicies.test.ts - create, update, delete, 403 handling, skip-delete
  • test/context/directory/rateLimitPolicies.test.ts - parse, dump, empty dir, missing dir
  • test/context/yaml/rateLimitPolicies.test.ts - parse, dump

📝 Checklist

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

@ankita10119 ankita10119 requested a review from a team as a code owner May 29, 2026 07:14
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.40741% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.93%. Comparing base (14ac40b) to head (79e2a33).

Files with missing lines Patch % Lines
src/tools/auth0/handlers/rateLimitPolicies.ts 74.24% 7 Missing and 10 partials ⚠️
...rc/context/directory/handlers/rateLimitPolicies.ts 96.00% 0 Missing and 1 partial ⚠️
src/context/yaml/handlers/rateLimitPolicies.ts 92.85% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1395      +/-   ##
==========================================
+ Coverage   79.89%   79.93%   +0.03%     
==========================================
  Files         153      156       +3     
  Lines        7092     7200     +108     
  Branches     1561     1582      +21     
==========================================
+ Hits         5666     5755      +89     
- Misses        783      790       +7     
- Partials      643      655      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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