Repository navigation
refactor(server): map an open's session_closed in identityBrokerFailure - #2652
Merged
Merged
Conversation
Move the session_closed -> bearer_rejected mapping from the two OpenSession call sites into identityBrokerFailure, where an open's other reasons are mapped. The tokenless guard still turns it into ErrInternal; extend its test to session_closed. Co-authored-by: Mecatl <[email protected]>
jhrozek
approved these changes
Nov 2, 2026
ChrisJBurns
deleted the
refactor/identitybroker-session-closed-mapping
branch
November 2, 2026 20:40
Merged
2 tasks
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.
Follow-up to #2648, from review.
Summary
identityBrokerFailurealready maps an open's broker reason to the client error, so thesession_closed→bearer_rejectedmapping from #2648 moves there as one morecall == "open"case. The per-call-siteclosed := …capture and override go away inopenIdentityBrokerSessionOnceandpreOpenIdentityBrokerSession, so the next path that opens a broker session gets the outcome without repeating it.Behaviour is unchanged:
preOpenIdentityBrokerSessionalways presents a token, and the existing guard inopenIdentityBrokerSessionOncestill turns a tagged refusal of a tokenless open intoErrInternal. That guard now carries the tokenlesssession_closedcase, soTestIdentityBrokerRefusalAfterAResponseIsNotTaggedruns forsession_closedas well astoken_used.Testing
go test -race ./internal/adapter/server -run IdentityBrokerand./cmd/mecak8s -run TestIdentityBrokerAgainstOfflineHarnesspass.TestIdentityBrokerRefusalAfterAResponseIsNotTagged.task lint: root module clean.API compatibility
No change: a refactor with identical client-visible outcomes.