[client-v2] Create tests for checking permissions#45981
[client-v2] Create tests for checking permissions#45981vmuzikar merged 3 commits intokeycloak:mainfrom
Conversation
mabartos
commented
Feb 3, 2026
- Closes Create tests for checking permissions #45975
1a53fba to
dbd3e59
Compare
Unreported flaky test detectedIf the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR. org.keycloak.testsuite.forms.BruteForceTest#testExceedMaxTemporaryLockoutsKeycloak CI - Forms IT (chrome) |
62e432e to
8b8892a
Compare
|
@edewit @keycloak/cloud-native Could you please check it? Thanks! |
shawkins
left a comment
There was a problem hiding this comment.
This looks great, thank you @mabartos
Related to this once we have the layers separated I would wonder if we could introduce a v1 to v2 shim to run all the existing v1 test cases against v2 to make sure we have accounted for all the differences.
@shawkins Thanks. +1 Yep, once it's doable, I think it'd be very good to do it to increase our confidence with the V2. |
|
@vmuzikar I saw that you requested a review for yourself. Do you plan to look at it? |
|
@mabartos Yes, I'd like to take a look tomorrow. |
...-v2/tests/src/test/java/org/keycloak/tests/admin/client/v2/ClientApiV2AuthorizationTest.java
Show resolved
Hide resolved
| @InjectAdminClient(ref = "manageRealmAdminClient", client = "test-client", user = "manage-realm-admin", | ||
| mode = InjectAdminClient.Mode.MANAGED_REALM) | ||
| Keycloak manageRealmAdminClient; |
There was a problem hiding this comment.
In general, we're missing manage-realm role from almost all test but that should be fine as it's a role essentially unrelated to clients.
There was a problem hiding this comment.
@vmuzikar We can think about potential other test cases later if it works to you.
...-v2/tests/src/test/java/org/keycloak/tests/admin/client/v2/ClientApiV2AuthorizationTest.java
Show resolved
Hide resolved
...-v2/tests/src/test/java/org/keycloak/tests/admin/client/v2/ClientApiV2AuthorizationTest.java
Show resolved
Hide resolved
...-v2/tests/src/test/java/org/keycloak/tests/admin/client/v2/ClientApiV2AuthorizationTest.java
Show resolved
Hide resolved
...-v2/tests/src/test/java/org/keycloak/tests/admin/client/v2/ClientApiV2AuthorizationTest.java
Outdated
Show resolved
Hide resolved
...-v2/tests/src/test/java/org/keycloak/tests/admin/client/v2/ClientApiV2AuthorizationTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
We're missing some tests for FGAP. Permissions can be on per-client basis. But I'd be ok with doing it as a follow-up.
There was a problem hiding this comment.
Yes, we can do it in a follow-up.
There was a problem hiding this comment.
Follow-up:
Closes keycloak#45975 Signed-off-by: Martin Bartoš <[email protected]>
Signed-off-by: Martin Bartoš <[email protected]>
Signed-off-by: Martin Bartoš <[email protected]>
|
@vmuzikar Replied in your comments. For completeness, I've added the missing test cases with different roles. Should be ready to review. |
* [client-v2] Create tests for checking permissions Closes keycloak#45975 Signed-off-by: Martin Bartoš <[email protected]> * Simplify admin client creation, test abstraction Signed-off-by: Martin Bartoš <[email protected]> * Address Vasek's comments Signed-off-by: Martin Bartoš <[email protected]> --------- Signed-off-by: Martin Bartoš <[email protected]>