feat(server): BLE 网关独立限流 — 每网关 60 req/60s
为 /health/gateway 路由添加 gateway_id 级别的速率限制, 网关认证(API Key)→ 限流检查 → handler 三层中间件。 Redis 不可达时同样遵循 fail_close 策略。
This commit is contained in:
@@ -750,6 +750,10 @@ async fn main() -> anyhow::Result<()> {
|
||||
.nest(
|
||||
"/health/gateway",
|
||||
erp_health::HealthModule::gateway_routes()
|
||||
.layer(axum::middleware::from_fn_with_state(
|
||||
state.clone(),
|
||||
middleware::rate_limit::rate_limit_by_gateway,
|
||||
))
|
||||
.layer(axum::middleware::from_fn_with_state(
|
||||
state.clone(),
|
||||
erp_health::gateway_auth::gateway_auth_middleware,
|
||||
|
||||
Reference in New Issue
Block a user