Repository navigation
feat: keyring instance --container (#51) - #54
Conversation
…ck, never forward the caller proof (#51) For an instance in a container that only its supervisor reaches (a Cloudflare Container behind the person's Durable Object). Set only by the flag (policy.Config.ContainerMode is json:"-"), never by a file; keyring serve never uses it. In container mode listeners may be wildcard (no two on one port), allow_sources and consent api_allow_sources must be empty and are not checked, and X-Keyring-Caller is never forwarded upstream.
Decision: Findings
Tests Run
Raw runtime output was retained in local Gitmoot state and is not posted here. |
Closes #51. Part of #46 (B1: Cloudflare Containers). Stacked on #53 (base
feat/instance-mode); I will retarget it tomainafter #53 merges. Assignment: keyring seat brief 2026-10-14.What
keyring instance --container(off by default) is for an instance in a container that only its supervisor can reach (the person's Durable Object):sameSocket). The proxy and consent listeners still cannot use the admin port.allow_sourcesandconsent.api_allow_sourcesmust be empty, and no source address is checked: every request arrives through the supervisor, so a source address proves nothing. The supervisor is the network boundary and checks the router proof and admin token (B1: only the Phobos server may call a person's keyring #52).X-Keyring-Caller(policy.CallerHeader) is never forwarded upstream in container mode, as a second layer behind the Worker removing it. phobos-dev found that file mode forwards it (msg 313705).policy.Config.ContainerModeisjson:"-": no rules or access file can turn it on.keyring servenever sets it.Unchanged
File mode: a wildcard
listenis still refused,allow_sourcesis still required and checked, and headers are forwarded as before. The admin API without--containeris still loopback only.listenAddrandsourcesForkeep the old checks whenContainerModeis false, with the same error texts apart from wording.Tests
go test ./... -race(Go 1.24.13): all ok.TestContainerMode(policy: JSON cannot set it; wildcard refused without the mode and allowed with it; sources must be empty and are not checked; consent port collisions with wildcards; consent wildcards still refused outside the mode),TestContainerModeNeverForwardsTheCallerProof(server),TestContainerOption(instance: wildcard admin refused without the flag; proxy on the admin port refused across addresses; sources refused; proxied call works).test-check prove: inconclusive (new API). 10 hand mutants, all red: wildcard always allowed, sources kept in container mode, source check in container mode, consent source check in container mode,sameSocketignoring wildcards, JSON can set the mode, caller header forwarded, wildcard admin without the flag, admin-port check by exact address only, instance ignoring the flag.--container,--admin-listen 0.0.0.0:…refused; with it, created over the host's non-loopback IP 10.4.0.1, and proxy health 200 on that IP.