fix: remove enable_custom_domain_in_emails from managed tenant flags#1401
Open
ankita10119 wants to merge 2 commits into
Open
fix: remove enable_custom_domain_in_emails from managed tenant flags#1401ankita10119 wants to merge 2 commits into
ankita10119 wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1401 +/- ##
=======================================
Coverage 80.10% 80.10%
=======================================
Files 153 153
Lines 7099 7099
Branches 1566 1566
=======================================
Hits 5687 5687
Misses 760 760
Partials 652 652 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
harshithRai
reviewed
Jun 15, 2026
Comment on lines
234
to
238
| log.warn( | ||
| 'The "enable_custom_domain_in_emails" tenant flag is deprecated. ' + | ||
| 'Use the "is_default" field on customDomains to configure the default domain instead. ' + | ||
| 'The flag will still be applied for now but will be removed in a future release.' | ||
| 'The "enable_custom_domain_in_emails" tenant flag is deprecated and has been removed from management. ' + | ||
| 'It will not be applied during import. ' + | ||
| 'Use the "is_default" field on customDomains to configure the default domain instead.' | ||
| ); |
Contributor
There was a problem hiding this comment.
Now that enable_custom_domain_in_emails is removed from allowedTenantFlags, removeUnallowedTenantFlags() will already emit a generic incompatible flag warning for it.
So in the same import run the user sees two contradictory warnings, one says the flag can likely be removed from their config, the other says it has already been removed from management.
For example, with flags: { enable_custom_domain_in_emails: true } in their config, they'd see:
WARN: The following tenant flag has not been updated because deemed incompatible with the target tenant: enable_custom_domain_in_emails. This flag can likely be removed from the tenant definition file...
WARN: The "enable_custom_domain_in_emails" tenant flag is deprecated and has been removed from management. It will not be applied during import. Use the "is_default" field on customDomains instead.
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
Removes
enable_custom_domain_in_emailsfrom the managed tenant flags allowlist (allowedTenantFlags) to prevent import failures in environments without a ready custom domain.Problem: The flag was included in
allowedTenantFlags, causing it to be:exportoutput (tenant.yaml) even though it is deprecatedimport, resulting in a400 Bad Requesterror on tenants that do not have a custom domain withstatus: "ready"- aborting the entire tenantprocessChangesstage and leaving no tenant settings appliedChanges:
enable_custom_domain_in_emailsfromallowedTenantFlagsinsrc/tools/auth0/handlers/tenant.ts- the existingremoveUnallowedTenantFlags()function now strips it on both the export and import paths automaticallycustomDomains[].is_defaultMigration: Users should remove
enable_custom_domain_in_emailsfrom their tenant configuration files and use theis_defaultfield oncustomDomainsinstead:📚 References
🔬 Testing
Unit tests: Updated test in
test/tools/auth0/handlers/tenant.tests.tsverifies:Manual export test: Running node lib/index.js export against a tenant with
enable_custom_domain_in_emails: trueconfirms:Not tested end-to-end for import (requires a tenant without a custom domain): the import path is covered by the unit test and by code analysis -
removeUnallowedTenantFlags()strips the flag before the API call in processChanges().📝 Checklist