-
Notifications
You must be signed in to change notification settings - Fork 326
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
The keycloak_group
would break if the group name contains /
#330
Comments
Yeah, this is a tricky one. When I first implemented the The reason that computing the parent ID is important is because of Keycloak's ability to have nested groups. This allows you to create a group like resource "keycloak_group" "cloud" {
realm_id = keycloak_realm.test.id
name = "cloud"
}
resource "keycloak_group" "company_x" {
realm_id = keycloak_realm.test.id
parent_id = keycloak_group.cloud.id
name = "company-x"
}
resource "keycloak_group" "developers" {
realm_id = keycloak_realm.test.id
parent_id = keycloak_group.company_x.id
name = "developers"
} It looks like you're trying to do something similar with your naming convention, but you're looking to create a single group instead of multiple, nested groups. If you want to proceed with your approach, then it'll definitely require an update to the provider, although I am not sure if there is an elegant way to do this without searching through all groups from the top down. |
We could make it a setting on the provider itself?
The default would be "/" |
@tomrutsaert the @mrparkers do you think it would help if we add checking on group path Btw, think I found another issue with
Then I received this error:
Both groups are present in Keycloak after the first creation run. |
Hello, as the company convention, we will name Keycloak groups following the format
parent/sub/group
(eg. cloud/company-x/developers). This works so far with Keycloak, however when we try to involvedata keycloak-group
if would fail with msg:Error: unable to determine parent ID for group with path /cloud/company-x/developers
I dig in the code and see that the provider is trying to get the
parentId
by splitting/
from the grouppath
and iterate between parts, which will be incorrect in our case because our group name contains/
.As I check the Keycloak Rest spec:
https://www.keycloak.org/docs-api/10.0/rest-api/index.html
I am a bit doubtful on the need for setting
parentId
when working withkeycloak_group
resource/dataP/S: I tried to include a fix without breaking the interface, but that would require an additional call to get all KC groups.
The text was updated successfully, but these errors were encountered: