Files
foxhunt/web-gateway/src/lib.rs
jgrusewski 2ebacae0e0 safety(web-gateway): add per-route-group rate limiting middleware
Token-bucket rate limiter (no new dependencies) with three tiers:
- Auth routes: 10 req/min, burst 5 (brute-force protection)
- Trading/read routes: 200 req/min, burst 20
- Compute routes (backtest/training/tune): 30 req/min, burst 5

Includes background cleanup task for stale entries and 7 unit tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 09:13:19 +01:00

49 lines
960 B
Rust

#![deny(
clippy::unwrap_used,
clippy::expect_used,
clippy::panic,
clippy::indexing_slicing
)]
#![allow(clippy::module_name_repetitions)]
pub mod auth;
pub mod config;
pub mod error;
pub mod grpc;
pub mod rate_limit;
pub mod routes;
pub mod state;
pub mod ws;
pub mod proto {
pub mod trading {
#![allow(
clippy::all,
clippy::pedantic,
clippy::restriction,
clippy::nursery
)]
tonic::include_proto!("foxhunt.tli");
}
pub mod ml_training {
#![allow(
clippy::all,
clippy::pedantic,
clippy::restriction,
clippy::nursery
)]
tonic::include_proto!("ml_training");
}
pub mod health {
#![allow(
clippy::all,
clippy::pedantic,
clippy::restriction,
clippy::nursery
)]
tonic::include_proto!("grpc.health.v1");
}
}