Repository navigation
feat(whoami): user_id for agents enrolled through a Control principal - #42
Conversation
GET /v1/whoami now returns user_id for device- and launch-enrolled agents: the relay-control user their credential introspected as at registration, already persisted as the agent's key id (device:<userId> / launch:<userId>, ids no policy key may use). Key-enrolled agents omit it. Self only, and kept off the provenance card stamped on forwarded messages. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 55 minutes. View limit details
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
# Conflicts: # test/control.test.ts
What
GET /v1/whoaminow includesuser_idfor agents enrolled with a relay-control credential:sh_at_): the user the device token introspected assh_lt_): the launching person (the launch credential'ssub){"agent_id": "ag_...", "name": "<name>", "gid": 11, "groups": [], "group_names": ["local"], "guest": false, "user_id": "<control user id>", "relaygate": {"agent": "<name>", "groups": ["local"]}}How
No schema change: the introspected user id is already persisted with the registration as the agent's key id (
device:<userId>/launch:<userId>), which policy validation reserves (no enrollment key may usedevice:*/launch:*), and only the same person can recover the name.controlUserId(agent)reads it back. Self only (whoami answers for the caller's token), and kept off therelaygateprovenance card that is stamped on forwarded messages.Why
relay-control verifies gate-only desktop identities via
/v1/whoamiand will enforcewhoami.user_id == caller user idonce present, closing an ownership gap.Tests
test/control.test.ts"GET /v1/whoami: the Control user behind the caller": device-enrolled includes user_id; launched includes the launching person's id (also after token refresh); key-enrolled omits it; two callers each see only their own; a file-backed store survives a restart with user_id intact and no re-introspection.npm run typecheckandnpm test(158) pass.Docs:
docs/contract.mdnew "Who am I" subsection. README doesn't document whoami.🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Summary by cubic
GET /v1/whoaminow includesuser_idfor agents enrolled with a relay-control credential, closing an ownership gap so relay-control can enforcewhoami.user_id == caller user id.sh_at_) agents report the user their token introspected as; launched (sh_lt_) agents report the launching person's id, unchanged after token refresh.user_id, and it never appears on therelaygateprovenance card.Written for commit 1fe3651. Summary will update on new commits.