Skip to content

feat: integrated identifiers in theme and country_codes in tenant#1638

Merged
KartikJha merged 5 commits into
mainfrom
DXCDT-1982/auth0-identifier-country-code
Jul 23, 2026
Merged

feat: integrated identifiers in theme and country_codes in tenant#1638
KartikJha merged 5 commits into
mainfrom
DXCDT-1982/auth0-identifier-country-code

Conversation

@KartikJha

@KartikJha KartikJha commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Add identifiers to auth0_branding_theme and country_codes to auth0_tenant

🔧 Changes

  • resource/auth0_branding_theme (and corresponding data source) – Added a new identifiers block for configuring identifier input display settings: login_display (unified/separate), otp_autocomplete (bool), and a nested phone_display block (formatting: international/regional, masking: mask_digits/hide_country_code/show_all). This requires the identifier input feature flag to be enabled on the tenant; when the flag is first enabled, existing themes will pick up the API's default values in state on the next refresh with no plan diff.
  • resource/auth0_tenant (and corresponding data source) – Added a new country_codes block for configuring phone identifier country code allow/deny filtering: list (a set of ISO 3166-1 alpha-2 codes, validated against ^[A-Z]{2}$) and mode (allow/deny). This requires the country codes feature flag to be enabled on the tenant. Removing the block from configuration disables filtering (handled via the existing nullable-fields mechanism, following the same explicit-null pattern used elsewhere in the tenant resource).
  • Bumped github.com/auth0/go-auth0 to v1.44.1-0.20260706143633-e668df8e2b46 to pick up the new BrandingThemeIdentifiers/BrandingThemePhoneDisplay and TenantCountryCodes SDK types.
  • Updated resource/data-source docs and examples for both auth0_branding_theme and auth0_tenant to document the new blocks.

📚 References

🔬 Testing

  • Added unit tests for expand/flatten logic:
    • internal/auth0/branding/expand_test.go, internal/auth0/branding/flatten_test.go – cover identifiers/phone_display expand and flatten, including nil/empty cases.
    • internal/auth0/tenant/expand_test.go, internal/auth0/tenant/flatten_test.go – cover country_codes expand/flatten and the explicit-null handling when the block is removed.
  • Added acceptance tests with recorded HTTP fixtures:
    • TestAccBrandingThemeIdentifiers (internal/auth0/branding/resource_theme_test.go, test/data/recordings/TestAccBrandingThemeIdentifiers.yaml)
    • TestAccTenant_CountryCodes (internal/auth0/tenant/resource_test.go, test/data/recordings/TestAccTenant_CountryCodes.yaml)

📝 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)

@KartikJha
KartikJha requested a review from a team as a code owner July 6, 2026 16:34
Comment thread internal/auth0/tenant/expand.go Outdated
countryCodes.List = *list
}

if countryCodes.Mode == "" {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering mode is required and (allow, deny) are the only allowed values. This check is redundant.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check removed

Comment thread internal/auth0/tenant/expand.go Outdated
}

config := data.GetRawConfig().GetAttr("country_codes")
if config.IsNull() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A minor cosmetic update can be done to combine both returns in one line:

return config.IsNull() || config.LengthInt() == 0

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated condition

MaxItems: 1,
Optional: true,
Computed: true,
Description: "Configuration for identifier input display settings. Requires the identifier input feature flag to be enabled on the tenant.",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please mention that "once added, identifiers can only be updated but not removed".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

@KartikJha
KartikJha force-pushed the DXCDT-1982/auth0-identifier-country-code branch from 0832e20 to c1c51a7 Compare July 7, 2026 11:48
@KartikJha
KartikJha requested a review from bkiran6398 July 7, 2026 11:52
bkiran6398
bkiran6398 previously approved these changes Jul 8, 2026

@KartikJha KartikJha left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@KartikJha KartikJha changed the title feat: integrated identifiers in theme and country_codes in tenant [DRAFT] feat: integrated identifiers in theme and country_codes in tenant Jul 9, 2026
@KartikJha

Copy link
Copy Markdown
Contributor Author

@bkiran6398 as discussed we will be sending this in the next release.

cc @duedares-rvj

@KartikJha
KartikJha marked this pull request as draft July 9, 2026 09:52
@KartikJha
KartikJha marked this pull request as ready for review July 22, 2026 19:04
@KartikJha KartikJha changed the title [DRAFT] feat: integrated identifiers in theme and country_codes in tenant feat: integrated identifiers in theme and country_codes in tenant Jul 22, 2026
@KartikJha
KartikJha force-pushed the DXCDT-1982/auth0-identifier-country-code branch from 7436632 to 4f70f13 Compare July 22, 2026 19:30
@KartikJha
KartikJha merged commit e3c166d into main Jul 23, 2026
4 checks passed
@KartikJha
KartikJha deleted the DXCDT-1982/auth0-identifier-country-code branch July 23, 2026 14:05
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