fix: preserve idpinitiated.enabled:false on SAML connection export instead of emitting undefined_clientId - #1465
Open
harshithRai wants to merge 2 commits into
Open
fix: preserve idpinitiated.enabled:false on SAML connection export instead of emitting undefined_clientId#1465harshithRai wants to merge 2 commits into
harshithRai wants to merge 2 commits into
Conversation
…stead of emitting undefined_clientId
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1465 +/- ##
==========================================
+ Coverage 80.49% 80.51% +0.02%
==========================================
Files 163 163
Lines 7741 7745 +4
Branches 1719 1721 +2
==========================================
+ Hits 6231 6236 +5
+ Misses 810 808 -2
- Partials 700 701 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
harshithRai
marked this pull request as ready for review
August 20, 2026 05:28
ankita10119
previously approved these changes
Aug 20, 2026
ankita10119
left a comment
Contributor
There was a problem hiding this comment.
Can you add a parallel test case in test/context/directory/connections.test.js for a disabled idpinitiated block to match the YAML coverage?
ankita10119
approved these changes
Aug 20, 2026
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
Fixes a serialization bug where exporting a SAML (samlp) connection with IDP-initiated login disabled produced a malformed
idpinitiatedblock. Previously the exporter unconditionally injected aclient_id, and when none existed the helper substituted the literal stringundefined_clientId. On import this present block was treated as enabled, silently flipping IDP-initiated login ON in the target tenant.getFormattedOptionsinsrc/utils.ts(export path, ID to name) now only addsclient_idwhen one is actually present; otherwise theidpinitiatedblock passes through untouched, preservingenabled: false.getFormattedOptionsinsrc/tools/auth0/handlers/connections.ts(diff/import path, name to ID) receives the same guard so both directions stay symmetric. A third resolver insrc/tools/calculateDryRunChanges.tswas reviewed and is already guarded by?.client_id, so it needs no change.Note on scope: the guard omits
client_idwhenever it is falsy (enabled: false, empty string, null, or absent), not only the disabled case. This is the intended, more-correct behavior, but the output change is slightly wider than "disabled connections" alone.Exported config shape change (both YAML and JSON/directory formats):
For a connection with IDP-initiated login disabled, the export now emits:
instead of the previous malformed output:
Connections that have IDP-initiated login enabled are unaffected and continue to export their resolved
client_id.🔬 Testing
enabled: falseround-trips without a bogusclient_id. This covers both the YAML and directory export paths, since both shareutils.getFormattedOptions.getFormattedOptions(the import/diff name-to-ID path) verifying noclient_idis re-injected when a disabled{ enabled: false }block is processed - directly pinning the reported "login flipped ON" symptom.Verified end-to-end against a real tenant:
idpinitiated.enabled: falsevia import.enabled: falseand a strayclient_id: undefined_clientId.enabled: falseonly, with noundefined_clientIdplaceholder, so the disabled state round-trips correctly.📝 Checklist