Skip to content
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

Support API changes in Keycloak 23 #71

Merged
merged 2 commits into from
Apr 9, 2024
Merged

Conversation

HappyTetrahedron
Copy link
Contributor

@HappyTetrahedron HappyTetrahedron commented Apr 3, 2024

Summary

  • GET /admin/realms/$REALM/groups/$ID no longer returns the full subgroup-tree
    • Turns out, this doesn't affect us here. We use the Search option to always search for a specific group. If the result is a subgroup, the endpoint still returns the full subtree with all parent groups included.
  • GET /admin/realms/$REALM/groups no longer returns the complete group tree, it now only returns the top level groups
    • This is resolved by querying child groups for each group (similarly to how we already query members for each group), using the new child groups endpoint.
    • If that endpoint doesn't exist (returns a 404), the code does nothing, assuming that we're on an older Keycloak version which would've returned the complete group tree in the first place.
    • Child groups are not queried recursively. This isn't necessary, since we only consider the top 2 levels of groups anyway (any more deeply nested groups are ignored later on).

Checklist

  • Categorize the PR by setting a good title and adding one of the labels:
    bug, enhancement, documentation, change, breaking, dependency
    as they show up in the changelog
  • Update tests.

@HappyTetrahedron HappyTetrahedron added the enhancement New feature or request label Apr 3, 2024
@HappyTetrahedron HappyTetrahedron changed the title [WIP] Support API changes in Keycloak 23 Support API changes in Keycloak 23 Apr 5, 2024
@HappyTetrahedron HappyTetrahedron requested a review from bastjan April 5, 2024 10:21
Copy link
Contributor

@bastjan bastjan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few nits, otherwise LGTM

keycloak/client.go Outdated Show resolved Hide resolved
keycloak/client.go Outdated Show resolved Hide resolved
keycloak/client.go Outdated Show resolved Hide resolved
keycloak/client.go Outdated Show resolved Hide resolved
@HappyTetrahedron HappyTetrahedron requested a review from bastjan April 8, 2024 12:08
@HappyTetrahedron HappyTetrahedron merged commit 61bcaa2 into master Apr 9, 2024
3 checks passed
@HappyTetrahedron HappyTetrahedron deleted the feat/keycloak-23 branch April 9, 2024 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants