Skip to content

Commit

Permalink
Removing references to deprecated universal login fields in auth0_ten…
Browse files Browse the repository at this point in the history
…ant resource
  • Loading branch information
willvedd committed Jul 12, 2023
1 parent 03314e9 commit b825a3b
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 170 deletions.
18 changes: 0 additions & 18 deletions docs/data-sources/tenant.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ data "auth0_tenant" "my_tenant" {}
- `session_lifetime` (Number) Number of hours during which a session will stay valid.
- `support_email` (String) Support email address for authenticating users.
- `support_url` (String) Support URL for authenticating users.
- `universal_login` (List of Object) Configuration settings for Universal Login. These configuration settings have been deprecated. Migrate to managing these settings through the `auth0_branding` resource. Check the [MIGRATION_GUIDE](https://github.com/auth0/terraform-provider-auth0/blob/main/MIGRATION_GUIDE.md#tenant-universal-login) for more info. (see [below for nested schema](#nestedatt--universal_login))

<a id="nestedatt--change_password"></a>
### Nested Schema for `change_password`
Expand Down Expand Up @@ -86,7 +85,6 @@ Read-Only:
- `mfa_show_factor_list_on_enrollment` (Boolean)
- `no_disclose_enterprise_connections` (Boolean)
- `revoke_refresh_token_grant` (Boolean)
- `universal_login` (Boolean)
- `use_scope_descriptions_for_consent` (Boolean)


Expand All @@ -107,19 +105,3 @@ Read-Only:
- `mode` (String)


<a id="nestedatt--universal_login"></a>
### Nested Schema for `universal_login`

Read-Only:

- `colors` (List of Object) (see [below for nested schema](#nestedobjatt--universal_login--colors))

<a id="nestedobjatt--universal_login--colors"></a>
### Nested Schema for `universal_login.colors`

Read-Only:

- `page_background` (String)
- `primary` (String)


26 changes: 0 additions & 26 deletions docs/resources/tenant.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,7 @@ resource "auth0_tenant" "my_tenant" {
mode = "non-persistent"
}
universal_login {
colors {
primary = "#0059d6"
page_background = "#000000"
}
}
flags {
universal_login = true
disable_clickjack_protection_headers = true
enable_public_signup_user_exists_error = true
use_scope_descriptions_for_consent = true
Expand Down Expand Up @@ -86,7 +78,6 @@ resource "auth0_tenant" "my_tenant" {
- `session_lifetime` (Number) Number of hours during which a session will stay valid.
- `support_email` (String) Support email address for authenticating users.
- `support_url` (String) Support URL for authenticating users.
- `universal_login` (Block List, Max: 1, Deprecated) Configuration settings for Universal Login. These configuration settings have been deprecated. Migrate to managing these settings through the `auth0_branding` resource. Check the [MIGRATION_GUIDE](https://github.com/auth0/terraform-provider-auth0/blob/main/MIGRATION_GUIDE.md#tenant-universal-login) for more info. (see [below for nested schema](#nestedblock--universal_login))

### Read-Only

Expand Down Expand Up @@ -137,7 +128,6 @@ Optional:
- `mfa_show_factor_list_on_enrollment` (Boolean) Used to allow users to pick which factor to enroll with from the list of available MFA factors.
- `no_disclose_enterprise_connections` (Boolean) Do not Publish Enterprise Connections Information with IdP domains on the lock configuration file.
- `revoke_refresh_token_grant` (Boolean) Delete underlying grant when a refresh token is revoked via the Authentication API.
- `universal_login` (Boolean, Deprecated) Indicates whether the New Universal Login Experience is enabled.
- `use_scope_descriptions_for_consent` (Boolean) Indicates whether to use scope descriptions for consent.


Expand All @@ -157,22 +147,6 @@ Optional:

- `mode` (String) Behavior of tenant session cookie. Accepts either "persistent" or "non-persistent".


<a id="nestedblock--universal_login"></a>
### Nested Schema for `universal_login`

Optional:

- `colors` (Block List, Max: 1) Configuration settings for Universal Login colors. (see [below for nested schema](#nestedblock--universal_login--colors))

<a id="nestedblock--universal_login--colors"></a>
### Nested Schema for `universal_login.colors`

Optional:

- `page_background` (String) Background color of login pages in hexadecimal.
- `primary` (String) Primary button background color in hexadecimal.

## Import

Import is supported using the following syntax:
Expand Down
8 changes: 0 additions & 8 deletions examples/resources/auth0_tenant/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,7 @@ resource "auth0_tenant" "my_tenant" {
mode = "non-persistent"
}

universal_login {
colors {
primary = "#0059d6"
page_background = "#000000"
}
}

flags {
universal_login = true
disable_clickjack_protection_headers = true
enable_public_signup_user_exists_error = true
use_scope_descriptions_for_consent = true
Expand Down
11 changes: 0 additions & 11 deletions internal/auth0/tenant/data_source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ resource "auth0_tenant" "my_tenant" {
enabled_locales = ["en", "de", "fr"]
flags {
universal_login = true
disable_clickjack_protection_headers = true
enable_public_signup_user_exists_error = true
use_scope_descriptions_for_consent = true
Expand All @@ -35,13 +34,6 @@ resource "auth0_tenant" "my_tenant" {
disable_fields_map_fix = false
}
universal_login {
colors {
primary = "#0059d6"
page_background = "#000000"
}
}
error_page {
html = "<html>Error Page</html>"
show_log_link = false
Expand Down Expand Up @@ -82,12 +74,9 @@ func TestAccDataSourceTenant(t *testing.T) {
resource.TestCheckResourceAttr("data.auth0_tenant.current", "enabled_locales.0", "en"),
resource.TestCheckResourceAttr("data.auth0_tenant.current", "enabled_locales.1", "de"),
resource.TestCheckResourceAttr("data.auth0_tenant.current", "enabled_locales.2", "fr"),
resource.TestCheckResourceAttr("data.auth0_tenant.current", "flags.0.universal_login", "true"),
resource.TestCheckResourceAttr("data.auth0_tenant.current", "flags.0.disable_clickjack_protection_headers", "true"),
resource.TestCheckResourceAttr("data.auth0_tenant.current", "flags.0.enable_public_signup_user_exists_error", "true"),
resource.TestCheckResourceAttr("data.auth0_tenant.current", "flags.0.use_scope_descriptions_for_consent", "true"),
resource.TestCheckResourceAttr("data.auth0_tenant.current", "universal_login.0.colors.0.primary", "#0059d6"),
resource.TestCheckResourceAttr("data.auth0_tenant.current", "universal_login.0.colors.0.page_background", "#000000"),
resource.TestCheckResourceAttr("data.auth0_tenant.current", "default_redirection_uri", "https://example.com/login"),
resource.TestCheckResourceAttr("data.auth0_tenant.current", "session_cookie.0.mode", "non-persistent"),
),
Expand Down
25 changes: 0 additions & 25 deletions internal/auth0/tenant/expand.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ func expandTenant(d *schema.ResourceData) *management.Tenant {
GuardianMFAPage: ExpandTenantGuardianMFAPage(config.GetAttr("guardian_mfa_page")),
ErrorPage: ExpandTenantErrorPage(config.GetAttr("error_page")),
Flags: expandTenantFlags(config.GetAttr("flags")),
UniversalLogin: expandTenantUniversalLogin(config.GetAttr("universal_login")),
SessionCookie: expandTenantSessionCookie(config.GetAttr("session_cookie")),
}

Expand Down Expand Up @@ -103,7 +102,6 @@ func expandTenantFlags(config cty.Value) *management.TenantFlags {
EnablePipeline2: value.Bool(flags.GetAttr("enable_pipeline2")),
EnableDynamicClientRegistration: value.Bool(flags.GetAttr("enable_dynamic_client_registration")),
EnableCustomDomainInEmails: value.Bool(flags.GetAttr("enable_custom_domain_in_emails")),
UniversalLogin: value.Bool(flags.GetAttr("universal_login")),
EnableLegacyLogsSearchV2: value.Bool(flags.GetAttr("enable_legacy_logs_search_v2")),
DisableClickjackProtectionHeaders: value.Bool(flags.GetAttr("disable_clickjack_protection_headers")),
EnablePublicSignupUserExistsError: value.Bool(flags.GetAttr("enable_public_signup_user_exists_error")),
Expand All @@ -129,29 +127,6 @@ func expandTenantFlags(config cty.Value) *management.TenantFlags {
return tenantFlags
}

func expandTenantUniversalLogin(config cty.Value) *management.TenantUniversalLogin {
var universalLogin management.TenantUniversalLogin

config.ForEachElement(func(_ cty.Value, d cty.Value) (stop bool) {
colors := d.GetAttr("colors")

colors.ForEachElement(func(_ cty.Value, color cty.Value) (stop bool) {
universalLogin.Colors = &management.TenantUniversalLoginColors{
Primary: value.String(color.GetAttr("primary")),
PageBackground: value.String(color.GetAttr("page_background")),
}
return stop
})
return stop
})

if universalLogin == (management.TenantUniversalLogin{}) {
return nil
}

return &universalLogin
}

func expandTenantSessionCookie(config cty.Value) *management.TenantSessionCookie {
var sessionCookie management.TenantSessionCookie

Expand Down
20 changes: 0 additions & 20 deletions internal/auth0/tenant/flatten.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ func flattenTenantFlags(flags *management.TenantFlags) []interface{} {
m["enable_pipeline2"] = flags.EnablePipeline2
m["enable_dynamic_client_registration"] = flags.EnableDynamicClientRegistration
m["enable_custom_domain_in_emails"] = flags.EnableCustomDomainInEmails
m["universal_login"] = flags.UniversalLogin
m["enable_legacy_logs_search_v2"] = flags.EnableLegacyLogsSearchV2
m["disable_clickjack_protection_headers"] = flags.DisableClickjackProtectionHeaders
m["enable_public_signup_user_exists_error"] = flags.EnablePublicSignupUserExistsError
Expand All @@ -77,25 +76,6 @@ func flattenTenantFlags(flags *management.TenantFlags) []interface{} {
return []interface{}{m}
}

func flattenTenantUniversalLogin(universalLogin *management.TenantUniversalLogin) []interface{} {
if universalLogin == nil {
return nil
}
if universalLogin.Colors == nil {
return nil
}

m := make(map[string]interface{})
m["colors"] = []interface{}{
map[string]interface{}{
"primary": universalLogin.Colors.Primary,
"page_background": universalLogin.Colors.PageBackground,
},
}

return []interface{}{m}
}

func flattenTenantSessionCookie(sessionCookie *management.TenantSessionCookie) []interface{} {
m := make(map[string]interface{})
m["mode"] = sessionCookie.GetMode()
Expand Down
43 changes: 0 additions & 43 deletions internal/auth0/tenant/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,14 +228,6 @@ func NewResource() *schema.Resource {
Computed: true,
Description: "Indicates whether the tenant allows custom domains in emails.",
},
"universal_login": {
Type: schema.TypeBool,
Optional: true,
Computed: true,
Deprecated: "This attribute is deprecated. Use the `universal_login_experience` attribute" +
" on the `auth0_prompt` resource to toggle the new or classic experience instead.",
Description: "Indicates whether the New Universal Login Experience is enabled.",
},
"enable_legacy_logs_search_v2": {
Type: schema.TypeBool,
Optional: true,
Expand Down Expand Up @@ -341,40 +333,6 @@ func NewResource() *schema.Resource {
},
},
},
"universal_login": {
Type: schema.TypeList,
Optional: true,
Computed: true,
MaxItems: 1,
Description: "Configuration settings for Universal Login. These configuration settings have been deprecated. Migrate to managing these settings through the `auth0_branding` resource. Check the [MIGRATION_GUIDE](https://github.com/auth0/terraform-provider-auth0/blob/main/MIGRATION_GUIDE.md#tenant-universal-login) for more info.",
Deprecated: "These configuration settings have been deprecated. Migrate to managing these settings through the `auth0_branding` resource. Check the [MIGRATION_GUIDE](https://github.com/auth0/terraform-provider-auth0/blob/main/MIGRATION_GUIDE.md#tenant-universal-login) for more info.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"colors": {
Type: schema.TypeList,
Optional: true,
MaxItems: 1,
Description: "Configuration settings for Universal Login colors.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"primary": {
Type: schema.TypeString,
Optional: true,
Computed: true,
Description: "Primary button background color in hexadecimal.",
},
"page_background": {
Type: schema.TypeString,
Optional: true,
Computed: true,
Description: "Background color of login pages in hexadecimal.",
},
},
},
},
},
},
},
"default_redirection_uri": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -441,7 +399,6 @@ func readTenant(ctx context.Context, d *schema.ResourceData, m interface{}) diag
d.Set("enabled_locales", tenant.GetEnabledLocales()),
d.Set("error_page", FlattenTenantErrorPage(tenant.GetErrorPage())),
d.Set("flags", flattenTenantFlags(tenant.GetFlags())),
d.Set("universal_login", flattenTenantUniversalLogin(tenant.GetUniversalLogin())),
d.Set("session_cookie", flattenTenantSessionCookie(tenant.GetSessionCookie())),
)

Expand Down
19 changes: 0 additions & 19 deletions internal/auth0/tenant/resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ func TestAccTenant(t *testing.T) {
resource.TestCheckResourceAttr("auth0_tenant.my_tenant", "enabled_locales.1", "de"),
resource.TestCheckResourceAttr("auth0_tenant.my_tenant", "enabled_locales.2", "fr"),
resource.TestCheckResourceAttr("auth0_tenant.my_tenant", "flags.#", "1"),
resource.TestCheckResourceAttr("auth0_tenant.my_tenant", "flags.0.universal_login", "true"),
resource.TestCheckResourceAttr("auth0_tenant.my_tenant", "flags.0.disable_clickjack_protection_headers", "true"),
resource.TestCheckResourceAttr("auth0_tenant.my_tenant", "flags.0.enable_public_signup_user_exists_error", "true"),
resource.TestCheckResourceAttr("auth0_tenant.my_tenant", "flags.0.use_scope_descriptions_for_consent", "true"),
Expand All @@ -46,8 +45,6 @@ func TestAccTenant(t *testing.T) {
resource.TestCheckResourceAttr("auth0_tenant.my_tenant", "error_page.0.html", "<html>Error Page</html>"),
resource.TestCheckResourceAttr("auth0_tenant.my_tenant", "error_page.0.show_log_link", "false"),
resource.TestCheckResourceAttr("auth0_tenant.my_tenant", "error_page.0.url", "https://mycompany.org/error"),
resource.TestCheckResourceAttr("auth0_tenant.my_tenant", "universal_login.0.colors.0.primary", "#0059d6"),
resource.TestCheckResourceAttr("auth0_tenant.my_tenant", "universal_login.0.colors.0.page_background", "#000000"),
resource.TestCheckResourceAttr("auth0_tenant.my_tenant", "default_redirection_uri", "https://example.com/login"),
resource.TestCheckResourceAttr("auth0_tenant.my_tenant", "session_cookie.0.mode", "non-persistent"),
),
Expand Down Expand Up @@ -100,7 +97,6 @@ resource "auth0_tenant" "my_tenant" {
enabled_locales = ["en", "de", "fr"]
flags {
universal_login = true
disable_clickjack_protection_headers = true
enable_public_signup_user_exists_error = true
use_scope_descriptions_for_consent = true
Expand All @@ -116,13 +112,6 @@ resource "auth0_tenant" "my_tenant" {
url = "https://mycompany.org/error"
}
universal_login {
colors {
primary = "#0059d6"
page_background = "#000000"
}
}
session_cookie {
mode = "non-persistent"
}
Expand All @@ -144,7 +133,6 @@ resource "auth0_tenant" "my_tenant" {
enabled_locales = ["de", "fr"]
flags {
universal_login = true
enable_public_signup_user_exists_error = true
disable_clickjack_protection_headers = false # <---- disable and test
use_scope_descriptions_for_consent = false
Expand All @@ -154,13 +142,6 @@ resource "auth0_tenant" "my_tenant" {
mfa_show_factor_list_on_enrollment = true
}
universal_login {
colors {
primary = "#0059d6"
page_background = "#000000"
}
}
change_password {
enabled = true
html = "<html>Change Password</html>"
Expand Down

0 comments on commit b825a3b

Please sign in to comment.