Repository navigation
Conversation
8000
…permissions Closes keycloak#55576 Signed-off-by: Markus Jung <jungm@apache.org>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the change making SSF receiver discovery independent of the acting admin’s permissions.
No open issues 🎉
What changed in this PR
Fixes #55576 by making SSF receiver discovery independent of the acting admin’s fine-grained permissions, so eligible receivers are not skipped when a restricted admin triggers an event.
Changes:
- Runs receiver lookup and stream consumption within
runWithoutAuthorization. - Documents the system-level lookup contract and callers’ permission-check responsibilities.
- Adds regression tests for restricted-admin user deletion and disabling, including checks that receiver access remains forbidden.
| File | Description |
|---|---|
ssf/transmitter/src/main/java/org/keycloak/ssf/transmitter/stream/storage/SsfStreamStore.java |
Documents authorization requirements for receiver discovery. |
ssf/transmitter/src/main/java/org/keycloak/ssf/transmitter/stream/storage/client/ClientStreamStore.java |
Bypasses admin authorization filtering while resolving receiver streams. |
ssf/tests/base/src/test/java/org/keycloak/tests/ssf/transmitter/SsfTransmitterRestrictedAdminEventTests.java |
Tests event delivery from restricted-admin actions without granting receiver access. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #55576
Summary
The lookup that decides which receivers get an SSF event now runs as the system, not as the admin whose request fired the event.
SsfTransmitterEventListener.onEvent(adminEvent) generateSecurityEventTokensForAdminEvent ClientStreamStore.findStreamsForSsfReceiverClients - clients().searchClientsByAttributes(ssf.enabled=true) # FGAP v2 filters out receivers the admin cannot view + runWithoutAuthorization + clients().searchClientsByAttributes(ssf.enabled=true) + .toList() # consumed inside the scope, the query may be lazyThe result never reaches the admin, and whether the admin may perform the action is already checked before the event fires. The by-stream-id lookups behind the SSF admin endpoints are unchanged, as they run after an explicit permission check on the receiver client. The
SsfStreamStorejavadoc now states this contract. Same pattern as the organization lookups in #51870.Evidence
SsfTransmitterRestrictedAdminEventTests, in a realm with admin permissions enabled:No streams found. Discarding admin event <id>.After: both pass on main and on 26.8.2 with the patched transmitter jar; the full
ssf/tests/basemodule passes on main.Merge Danger
Door: two-way
No schema, configuration, or API change; a revert restores the previous lookup.
Blast Radius: SSF delivery
Receivers hidden from a restricted admin now get the events that admin's actions trigger, which is the intended behavior. SSF is experimental.
This change was prepared with the assistance of an AI coding agent.