Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESD-25205: Deprecate enabled_clients on the auth0_connection resource #421

Merged
merged 1 commit into from
Dec 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/resources/connection.md
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,6 @@ resource "auth0_connection" "okta" {
### Optional

- `display_name` (String) Name used in login screen.
- `enabled_clients` (Set of String) IDs of the clients for which the connection is enabled.
- `is_domain_connection` (Boolean) Indicates whether the connection is domain level.
- `metadata` (Map of String) Metadata associated with the connection, in the form of a map of string values (max 255 chars). Maximum of 10 metadata properties allowed.
- `options` (Block List, Max: 1) Configuration settings for connection options. (see [below for nested schema](#nestedblock--options))
Expand Down
8 changes: 0 additions & 8 deletions internal/provider/resource_auth0_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -738,13 +738,6 @@ var connectionSchema = map[string]*schema.Schema{
},
},
},
"enabled_clients": {
Type: schema.TypeSet,
Elem: &schema.Schema{Type: schema.TypeString},
Optional: true,
Computed: true,
Description: "IDs of the clients for which the connection is enabled.",
},
"realms": {
Type: schema.TypeList,
Elem: &schema.Schema{Type: schema.TypeString},
Expand Down Expand Up @@ -924,7 +917,6 @@ func readConnection(ctx context.Context, d *schema.ResourceData, m interface{})
d.Set("is_domain_connection", connection.GetIsDomainConnection()),
d.Set("strategy", connection.GetStrategy()),
d.Set("options", connectionOptions),
d.Set("enabled_clients", connection.GetEnabledClients()),
d.Set("realms", connection.GetRealms()),
d.Set("metadata", connection.GetMetadata()),
)
Expand Down
12 changes: 0 additions & 12 deletions internal/provider/resource_auth0_connection_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,6 @@ func TestAccConnectionClient(t *testing.T) {
resource.TestCheckResourceAttr("auth0_connection_client.my_conn_client_assoc-2", "name", fmt.Sprintf("Acceptance-Test-Connection-%s", t.Name())),
),
},
{
RefreshState: true,
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("auth0_connection.my_conn", "enabled_clients.#", "2"),
),
},
{
Config: template.ParseTestName(testAccDeleteConnectionClient, t.Name()),
Check: resource.ComposeTestCheckFunc(
Expand All @@ -106,12 +100,6 @@ func TestAccConnectionClient(t *testing.T) {
resource.TestCheckResourceAttr("auth0_connection_client.my_conn_client_assoc-2", "name", fmt.Sprintf("Acceptance-Test-Connection-%s", t.Name())),
),
},
{
RefreshState: true,
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("auth0_connection.my_conn", "enabled_clients.#", "1"),
),
},
},
})
}
Expand Down
74 changes: 0 additions & 74 deletions internal/provider/resource_auth0_connection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -645,80 +645,6 @@ resource "auth0_connection" "oauth2" {
}
`

func TestAccConnectionWithEnabledClients(t *testing.T) {
httpRecorder := recorder.New(t)

resource.Test(t, resource.TestCase{
ProviderFactories: testProviders(httpRecorder),
Steps: []resource.TestStep{
{
Config: template.ParseTestName(testAccConnectionWithEnabledClientsConfig, t.Name()),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("auth0_connection.my_connection", "name", fmt.Sprintf("Acceptance-Test-Connection-%s", t.Name())),
resource.TestCheckResourceAttr("auth0_connection.my_connection", "enabled_clients.#", "4"),
resource.TestCheckResourceAttr("auth0_connection.my_connection", "options.#", "1"), // Gets computed with defaults by the API.
),
},
{
Config: template.ParseTestName(testAccConnectionWithEmptyEnabledClientsConfig, t.Name()),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("auth0_connection.my_connection", "enabled_clients.#", "0"),
),
},
},
})
}

const testAccConnectionWithEnabledClientsConfig = `
resource "auth0_client" "my_client_1" {
name = "Application - Acceptance Test - 1 - {{.testName}}"
description = "Test Applications Long Description"
app_type = "non_interactive"
}

resource "auth0_client" "my_client_2" {
depends_on = [auth0_client.my_client_1]
name = "Application - Acceptance Test - 2 - {{.testName}}"
description = "Test Applications Long Description"
app_type = "non_interactive"
}

resource "auth0_client" "my_client_3" {
depends_on = [auth0_client.my_client_2]
name = "Application - Acceptance Test - 3 - {{.testName}}"
description = "Test Applications Long Description"
app_type = "non_interactive"
}

resource "auth0_client" "my_client_4" {
depends_on = [auth0_client.my_client_3]
name = "Application - Acceptance Test - 4 - {{.testName}}"
description = "Test Applications Long Description"
app_type = "non_interactive"
}

resource "auth0_connection" "my_connection" {
name = "Acceptance-Test-Connection-{{.testName}}"
is_domain_connection = true
strategy = "auth0"
enabled_clients = [
auth0_client.my_client_1.id,
auth0_client.my_client_2.id,
auth0_client.my_client_3.id,
auth0_client.my_client_4.id,
]
}
`

const testAccConnectionWithEmptyEnabledClientsConfig = `
resource "auth0_connection" "my_connection" {
name = "Acceptance-Test-Connection-{{.testName}}"
is_domain_connection = true
strategy = "auth0"
enabled_clients = []
}
`

func TestAccConnectionSMS(t *testing.T) {
httpRecorder := recorder.New(t)

Expand Down
1 change: 0 additions & 1 deletion internal/provider/structure_auth0_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,6 @@ func expandConnection(d *schema.ResourceData) (*management.Connection, diag.Diag
connection := &management.Connection{
DisplayName: value.String(config.GetAttr("display_name")),
IsDomainConnection: value.Bool(config.GetAttr("is_domain_connection")),
EnabledClients: value.Strings(config.GetAttr("enabled_clients")),
Metadata: value.MapOfStrings(config.GetAttr("metadata")),
}

Expand Down
Loading