fix: resolve 400 error when switching between flexible and legacy password policy on database connections#1361
Draft
ankita10119 wants to merge 1 commit intomasterfrom
Draft
fix: resolve 400 error when switching between flexible and legacy password policy on database connections#1361ankita10119 wants to merge 1 commit intomasterfrom
ankita10119 wants to merge 1 commit intomasterfrom
Conversation
…sword policy on database connections
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1361 +/- ##
==========================================
- Coverage 80.10% 80.03% -0.07%
==========================================
Files 152 152
Lines 6212 6222 +10
Branches 1290 1293 +3
==========================================
+ Hits 4976 4980 +4
- Misses 702 707 +5
- Partials 534 535 +1 ☔ 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
When switching a database connection's password policy between flexible (
password_options) and legacy (passwordPolicy,password_complexity_options,password_history,password_no_personal_info,password_dictionary), the deploy would fail with a 400 error from the Management API.The databases handler fetches the existing connection state before updating and shallow-merges it with the desired payload. This caused both policy groups to appear in the PATCH body simultaneously, which Auth0 rejects. The fix strips the conflicting group from the existing connection state before the merge, following the same pattern already used for the attributes vs
requires_username/validationconflict in the same method.Both transitions are fixed:
password_optionswhen connection haspasswordPolicysetpasswordPolicywhen connection haspassword_optionsset📚 References
N/A
🔬 Testing
📝 Checklist