rouse-context/relay
Jason Monk f28cacfdba Fix FCM wake after relay restart: use mTLS as sole WebSocket auth
The InMemoryFirestore loses all device records on relay restart,
causing WebSocket connections to be rejected with 403 and FCM wake
to fail (no token to send to). This fixes both problems:

1. Remove Firestore gate from WebSocket auth -- the mTLS client cert
   signed by our relay CA is sufficient proof of registration
2. Auto-create a Firestore record when a device connects via mTLS
   WebSocket and no record exists (covers post-restart case)
3. Accept FCM token via WebSocket text control message
   ({"type":"fcm_token","token":"..."}) so the device can re-register
   its token on reconnect, enabling FCM wake for future clients
4. Remove hardcoded seed devices (test-device, main-board) -- no
   longer needed since devices self-register on connect

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 17:21:55 -04:00
..
src Fix FCM wake after relay restart: use mTLS as sole WebSocket auth 2026-04-06 17:21:55 -04:00
tests Fix FCM wake after relay restart: use mTLS as sole WebSocket auth 2026-04-06 17:21:55 -04:00
Cargo.lock Two-cert mTLS: relay CA client cert + ACME server cert from device's own key 2026-04-06 12:37:46 -04:00
Cargo.toml Two-cert mTLS: relay CA client cert + ACME server cert from device's own key 2026-04-06 12:37:46 -04:00
relay.example.toml Fix ACME DNS-01 challenge failure: verify TXT propagation before validation 2026-04-05 20:30:55 -04:00