Repository navigation
fix(auth): publish fingerprinted hosted session expiry - #664
Merged
senamakel merged 4 commits intoOct 24, 2026
Merged
Conversation
Add a test asserting that a hosted session 401 publishes a SessionExpired event carrying the fingerprint of the request credential, so the expiry signal can be matched back to the credential that was rejected. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
The test now matches on the event stream's Option-based receive results instead of the previous Result with TryRecvError, so it compiles against the updated tinybus channel interface. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
Hosted clients now record a fingerprint of the session credential at construction and, when a request fails with a 401 while using a session credential, publish a SessionExpired domain event naming the operation and fingerprint. This lets the rest of the system react to a rejected session instead of only surfacing the error to the caller. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
Reordered the import list in the hosted client and reformatted the 401 session-expiry check so the matches! guard and the credential-kind condition sit on separate lines. No behaviour change. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
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.
HostedClientconverts hosted session 401s intoSESSION_EXPIREDerrors, but the core dispatcher no longer infers which credential a request used. Without a request-owned expiry event, hosted 401s leave the current session active.The hosted client now fingerprints the exact trimmed session bearer used to build its SDK client and publishes
SessionExpiredwith that fingerprint on a session 401. API-key 401 handling remains unchanged.The wiremock regression sends a hosted request with a known bearer and checks that the expiry event carries the matching fingerprint. It failed before the publisher because the event timed out, and passes with the fix. The full hosted client unit group passes (12 tests).
Follow-up to
senamakel/openhuman#636/ PR #663. Part oftinyhumansai/openhuman#8369.