fix: preserve keyword placeholder strings for all email provider credentials - #1470
Open
ankita10119 wants to merge 2 commits into
Open
fix: preserve keyword placeholder strings for all email provider credentials#1470ankita10119 wants to merge 2 commits into
ankita10119 wants to merge 2 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1470 +/- ##
==========================================
+ Coverage 80.51% 80.52% +0.01%
==========================================
Files 163 163
Lines 7745 7750 +5
Branches 1721 1726 +5
==========================================
+ Hits 6236 6241 +5
Misses 808 808
Partials 701 701 ☔ View full report in Codecov by Harness. 🚀 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
AUTH0_PRESERVE_KEYWORDSis enabled and a local config file uses a keyword placeholder string forcredentials(e.g. "@@SMTP_CREDENTIALS@@"),emailProviderDefaultsnow preserves it as-is instead of attempting to apply masking logic.Previously, for
smtp, theinoperator was used directly on the placeholder string, causing a hardTypeErrorcrash during export. For all other providers (ses,mailgun,mandrill,sendgrid,sparkpost,azure_cs,ms365), the string was silently spread into the credentials object as character-indexed keys (e.g.{"0": "@", "1": "@", ...}), which caused Auth0 API to reject the payload with a 400 on subsequent deploy.The fix adds a
typeof credentials !== 'string'guard to each provider block inemailProviderDefaults. This is purely additive — all existing behavior for object and undefined credentials is unchanged.📚 References
Fixes #1467
🔬 Testing
Unit tests added for all affected providers (
smtp,ses,mailgun,azure_cs,ms365) covering the keyword placeholder string case.Manual end-to-end testing performed:
TypeErrorcrash during export withAUTH0_PRESERVE_KEYWORDS=trueandcredentials: "@@SMTP_CREDENTIALS@@"in local config📝 Checklist