Skip to content

Conversation

@kushalshit27
Copy link
Contributor

🔧 Changes

  • client grants handler: Added filtering logic to exclude client grants associated with third-party clients when AUTH0_EXCLUDE_THIRD_PARTY_CLIENTS is enabled. Previously, only clients were excluded, leaving orphaned client grants in the deployment.

  • utility function: Added shouldExcludeThirdPartyClients() to centralise the logic for determining whether third-party clients should be excluded based on configuration.

📚 References

🔬 Testing

  • Unit tests added for the client grants handler:
    • Verify that third-party client grants are excluded when AUTH0_EXCLUDE_THIRD_PARTY_CLIENTS is enabled
    • Verify that third-party client grants are not deleted when the flag is enabled

📝 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/clientGrants.ts: add logic to filter out third-party client grants when AUTH0_EXCLUDE_THIRD_PARTY_CLIENTS is enabled
- test/tools/auth0/handlers/clientGrants.tests.js: add tests for excluding third-party client grants in getType and ensure they are not deleted
- src/tools/utils.ts: add shouldExcludeThirdPartyClients utility function for config-based exclusion
- src/tools/auth0/handlers/clientGrants.ts: refactor to use shouldExcludeThirdPartyClients for filtering grants
- src/tools/auth0/handlers/clients.ts: refactor to use shouldExcludeThirdPartyClients for client filtering
- docs/excluding-from-management.md: update documentation to clarify client grants exclusion
@kushalshit27 kushalshit27 requested a review from a team as a code owner February 6, 2026 11:06
@kushalshit27 kushalshit27 changed the title fix: Exclude third-party client grants when AUTH0_EXCLUDE_THIRD_PARTY_CLIENTS is enabled fix: exclude third-party client grants when AUTH0_EXCLUDE_THIRD_PARTY_CLIENTS is enabled Feb 6, 2026
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.43%. Comparing base (59fe692) to head (359904f).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1289      +/-   ##
==========================================
+ Coverage   80.39%   80.43%   +0.04%     
==========================================
  Files         146      146              
  Lines        5825     5837      +12     
  Branches     1194     1195       +1     
==========================================
+ Hits         4683     4695      +12     
  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.

AUTH0_EXCLUDE_THIRD_PARTY_CLIENTS does not take into account Client Grants

2 participants