Skip to content

fix: suppress false-positive deprecation warning for cross_origin_auth when using cross_origin_authentication#1322

Open
ankita10119 wants to merge 2 commits intomasterfrom
DXCDT-1510
Open

fix: suppress false-positive deprecation warning for cross_origin_auth when using cross_origin_authentication#1322
ankita10119 wants to merge 2 commits intomasterfrom
DXCDT-1510

Conversation

@ankita10119
Copy link
Contributor

🔧 Changes

Problem

Users running auth0-deploy-cli v8.29.0 with cross_origin_authentication (the correct field) in their tenant.yaml were 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 API
  • processChanges() - processes clients from the user's tenant.yaml

The Auth0 Management API still returns cross_origin_auth (the old field name) in its responses. Since getType() 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), but getType() now passes warn = false so it converts silently.

The warning continues to fire in processChanges() when a user's own YAML contains the deprecated cross_origin_auth field - which is the intended behaviour.

🔬 Testing

All existing tests pass. The fix preserves the correct behaviour:

  • Warning fires when cross_origin_auth appears in user's YAML
  • Warning suppressed when triggered only by Auth0 API response

📝 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 March 12, 2026 05:41
@codecov-commenter
Copy link

codecov-commenter commented Mar 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.16%. Comparing base (7d6b211) to head (e6ab9ff).

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