Repository navigation
fix(identitybroker): refuse registration under another owner - #2449
Merged
Merged
Conversation
RegisterAgent accepted a request naming one owner's broker session with a different owner. One session tree has one owner, so refuse a mismatch with PERMISSION_DENIED, the code the design's failure matrix gives registration under a different owner. Document the rule on Service, enforce it in the stand-in, and add a contract case so real implementations are held to it. The host session is not compared: a child agent registers with its own host session while sharing its parent's broker session. Checking that it belongs to the session's tree will be addressed later. Co-authored-by: Mecatl <[email protected]>
jhrozek
approved these changes
Oct 21, 2026
This was referenced Oct 21, 2026
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.
Summary
RegisterAgentnow refuses a registration whose owner differs from the broker session's owner, withPERMISSION_DENIED. One session tree has one owner, so a mismatch is a pairing bug. Raised in review of #2443.identitybroker.Service, enforced by the stand-in, and covered by a contract test, so a real implementation that skips it fails the suite. Before, the contract helpers always copied the session's own owner, so nothing caught a missing check.RegisterAgentRequest.HostSessionIDsays so; checking that it belongs to the session's tree will be addressed later.Issue relationship
Relates to #2446
Type of change
Test plan
Baseline checks
golangci-lintoninternal/identitybroker/..., 0 issues. Only this package changes.go test -race ./internal/identitybroker/...passes. No package outsideinternal/identitybrokerimports it.task test:race): not run; the change is confined to the package above.go run ./cmd/mecademo): not affected.task docs)task site:build)task api:check)task api:update+engine/CHANGELOG.mdAlso checked:
Changes
internal/identitybroker/service.goService; field docs onRegisterAgentRequest.HostSessionIDandOwnerinternal/identitybroker/standin/standin.goRegisterAgentcompares the request's owner with the session'sinternal/identitybroker/conformance/sessions.gointernal/identitybroker/standin/standin_test.goUser-facing change
None.
Special notes for reviewers
PERMISSION_DENIED.session_ownedis the reason for refusing a session open, so it is not reused here.API compatibility: no remote-observable change. The package is internal and not wired into any server.