feat(manager): SCAN inventory, pagination, request limits, graceful shutdown
- Inventory nodes/servers use cursor SCAN plus MGET batches instead of KEYS and per-key GET; a Redis error returns 503 instead of an empty fleet. - GET /blacklist no longer writes: the legacy metadata backfill moved to a one-shot startup task. The list endpoint paginates (limit 100, max 1000, offset max 10000) instead of dumping SMEMBERS. - Router-wide DefaultBodyLimit 8 KiB and TimeoutLayer 10 s; every mutating endpoint is rate limited (30/min per client IP) with idle eviction, and the login limiter resets on success. reason > 256 bytes and malformed targets are rejected with 400. - SIGTERM/Ctrl-C trigger graceful shutdown; the heartbeat and eviction tasks are cancelled and joined so in-flight ban edits reach Redis. - MANAGER_TRUSTED_PROXIES enables X-Forwarded-For (right-to-left walk) only for configured proxy networks; otherwise the TCP peer is used. - tests/manager_api.rs covers 401/400/413/429/503 and CORS preflight through the real router; manager_security gains limiter and proxy-IP tests.
This commit is contained in:
parent
324ef12b27
commit
e456cb583f
21 changed files with 1377 additions and 180 deletions
|
|
@ -68,7 +68,7 @@ ratatui = "0.30"
|
|||
crossterm = "0.29"
|
||||
|
||||
axum = "0.8"
|
||||
tower-http = { version = "0.7", features = ["cors"] }
|
||||
tower-http = { version = "0.7", features = ["cors", "timeout"] }
|
||||
jsonwebtoken = { version = "11", features = ["aws_lc_rs"] }
|
||||
|
||||
redis = { version = "1.7", optional = true, features = ["tokio-comp", "connection-manager"] }
|
||||
|
|
@ -76,3 +76,7 @@ maxminddb = { version = "0.32", optional = true }
|
|||
tokio-splice = { version = "0.2", optional = true }
|
||||
libbpf-rs = { version = "0.27", optional = true }
|
||||
libc = { version = "0.2", optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
# `ServiceExt::oneshot` drives the axum router in integration tests.
|
||||
tower = { version = "0.5", features = ["util"] }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue