Skip to content

refactor: Improve efficiency and reliability of fetching enabled_clients for connections #1334

Merged
kushalshit27 merged 4 commits intomasterfrom
DXCDT-1471-rate-limit
Mar 24, 2026
Merged

refactor: Improve efficiency and reliability of fetching enabled_clients for connections #1334
kushalshit27 merged 4 commits intomasterfrom
DXCDT-1471-rate-limit

Conversation

@kushalshit27
Copy link
Copy Markdown
Contributor

🔧 Changes

Improves the efficiency and reliability of fetching enabled clients for Auth0 connections by switching from a parallel Promise.all approach to a controlled concurrency pool, and includes some minor code cleanups and test adjustments. The main benefit is improved resource usage and more predictable execution, especially when dealing with many connections.

📚 References

🔬 Testing

📝 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)

@kushalshit27 kushalshit27 changed the title refactor: Improves the efficiency and reliability of fetching enabled_clients for connections refactor: Improve efficiency and reliability of fetching enabled_clients for connections Mar 24, 2026
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 24, 2026

Codecov Report

❌ Patch coverage is 86.95652% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.18%. Comparing base (a9098d6) to head (3b73c5a).

Files with missing lines Patch % Lines
src/tools/auth0/handlers/connections.ts 86.95% 0 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1334      +/-   ##
==========================================
+ Coverage   80.16%   80.18%   +0.01%     
==========================================
  Files         152      152              
  Lines        6096     6101       +5     
  Branches     1247     1247              
==========================================
+ Hits         4887     4892       +5     
  Misses        693      693              
  Partials      516      516              

☔ 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.

@kushalshit27 kushalshit27 marked this pull request as ready for review March 24, 2026 06:59
@kushalshit27 kushalshit27 requested a review from a team as a code owner March 24, 2026 06:59
ankita10119
ankita10119 previously approved these changes Mar 24, 2026
Copy link
Copy Markdown
Contributor

@ankita10119 ankita10119 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approach looks good, worth adding a test to ensure pool based concurrency is used, so future refactors don't regress this behaviour undetected

…nnection order

- test/tools/auth0/handlers/connections.tests.js: implement test to validate pool usage for enabled clients
Copy link
Copy Markdown
Contributor

@ankita10119 ankita10119 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kushalshit27 kushalshit27 merged commit 2c69d7c into master Mar 24, 2026
8 checks passed
@kushalshit27 kushalshit27 deleted the DXCDT-1471-rate-limit branch March 24, 2026 10:47
@ankita10119 ankita10119 mentioned this pull request Mar 25, 2026
ankita10119 added a commit that referenced this pull request Apr 23, 2026
…gs (#1369)

* refactor: Improve efficiency and reliability of fetching  for  (#1334)

* refactor: Getting enabled clients for connection

* feat(test): add test for fetching enabled clients while preserving connection order
- test/tools/auth0/handlers/connections.tests.js: implement test to validate pool usage for enabled clients

* feat(clients.ts): add external client fields and registration logic
feat(clients.tests.js): implement tests for CIMD client creation and updates
- src/tools/auth0/handlers/clients.ts: added external_client_id, external_metadata_type, external_metadata_created_by, jwks_uri fields
- src/tools/auth0/handlers/clients.ts: implemented createClient and updateClient methods for CIMD clients
- test/tools/auth0/handlers/clients.tests.js: added tests for creating and updating CIMD clients
- test/tools/auth0/handlers/clients.tests.js: added validation test for external_metadata_type without external_client_id

* feat(clients.ts): update editable fields for CIMD clients
- src/tools/auth0/handlers/clients.ts: replace omit with pick to specify editable fields
- src/tools/auth0/handlers/clients.ts: add new editable fields for CIMD clients

* fix(package.json): update auth0 dependency version to ^5.7.0

* feat(src/tools/auth0/handlers/clients.ts): add calcChanges method for client change calculations
feat(src/tools/auth0/handlers/clients.ts): update identifiers for client handling

* fix(clients): remove unreachable guards in createClient and updateClient

* fix(clients): add non-null assertion for external_client_id after isCimdClient guard

* docs(examples): add CIMD client example to directory and yaml formats

---------

Co-authored-by: Ankita Tripathi <51994119+ankita10119@users.noreply.github.com>
Co-authored-by: ankitatripathi.mp@gmail.com <ankitatripathi.mp@gmail.com>
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