feat: Add IP-based rate limiting to charging engine with configurable RPS and burst size

- Add rate_limit module to lib.rs exports
- Add create_rate_limiter function with SmartIpKeyExtractor for IP-based limiting
- Add RATE_LIMIT_RPS environment variable with 10 requests/second default
- Add RATE_LIMIT_BURST environment variable with 20 burst size default
- Add RateLimitResponse struct with TOO_MANY_REQUESTS status code
- Add GovernorLayer with per_second quota and burst_size configuration to router
This commit is contained in:
nutcas3
2026-04-25 06:01:42 +03:00
parent ce560c0dc4
commit 0bb8571b02
3 changed files with 55 additions and 0 deletions
+1
View File
@@ -3,6 +3,7 @@ pub mod charging;
pub mod circuit_breaker;
pub mod errors;
pub mod handlers;
pub mod rate_limit;
pub mod routes;
pub mod models;
pub mod monitoring;