SSF: use the originating event id as the SET txn - #53110
Open
thomasdarimont wants to merge 2 commits into
Open
thomasdarimont wants to merge 2 commits into
thomasdarimont wants to merge 2 commits into
Conversation
SETs derived from a Keycloak user or admin event now carry that event's id as txn instead of a random UUID. A SET a receiver reports back can thus be traced to the realm's user / admin event log, and every SET fanned out to multiple streams for one event shares a txn. This matches SSF 1.0 §4.1.9: txn MUST be unique to the underlying event that caused the SET, and MAY be shared across SETs that stem from the same cause. The Keycloak event id is exactly that cause. https://openid.net/specs/openid-sharedsignals-framework-1_0-final.html#section-4.1.9 Verification, stream-updated and synthetic SETs have no originating event and keep a random UUID txn. The admin logout-all path now passes the admin event through so its SET gets the admin event id and is reported as admin-initiated. Fixes keycloak#48896 Signed-off-by: Thomas Darimont <thomas.darimont@googlemail.com>
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The implementation consistently applies originating event IDs while preserving random transactions for synthetic events.
Review effort: Balanced
Findings: None
What changed in this PR
Uses originating Keycloak event IDs as SSF txn claims for traceability and consistent fan-out correlation.
Changes:
- Resolves
txnfrom user/admin events, retaining UUID fallback. - Passes admin logout events through for correct attribution.
- Adds unit and integration coverage.
| File | Description |
|---|---|
SecurityEventTokenMapper.java |
Implements event-based txn resolution. |
SecurityEventTokenMapperTest.java |
Tests IDs, fan-out, fallback, and admin logout. |
SsfTransmitterPollDeliveryTests.java |
Verifies txn against the persisted event log. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Signed-off-by: Thomas Darimont <thomas.darimont@googlemail.com>
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.
SETs derived from a Keycloak user or admin event now carry that event's id as txn instead of a random UUID. A SET a receiver reports back can thus be traced to the realm's user / admin event log, and every SET fanned out to multiple streams for one event shares a txn.
This matches SSF 1.0 §4.1.9: txn MUST be unique to the underlying event that caused the SET, and MAY be shared across SETs that stem from the same cause. The Keycloak event id is exactly that cause. https://openid.net/specs/openid-sharedsignals-framework-1_0-final.html#section-4.1.9
Verification, stream-updated and synthetic SETs have no originating event and keep a random UUID txn. The admin logout-all path now passes the admin event through so its SET gets the admin event id and is reported as admin-initiated.
Fixes #48896
Co-Authored-By: Claude Fable 5.1