Started milestone 2
This commit is contained in:
@@ -7,8 +7,8 @@
|
||||
- [x] Create crates: `cargo new --lib core_protocol`, `cargo new --bin server_node`, `cargo new --bin client_node`.
|
||||
- [x] Add strict lints (`#![forbid(unsafe_code)]`, etc.) to the root workspace or individual `lib.rs`/`main.rs` files.
|
||||
- [x] **Dependencies (`core_protocol`):** Add `serde`, `bincode`, `uuid`, `chrono`, `thiserror`, `secrecy` (for zeroing sensitive keys).
|
||||
- [x] **Dependencies (`server_node`):** Add `tokio` (full), `tracing`, `tracing-subscriber`, `anyhow`, `dashmap`.
|
||||
- [x] **Dependencies (`client_node`):** Add `tokio` (rt-multi-thread), `tracing`, `tracing-subscriber`, `anyhow`.
|
||||
- [x] **Dependencies (`server_node`):** Add `tokio` (full), `tracing`, `tracing-subscriber`, `anyhow`, `dashmap`, `tokio-util`, `tokio-serde`, `futures`.
|
||||
- [x] **Dependencies (`client_node`):** Add `tokio` (rt-multi-thread), `tracing`, `tracing-subscriber`, `anyhow`, `tokio-util`, `tokio-serde`, `futures`.
|
||||
|
||||
### 2. Protocol Definitions (`core_protocol`)
|
||||
- [x] Create `src/tcp_events.rs`. Define `enum TcpEvent { AuthRequest { username: String, ... }, AuthResponse { session_token: u32, ... }, ChannelJoin { ... }, ChatMessage { ... } }` with `#[derive(Serialize, Deserialize)]`.
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
### 4. Login Logic & State
|
||||
- [x] **Server State:** Create `server_node/src/state.rs`. Define a `DashMap<u32, UserState>` to store active session tokens.
|
||||
- [x] **Authentication Flow:** Client sends `TcpEvent::AuthRequest`. Server generates a random `u32` session token, stores it in `DashMap`, and returns `TcpEvent::AuthResponse`.
|
||||
- [x] **Authentication Flow:** Client sends `TcpEvent::AuthRequest`. Server generates a sequential `u32` session token (via `AtomicU32`), stores it in `DashMap`, and returns `TcpEvent::AuthResponse`.
|
||||
- [x] **Validation:** Ensure the server actively drops the connection if the client sends invalid or excessively large payloads.
|
||||
|
||||
### 5. Observability (Logging)
|
||||
|
||||
Reference in New Issue
Block a user