mirror of
https://github.com/storytold/cadcraft.git
synced 2026-12-01 18:25:32 -06:00
The MCP bridge (`Remote`) sent its requests to whatever accepted on the control port. It now opens each connection with a `hello` carrying a fresh nonce and no token; the app answers with HMAC-SHA-256 of the nonce keyed with the session token. Without a token for the port, or without a valid proof (checked again against the token file once, for a restarted app), the bridge sends nothing. The control server answers `hello` before the token check without counting it as authentication, and closes a connection that hasn't shown the token within 10 s of opening, however its bytes trickle in, so peers without the token can't hold every connection slot until the 10-minute idle timeout. The bridge replaces an unauthenticated connection close to that deadline before writing a request to it. Part of #1925.