Skip to content

Conversation

@gdelbos
Copy link

@gdelbos gdelbos commented Apr 1, 2025

What this PR does / why we need it:

Currently, only the groups attribute is managed. However, it can be interesting to allow the subGroups to be managed in the same way. This will allow the usage of multiple file containing specific subGroup configuration.

For instance, you can have a federation that is retrieving groups from an LDAP directory. Some on those groups must be updated to provided some specific roles. However, for lisibility, you want the groups from LDAP to be subgroups of a global container group. Additionaly, for maintenance purpose, you prefer to have one configuration file per LDAP group.

File 1:

{
  "realm": "my-realm",
  "groups": [
    {
      "name": "LDAPSync",
      "path": "/LDAPSync",
      "subGroups": [
        {
          "name": "GROUP_1",
          "path": "/LDAPSync/GROUP_1",
          "subGroups": [],
          "realmRoles": [
            "user"
          ],
          "clientRoles": {
            "my-user-service": [
              "user_read",
              "user_search"
            ]
          }
        }
      ]
    }
  ]
}

File 2:

{
  "realm": "my-realm",
  "groups": [
    {
      "name": "LDAPSync",
      "path": "/LDAPSync",
      "subGroups": [
        {
          "name": "GROUP_2",
          "path": "/LDAPSync/GROUP_2",
          "subGroups": [],
          "realmRoles": [
            "admin"
          ],
          "clientRoles": {
            "my-user-service": [
              "user_read",
              "user_search",
              "user_update",
              "user_create",
              "user_delete"
            ]
          }
        }
      ]
    }
  ]
}

After the import of those two file, with the modification of the subGroup managed propertie value, we will have 1 container group (LDAPSync) containing two sub group: GROUP_1 and GROUP_2

PR Readiness Checklist:

Complete these before marking the PR as ready to review:

  • the CHANGELOG.md release notes have been updated to reflect any significant (and particularly user-facing) changes introduced by this PR

@sonarqubecloud
Copy link

sonarqubecloud bot commented Apr 1, 2025

@gdelbos gdelbos marked this pull request as ready for review April 1, 2025 16:06
@AssahBismarkabah AssahBismarkabah added bug enhancement java Pull requests that update Java code labels Sep 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug enhancement java Pull requests that update Java code

Projects

Development

Successfully merging this pull request may close these issues.

2 participants