refactor: extract auth handshake from crdt_sync/server.rs into handshake.rs

The 1680-line server.rs is split:

- handshake.rs: perform_auth_handshake helper + close_with_auth_failed + auth tests
  + start_auth_listener / close_listener_auth_failed test helpers + AuthListenerResult enum
- server.rs: crdt_sync_handler (now invokes perform_auth_handshake) + wait_for_sync_text
  + broadcast/e2e/keepalive tests

Auth handshake (Steps 1-3 of the WebSocket handshake) is a self-contained sequence
that takes &mut SplitSink + &mut SplitStream and returns Option<AuthMessage>. The
caller observes None to mean the connection has already been closed with the
appropriate close code.

No behaviour change. All 63 crdt_sync tests pass; full suite green.
This commit is contained in:
dave
2026-04-26 21:49:46 +00:00
parent db00a5d4b5
commit 0e09a1ed4b
3 changed files with 548 additions and 504 deletions
+1
View File
@@ -61,6 +61,7 @@ pub const PONG_TIMEOUT_SECS: u64 = 60;
mod auth;
mod client;
mod dispatch;
mod handshake;
mod server;
mod wire;