Skip to content

Conversation

@kushalshit27
Copy link
Contributor

🔧 Changes

Core fix: Remove deprecated enabled_clients property from API payloads

  • The Auth0 Management API deprecated enabled_clients on the connections create/update endpoints in favor of the dedicated PATCH /v2/connections/{id}/clients endpoint
  • Resolves ManagementApiError: Payload validation error: 'Additional properties not allowed: enabled_clients' that blocked import operations when connections include enabled clients
  • Compare incoming enabledClientIds with existing enabled clients to determine which clients should be enabled vs. disabled
  • Skip API calls entirely when enabled clients are unchanged (performance optimization)
  • Properly disable clients that are removed from the list by setting status: false in the update payload

📚 References

🔬 Testing

Unit test coverage:

  • Updated existing database and connection handler tests to assert enabled_clients is NOT present in API payloads for create and update operations
  • Added 6 new test cases for :
    • Skip update when enabled clients are unchanged (optimization verification)
    • Disable removed clients (verifies status: false for clients no longer in list)
    • Enable new clients and disable removed clients in one operation (combined operations)
    • Handle existingConnections as null (fallback behavior)
    • Handle large combined enable and disable operations (verifies chunking for >50 clients)

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

- src/tools/auth0/handlers/databases.ts: remove enabled_clients from create and update payloads
- src/tools/auth0/handlers/scimHandler.ts: remove enabled_clients from bodyParams
- test/tools/auth0/handlers/connections.tests.js: verify enabled_clients is not in API payload
- test/tools/auth0/handlers/databases.tests.js: verify enabled_clients is not in API payload
- src/tools/auth0/handlers/connections.ts: add existingConnections parameter to updateConnectionEnabledClients for better client state management
- src/tools/auth0/handlers/connections.ts: implement logic to determine clients to enable/disable based on existing connections
- src/tools/auth0/handlers/connections.ts: update processConnectionEnabledClients to pass existingConnections
- src/tools/auth0/handlers/databases.ts: update DatabaseHandler to pass existing connections to processConnectionEnabledClients
- src/tools/auth0/handlers/connections.ts: allow existingConnections to be null
- src/tools/auth0/handlers/databases.ts: add existingConnections property to DatabaseHandler
- test/tools/auth0/handlers/connections.tests.js: enhance tests for updateConnectionEnabledClients with existingConnections
- test/tools/auth0/handlers/databases.tests.js: verify existingConnections and changes parameters in integration tests
@kushalshit27 kushalshit27 requested a review from a team as a code owner February 10, 2026 08:45
@kushalshit27 kushalshit27 marked this pull request as draft February 10, 2026 09:14
@kushalshit27 kushalshit27 changed the title Fix: strip deprecated enabled_clients from connection API payloads with connection enhance client management Fix: strip deprecated enabled_clientsfor connection with enhance client management Feb 10, 2026
@kushalshit27 kushalshit27 changed the title Fix: strip deprecated enabled_clientsfor connection with enhance client management fix: strip deprecated enabled_clientsfor connection with enhance client management Feb 10, 2026
@kushalshit27 kushalshit27 self-assigned this Feb 10, 2026
@kushalshit27 kushalshit27 marked this pull request as ready for review February 10, 2026 09:35
@kushalshit27 kushalshit27 removed their assignment Feb 10, 2026
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.46%. Comparing base (59fe692) to head (03e4ae3).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1294      +/-   ##
==========================================
+ Coverage   80.39%   80.46%   +0.07%     
==========================================
  Files         146      146              
  Lines        5825     5846      +21     
  Branches     1194     1202       +8     
==========================================
+ Hits         4683     4704      +21     
  Misses        650      650              
  Partials      492      492              

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

Import Error - "Additional properties not allowed: enabled_clients"

2 participants