Skip to content
New issue

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

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

Already on GitHub? # to your account

Handle nested group paths as names #786

Closed

Conversation

Arkaniad
Copy link

We're trying to manage nested groups via Terraform. Our nested group hierarchy mirrored by this YAML:

teams:
 team-foo:
   read-only:
   developer:
   admin:
 team-bar:
   read-only:
   developer:
   admin:

Unfortunately, when attempting to query a group by path with provider 3.10.0 and 4.1.0 fails with the following message:

│ Error: no group with name /teams/team-foo/admin found
│ 
│   with data.keycloak_group.admin_groups["/teams/team-foo/admin"],
│   on .terraform/modules/dummy/main.tf line 1, in data "keycloak_group" "admin_groups":
│    1: data "keycloak_group" "admin_groups" {
│ 

Digging deeper it seems that the search parameter used here is not returning any results when searching for the group by path.

I followed along with #333 and #334 but in our case we can't search by 'group name' as there will be multiple indistinguishable yet unique groups returned.

This is a possibly inefficient implementation of handling group paths - if name starts with a backslash it assumes that name is actually a path and to search subgroups downward from the first group specified in the path until it either finds the group specified at the end of the path or comes up empty handed.

Arkaniad and others added 3 commits December 27, 2022 16:56
Signed-off-by: Rhea Danzey <rdanzey@element.io>
Signed-off-by: Rhea Danzey <rdanzey@element.io>
@Arkaniad
Copy link
Author

I'm thinking this was an older version of Keycloak we were using. After some re-working of our groups things are working sensibly now. I'm going to close this as I'm not sure if it'll be useful for anyone anymore. Sorry :D

@Arkaniad Arkaniad closed this Apr 19, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant