-
Notifications
You must be signed in to change notification settings - Fork 96
Deprecate enabled_clients
in auth0_connection
and update API endpoints
#1272
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
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1272 +/- ##
==========================================
- Coverage 88.52% 88.52% -0.01%
==========================================
Files 141 142 +1
Lines 19536 19865 +329
==========================================
+ Hits 17295 17586 +291
- Misses 1615 1643 +28
- Partials 626 636 +10
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it a breaking change for existing users if they update the provider? Is there any behaviour change ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR removes the deprecated enabled_clients
field on the main auth0_connection
resource and updates all CRUD operations and data sources to use the new ReadEnabledClients
/UpdateEnabledClients
endpoints.
- Test recordings updated to reflect new client IDs, endpoint URLs, and response formats
- Refactored
resource_clients.go
andresource_client.go
to callReadEnabledClients
/UpdateEnabledClients
instead of embeddingEnabledClients
on the Connection object - Adjusted flatten helpers and data source logic to consume the new client‐list responses
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
test/data/recordings/TestAccConnectionClientsPreventErasingEnabledClientsOnCreate.yaml | Updated HTTP interactions to use new client IDs, /clients paths, and adjusted durations |
test/data/recordings/TestAccConnectionClientsImport.yaml | Updated import recordings with new connection/client IDs and endpoint URLs |
internal/auth0/connection/resource_clients_test.go | Bumped ImportStateId values to the new IDs |
internal/auth0/connection/resource_clients.go | Switched from Connection.Update to UpdateEnabledClients , added guard vs. wiping clients |
internal/auth0/connection/resource_client.go | Refactored single‐client resource to use UpdateEnabledClients |
internal/auth0/connection/flatten.go | Extended flatten functions to accept ConnectionEnabledClientList |
internal/auth0/connection/data_source_test.go | Renamed data source blocks to distinct IDs in tests |
internal/auth0/connection/data_source.go | Added ReadEnabledClients calls and updated flattenConnectionForDataSource invocation |
Comments suppressed due to low confidence (1)
internal/auth0/connection/resource_clients.go:61
- Potential nil pointer dereference:
GetRawConfig().GetAttr("enabled_clients")
may return nil if the attribute isn't explicitly set. Consider checking for nil or falling back to an empty slice before dereferencingrawEnabledClients
.
rawEnabledClients := value.Strings(data.GetRawConfig().GetAttr("enabled_clients"))
if err := api.Connection.Update(ctx, connectionID, connectionWithEnabledClients); err != nil { | ||
return diag.FromErr(internalError.HandleAPIError(data, err)) | ||
if err := api.Connection.UpdateEnabledClients(ctx, connectionID, payload); err != nil { | ||
return diag.FromErr(err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Error handling here returns the raw error; for consistency with other operations, wrap this with internalError.HandleAPIError(data, err)
to produce uniform diagnostics.
return diag.FromErr(err) | |
return diag.FromErr(internalError.HandleAPIError(data, err)) |
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@duedares-rvj please check
No, we have ensured that this is not a breaking change. The schema of the resource and data-source are left untouched. Only the underlying CRUD logic has been updated to accommodate the exact same behaviour of the provider. All existing test cases have passed. |
🔧 Changes
EnabledClients attribute is now deprecated from Connections schema.
Provider currently supports two resources
auth0_connection_client
andauth0_connection_clients
to manage 1:1 and 1:many mapping between Connection and Client/s.The underlying CRUD logic has been updated to ensure the behaviour of the resources and data-source remains exactly the same, even with the newly introduced endpoints :
ReadEnabledClients
andUpdateEnabledClients
📚 References
Go-sdk changes: auth0/go-auth0#556
🔬 Testing
All the old test cases passed - ensuring the changes works in harmony with the pre-exiting resource/data-source.
Test recordings have been updated.
📝 Checklist