fix: forward the caller identity when creating an instance - #43
Merged
Conversation
Adding an agent class to a thread creates an instance for it, and Agents checks that the caller can initiate that class. Threads called CreateInstance with no identity metadata at all, so Agents refused with "identity not available" and class-on-add failed outright -- the path the whole agent instance feature depends on. The identity is forwarded rather than the call being made as Threads: the instance is created on behalf of whoever is adding the agent, so the check stays on that principal instead of moving to a peer service.
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.
Adding an agent class to a thread creates an instance for it, and Agents checks that the caller can initiate that class. Threads called
CreateInstancewith no identity metadata at all, so Agents refused:Class-on-add is the path the whole agent instance feature depends on, so it failed outright. Found running the go-core suite against the local VM —
TestWorkloadStartsOnUnackedMessage.The identity is forwarded rather than the call being made as Threads: the instance is created on behalf of whoever is adding the agent, so the check stays on that principal instead of moving to a peer service.
identityClientContextalready existed for exactly this and three other call sites use it.