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

DXCDT-246: Add new resource to manage enabled clients on a connection #379

Merged
merged 2 commits into from
Oct 25, 2022

Conversation

sergiught
Copy link
Contributor

@sergiught sergiught commented Oct 25, 2022

🔧 Changes

It has been requested through #281 to have an easier way to manage enabled_clients on a auth0_connection resource so this PR introduces a brand new resource auth0_connection_client that does exact and only that.

To note however that using both the enabled_clients on the auth0_connection and this new auth0_connection_client resource will result in unpredictable behavior and it is discouraged. To not introduce breaking changes we'll allowing for both ways of setting enabled clients to coexist. If problematic however, the enabled_clients property on the connection might be changed to read only in the future.

The new resource has no optional fields and if either the client_id or connection_id is changed, this will force the destruction of the old resource and create a new one. On the connection level, this means that the old client_id will get removed from the enabled_clients and the new one added.

📚 References

🔬 Testing

Other than the automated tests that were added, this can also be tested through running make install VERSION=XX.XX.XX and then using that in your terraform config as follows:

terraform {
  required_providers {
    auth0 = {
      source  = "auth0/auth0"
      version = "XX.XX.XX"
    }
  }
}

provider "auth0" {
  debug = "true"
}

resource "auth0_connection" "my_conn" {
  name     = "My-Auth0-Connection"
  strategy = "auth0"
  # Avoid using the enabled_clients = [...],
  # if using the auth0_connection_client resource.
}

resource "auth0_client" "my_client" {
  name = "My-Auth0-Client"
}

resource "auth0_connection_client" "my_conn_client_assoc" {
  connection_id = auth0_connection.my_conn.id
  client_id     = auth0_client.my_client.id
}

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

@drhagen
Copy link

drhagen commented Oct 25, 2022

I don't know any Go, so I'll have to trust your implementation, but the design looks appropriate for our needs. Thanks for implementing this!

Copy link
Contributor

@willvedd willvedd left a comment

Choose a reason for hiding this comment

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

@sergiught and I reviewed together 👍

@sergiught sergiught merged commit 73e8358 into main Oct 25, 2022
@sergiught sergiught deleted the feature/DXCDT-246-conn-client branch October 25, 2022 16:01
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.

3 participants