feat/event-store #4
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/event-store"
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?
Server scaffolding for the SPA's Desktop / Terminal / Files panels (the agent dialer + protocol layers ship in a follow-up). meshrelay.rs: route now mounted at `/meshrelay.ashx` (and the per-domain `/:domain/meshrelay.ashx`); the previous file was unreferenced. Rendezvous keys on `?id=<rand>` (the per-tunnel nonce the SPA mints in `agent-redir-ws-0.1.1.js::Start`) instead of the auth token, so the matching browser+agent halves can find each other regardless of identity. Browser side authenticates with `?auth=<authCookie>`; agent side with `?rauth=<authRelayCookie>`. Optional `?nodeid=<id>` must match the cookie's `n` field when set, pinning a relay token to a single device. AppState gains a separate `mesh_relays: RelayRegistry` so the namespace doesn't collide with the existing HTTP `web_relays`. cookie_auth.rs: `mint_cookie(key, user_id, action, ttl, node_scope)` helper plus `action::{LOGIN=1, RELAY=4}` tags. Encodes the legacy `{u, a, n?, exp}` payload, returns base64-url. None when the server has no cookie key configured. lib.rs default.handlebars context: now injects `authCookie` (action=LOGIN) and `authRelayCookie` (action=RELAY) at root render time so the SPA's `var authCookie / authRelayCookie` reads pick them up. 24h TTL, both per-user, no node scope; the SPA's `authcookie` renew action will plug in once that handler lands. user_session.rs `ControlIn::Msg`: adds optional `usage: u32` (the SPA's protocol bitmap on `type=tunnel`: 1=Terminal, 2=Desktop, 4=Files, 5=FileTransfer). Threaded through `MsgExtras` and `msg_to_agent` so the agent receives it on the eventual `msg/tunnel` envelope. Tests: 2 new meshrelay (rendezvous-by-id pumps bytes, node-scoped cookie round trip). All 325 lib tests pass. Status: tunnel rendezvous + auth scaffolding live; SPA can now mint identities and reach the relay endpoint. Agent-side `msg/tunnel` handler + outbound dialer + per-protocol layers still pending. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>