Repository navigation
Conversation
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.
user_idfrom the request body, so a trigger request can run as (and write into) any existing user #8204Problem:
/apps/{app}/trigger/pubsuband/apps/{app}/trigger/eventarcturned the request'ssubscriptionorsourcefield into the run'suser_id. A caller could set that field to an existing user id such asalice, and the run would read and write alice'suser:state, artifacts, and memory.Solution:
Trigger runs now always use a dedicated
trigger--<trigger>--<metadata>user namespace. Both endpoints share the same helper, including Eventarc'sce-sourceheader path. The request and response contracts are unchanged; the request body simply can no longer name an interactive user.Testing Plan
Unit Tests:
pytest tests/unittests/cli/test_trigger_routes.py tests/unittests/cli/test_trigger_auth.py -q->113 passed.The new tests cover Pub/Sub
subscription: "alice", Eventarcsource: "alice", and Eventarcce-source: alice. In each case the agent'suser:notewrite lands in the trigger namespace while alice's existinguser:secretstate is unchanged. Existing valid subscription/source tests still pass with the new namespaced ids.Manual End-to-End (E2E) Tests:
Offline reproduction with
get_fast_api_app, a model-free agent that writesuser:note, and an accept-any-bearer-token verifier:user_id='alice', readalice-secret-4711, and wroteuser:noteinto alice's state.user_id='trigger--pubsub--alice', read no user secret, and alice's state stayed{'secret': 'alice-secret-4711'}.Checklist
Additional context
ruff,isort,pyink, andmypyall pass on the modified files.