Files
hyperframes/docs/packages
Michael Wang 2b1fe6f313 fix(producer): startServer never listens without a token (#8655)
* fix(producer): startServer never listens without a token

Any local account, container or sandboxed program can reach a loopback port, and with no token
set every route but /health accepted a header-less caller. When neither authToken nor
PRODUCER_AUTH_TOKEN is set, startServer now makes a random token for the run, writes it to a
file only the server's account can read (~/.hyperframes/producer/<port>.token by default, or
authTokenFile, or PRODUCER_AUTH_TOKEN_FILE), logs that path, and requires it like a configured
token. The file is removed on shutdown. createProducerApp and createRenderHandlers keep their
behavior, and their docs now say they check no caller without a token.

* refactor(producer): keep server.ts at its comment share

* test(producer): call the started server through node:http on localhost

The unit lane refuses fetch and every lookup but localhost, so the startServer tests listen on
localhost and send their requests with node:http to the address it bound.

* refactor(producer): keep server.ts at its comment share
2026-11-24 20:34:56 +00:00
..