Repository navigation
refactor(rpc): delete the SSH-bridge caller scope - #27440
Conversation
Nothing mints an SSH-bridge credential since the relay client was removed (#27214), so the 'ssh-bridge' caller kind, its host binders, result filter, the CLI bridge-mode policy and the ORCA_SSH_BRIDGE_CREDENTIAL env read could never run. The allowRemoteCliControl target field stays for older peers.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to No actionable regression was established in the supported SSH or CLI paths. The PR is mergeable after normal checks. Pre-merge checks |
|
ELI5
When Orca still had its own relay on SSH hosts, the
orcacommand run on such a host was handed a special limited key so it could only touch that host's own terminals. The relay is gone, so nobody hands out that key anymore. This PR deletes the lock that checked it, and the client code that looked for it.What Changed
--host runtime:CLIs) goes through exactly the same permission checks as before.ssh-bridge, produced only when a request carried a credential fromsshBridgeCredentials.mint. That function has had no caller since refactor(ssh): connect fails for hosts orcad can't serve; remove the relay client path #27214 deleted the relay client (git log -S sshBridgeCredentials.mint: added in e3639ef, last caller removed in ff27338). So the lookup always missed, the per-call host binding always returned "unbound", and the result filter was always the identity. Removed:rpc/ssh-bridge-{credentials,host-binding,orchestration-binding}.ts, thessh-bridgerow inrpc-caller-scope.ts, and the binding/filter step in the admission prologue and both dispatchers;runtime-rpc-request-admission.ts(an unknown token is "Invalid auth token", as it already was in practice);cli/ssh-bridge-command-policy.tsand its three call sites,shared/ssh-bridge-credential-env.ts, and its read incli/runtime/transport.ts;rpc-caller-scope,ssh-target-managementanddispatcher-transport-paritytests (the one-shot-streaming refusal test now pins a paired caller instead).allowRemoteCliControlSSH target field (older peers still send it), and the unrelated persistedssh_bridgeautomation owner value.Net: production +13 / −519, tests +4 / −761.
Why
Every RPC change had to reason about a caller kind that never occurs. Deleting it is the first step before folding the two dispatchers into one (next PR). Alternative considered: keep the scope in case the relay returns. Rejected: the credential was minted and checked inside the same desktop process, so no older or newer peer depends on it, and a future host-scoped CLI would go through orcad, not this table.
Mixed versions / security: no wire format changes. The only observable difference is if someone manually exports
ORCA_SSH_BRIDGE_CREDENTIALon the owner's machine: the CLI used to send it and get "Invalid auth token"; now it ignores it and uses the owner token from the 0o600 metadata file, which that same user can already read. No privilege change.Linked Issue
Phase 3.99 cleanup, item 0.8 (maintainer, no issue).
Visual Proof
N/A — no UI or behaviour change; dead code removal.
Testing
Dead-code proof:
rgoversrc,config,mobile,tests(including the@ts-nocheckfiles) for every removed symbol (sshBridgeCredentials,SSH_BRIDGE_*,SshBridge*,readSshBridgeCredential,ORCA_SSH_BRIDGE_CREDENTIAL,kind: 'ssh-bridge', the deleted module paths): no remaining references.pnpm build:cli,pnpm build:electron-vite,pnpm build:orcadall pass; no removed symbol inout/.Checks:
pnpm tc;pnpm test src/main/runtime/rpc src/cli src/main/runtime/runtime-rpc(516 files, 5376 tests pass);pnpm lint(all ratchets pass);pnpm run check:code-quality:changed(0 new findings).Review
Self review + independent reviewer, P0/P1 only.
Agent skill upstream boundary
Notes
Security: owner, mobile (incl. delegated) and runtime-paired rows unchanged. SSH: no SSH host ever reached this path after the relay removal. Cross-platform: no platform code touched. Mobile: unchanged.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)