Fix pre-existing and new clippy issues across 5 files: - service_auth.rs: .to_string() → .to_owned() on &str, backtick doc items - streams.rs: backtick doc items, allow cognitive_complexity on reconnect_loop - main.rs: .to_owned(), allow infinite_loop, drop must_use, rename shadow - start.rs: eliminate shadow_reuse on endpoint binding - enhanced_ml.rs: remove unnecessary f64 cast Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
web-gateway
REST and WebSocket gateway for the Foxhunt web dashboard. Axum 0.7.9 proxying HTTP to backend gRPC services.
Key Types
AppState— shared state (gRPC channels, WS broadcast, config)GatewayConfig— configuration loaded from environment variables
Modules
auth— JWT validation and login handlerroutes— Axum router and HTTP handlersgrpc— Tonic clients and gRPC stream bridgesws— WebSocket upgrade, topic subscriptions, keepaliverate_limit— per-IP token-bucket rate limiter (3 tiers)error— unified error types and HTTP error responses
Rate Limits
| Tier | Limit | Endpoints |
|---|---|---|
| Public | 10 req/min | POST /api/auth/login |
| Trading | 200 req/min | /api/trading/*, /api/risk/*, /api/ml/* |
| Compute | 30 req/min | /api/training/*, /api/backtest/*, /api/tune/* |
Security
- JWT (32-char min secret), CORS, 1MB body limit, HSTS
- WebSocket topic whitelist (8 topics), per-connection rate limit, max 20 subs
X-Request-Idpropagation