fix: suppress false-positive deprecation warning for cross_origin_auth when using cross_origin_authentication#1322
Open
ankita10119 wants to merge 2 commits intomasterfrom
Open
fix: suppress false-positive deprecation warning for cross_origin_auth when using cross_origin_authentication#1322ankita10119 wants to merge 2 commits intomasterfrom
ankita10119 wants to merge 2 commits intomasterfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1322 +/- ##
=======================================
Coverage 80.16% 80.16%
=======================================
Files 152 152
Lines 6089 6090 +1
Branches 1244 1244
=======================================
+ Hits 4881 4882 +1
Misses 693 693
Partials 515 515 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔧 Changes
Problem
Users running
auth0-deploy-cliv8.29.0 withcross_origin_authentication(the correct field) in theirtenant.yamlwere seeing a spurious deprecation warning on every deploy:warn: The 'cross_origin_auth' parameter is deprecated in clients and scheduled for removal in future releases.
Use 'cross_origin_authentication' going forward.
The warning implies the user needs to change something in their config, but their config is already correct.
Root Cause
sanitizeCrossOriginAuth()is called in two places:getType()- processes clients fetched from the Auth0 Management APIprocessChanges()- processes clients from the user'stenant.yamlThe Auth0 Management API still returns
cross_origin_auth(the old field name) in its responses. SincegetType()is called on every import/deploy operation (to compute the diff between current and desired state), the warning fired unconditionally - regardless of what the user had in their YAML.Fix
Added an optional warn parameter (default true) to
sanitizeCrossOriginAuth. The field conversion still happens in both code paths (required for correct diffing), butgetType()now passes warn = false so it converts silently.The warning continues to fire in
processChanges()when a user's own YAML contains the deprecatedcross_origin_authfield - which is the intended behaviour.🔬 Testing
All existing tests pass. The fix preserves the correct behaviour:
cross_origin_authappears in user's YAML📝 Checklist