feat: add fine-grained realm-wide client scope management #1021
+614
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Replaces #649 (Closes #649)
Relates #895 #470 #547
This PR adds two new resources to the Terraform Keycloak provider:
keycloak_openid_default_client_scope
andkeycloak_openid_optional_client_scope
. These resources allow assigning default or optional client scopes at the realm level, resolving a significant limitation. While default client scopes can already be configured at the realm level, custom-created scopes are not supported due to a chicken-and-egg issue: custom scopes require the realm to exist beforehand. Moreover, these resources enable fine-grained management of individual client scopes rather than managing an entire list, providing enhanced flexibility and precision.Thanks to @Korsarro69 for the initial work. I opened this PR as #649 is now stale.
cc @daviddelannoy @dglozano @lebronnecf
TODO:
keycloak_openid_client_default_scopes
andkeycloak_openid_client_optional_scopes
. Isn'tkeycloak_openid_default_client_scope
andkeycloak_openid_optional_client_scope
not too confusing? Should I rename tokeycloak_openid_client_default_scope
andkeycloak_openid_client_optional_scope
? I guess the real-wide will be added to the list resources in the future, which will align functionalities.Run tests in codespaces with: