devel #23
Loading…
Reference in a new issue
No description provided.
Delete branch "devel"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Piece 3 (computer) made the canonical fake realtime server TLS-only: FakeServer.__init__ now requires an ssl.SSLContext, so the esp32 host conformance fixture failed at setup ("FakeServer.__init__() missing 1 required positional argument: 'ssl_context'") for all six conformance tests. Pair the server with a throwaway self-signed leaf and dial wss://. - host/tests/tls_certs.py: mint a two-day self-signed leaf with openssl and build the paired server/client contexts. Self-contained: this is the esp32-side copy of computer/tests/tls_certs.py, never a cross-repo import. - fake_server_fixture.py: session-scoped throwaway cert, pass ssl_context= to FakeServer, expose a client context that trusts it. - conftest.py: ws_url is now wss://; re-export the cert fixture. - test_conformance.py: use the asyncio client, not websockets.sync.client. Over this TLS harness the sync client intermittently (~5%) never receives the opening handshake response and dies with "timed out while waiting for handshake response" after the full open_timeout, while the asyncio client is clean over the same connections (180+ verified). It is also the pattern computer's own conformance suite uses. - requirements.txt: websockets>=13 -- the harness imports websockets.asyncio, which 12.0 does not provide. - docs/conformance.md: say the harness is TLS-only. Verified: host suite 158 passed across 8 consecutive full runs (was 152 passed + 6 errors before this change) and 30/30 conformance-only runs.# feat(trust): generate a `roster` leaf in the dev trust set ## What this is Part of the fleet **app-tier TLS** change (design and plan in the `starfleet` docs repo: `2026-10-17-app-tier-tls-design.md` / `…-plan.md`). `roster` joins `crew` as a TLS-required service, so it needs its own leaf from the fleet CA — identical in shape to the existing `computer` and `crew` leaves. This is the trust-material prerequisite; the `roster` transport change is a sibling branch. ## Change - `tools/starfleet_trust.py`: `DEV_FILES` gains `roster.pem` / `roster.key`, `PRIVATE_KEY_FILES` gains `roster.key`, and `LEAVES` gains `("roster", "starfleet-roster")`. `generate()` already iterates `LEAVES`, so emitting the files needs nothing further. - `host/tests/test_starfleet_trust.py`: the pinned `DEV_FILES` assertion was extended, a new test asserts the roster membership, and the two tests that had hardcoded leaf and key lists now **iterate** `st.LEAVES` and `st.PRIVATE_KEY_FILES` — so the roster leaf is covered by the verify-chain and the 0600-permission assertions, and the next leaf addition needs no test edit. ## Verification ```bash cd $HOME/dev/starfleet/communicator-esp32 python3 -m pytest host/tests/ -q ``` **81 passed** for the trust suites; the change touches only `tools/starfleet_trust.py` and its test. A full `host/tests/` run needs `websockets` and `numpy`, which the sandbox python lacks — run the full suite where those are installed (CI). A manual check confirmed `roster.pem` is signed by the CA, carries `CN=starfleet-roster`, and its key is mode 0600. ## Note for the operator Adding entries to `DEV_FILES` makes any existing shared `.dev-trust/` incomplete — a partial set is deliberately never "dev" — so the next `ensure()` regenerates it with a **new CA**, which means a flashed dev device must be reflashed. The design's "a new leaf does not re-key the CA" is not true in practice; this is recorded in the app-tier TLS runbook. ## Deferred - The repo's trust docs do not enumerate the dev-set files, so there is nothing to update there (verified by grep). Co-authored-by: Troed Sångberg <github@troed.se> Reviewed-on: #22