Summary
A full-workspace correctness/design review plus the open items from the 2026-06 security audit surfaced a set of bugs and hardening gaps across the WebSocket RPC stack, the service macros, the auth/identity crates, and the example templates. This issue tracks fixing all of them.
Correctness bugs (WebSocket RPC)
Security / authorization
Design / maintainability
Tooling
Acceptance
All items fixed with regression tests; cargo test --workspace, cargo clippy --workspace --all-targets, and cargo audit green.
Summary
A full-workspace correctness/design review plus the open items from the 2026-06 security audit surfaced a set of bugs and hardening gaps across the WebSocket RPC stack, the service macros, the auth/identity crates, and the example templates. This issue tracks fixing all of them.
Correctness bugs (WebSocket RPC)
connect()busy-wait + hang — spins a hot loop waiting forConnectionEstablishedwith no sleep/timeout; hangs forever if the server never sends it.stateis also set toConnectedbefore the handshake completes.call()doesn't remove its pending entry on timeout, so aftermax_pending_requeststimeouts every future call fails permanently with "Too many pending requests"..awaitin broadcast paths — a slow consumer with a full bounded channel blocks the send while holding the shard lock, deadlocking other map access (incl. the consumer's ownremove_connection); fan-out is also sequential.remove_connectionraces — leave zombie ids in the topic index or drop freshly-added subscribers.-32700.Security / authorization
handle_subscribesubscribes to any attacker-supplied topic.require_authdefaults tofalsefor WS services (audit MED-1).get_fileprefix-matches ids, no object-ownership check on download, reflected attacker-controlled Content-Type.InMemoryStateStoreand the session store grow without bound; cleanup only runs opportunistically. No WS connection cap.Design / maintainability
WITH_PERMISSIONS([])as deny-all vs authenticated-only elsewhere).StartFlowreturns its success value insideErr(ProviderError)— callers must parse JSON out of an error.cfg!(feature = ...)resolves against the macro crate, not the consumer — workspace feature unification forces client/server codegen into unrelated consumers (root cause of an earlier build break).Tooling
cargo auditwas not installed / not run.Acceptance
All items fixed with regression tests;
cargo test --workspace,cargo clippy --workspace --all-targets, andcargo auditgreen.