You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
B1: only the Phobos server may call a person's keyring #52
Part of #46. Owner decision 2026-10-14 (via Jarvis, recorded on #46): per-person keyrings run on Cloudflare Containers (B1): keyring's Go binary unchanged, one container per person, controlled by one Durable Object (DO) per person. File mode for the owner's Mac stays the default and unchanged; everything here is opt-in. No Cloudflare account changes or spending without the owner's approval.
Depends on #45 (instance mode: encrypted state, admin API).
Problem
On the Mac, a role token works only from allow_sources. At Cloudflare, a leaked role token would work from anywhere on the internet.
Change
Callers must prove they are the Phobos router, not only hold a role token: Cloudflare Access service token checked by the Worker, or a second secret held by the router (never by the sandbox), checked by the Worker or DO before forwarding and/or by the keyring in container mode.
The sandbox's agent never holds this secret; the router adds it when forwarding the agent's call.
Decide where the check lives (Worker, DO or keyring) and test the refusal path.
Acceptance
A request with a valid role token but without the router proof is refused before it reaches the API (test).
The router proof never appears in the audit log or upstream requests.
Agreed with phobos-dev (gitmoot messages 313693, 313705, 313709): the caller proof is one X-Keyring-Caller: <secret> per Phobos server. The Worker checks it in constant time before the DO is touched and removes it before forwarding. phobos-dev found that file-mode keyring forwards unknown headers upstream (main f2ff6fc), so as a second layer the keyring in container mode never forwards X-Keyring-Caller upstream. File mode does not change.
Done in #57 (merged 88777f2): the Worker checks X-Keyring-Caller in constant time before any Durable Object is touched and removes it; the DO and the keyring in container mode (#54) also never forward it.
Activity
jerryfane commentedon Oct 14, 2026
Agreed with phobos-dev (gitmoot messages 313693, 313705, 313709): the caller proof is one
X-Keyring-Caller: <secret>per Phobos server. The Worker checks it in constant time before the DO is touched and removes it before forwarding. phobos-dev found that file-mode keyring forwards unknown headers upstream (main f2ff6fc), so as a second layer the keyring in container mode never forwardsX-Keyring-Callerupstream. File mode does not change.Merge pull request #57 from gitmoot/feat/cloudflare-template
jerryfane commentedon Oct 14, 2026
Done in #57 (merged 88777f2): the Worker checks X-Keyring-Caller in constant time before any Durable Object is touched and removes it; the DO and the keyring in container mode (#54) also never forward it.