guard/Cargo.toml
loki5512344 e456cb583f
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.
2026-11-16 12:36:29 +01:00

82 lines
2.6 KiB
TOML

[package]
name = "rampart"
version = "0.3.0-dev"
edition = "2024"
license = "GPL-3.0-only"
authors = ["loki"]
description = "Universal L3/L4/L7 network protection platform"
[[bin]]
name = "rampart"
path = "src/bin/rampart.rs"
[[bin]]
name = "rampart-manager"
path = "src/bin/rampart-manager.rs"
[[bin]]
name = "rampart-cli"
path = "src/bin/rampart-cli.rs"
[lints.clippy]
# Deny — критически важные для безопасности и стабильности
type_complexity = "allow"
unwrap_used = "deny"
panic = "deny"
dbg_macro = "deny"
print_stdout = "deny"
print_stderr = "deny"
wildcard_imports = "deny"
exit = "deny"
# expect разрешён — используется в prometheus метриках при старте
# cast разрешён — неизбежен в сетевых протоколах
[features]
default = ["store-redis"]
store-redis = ["dep:redis"]
geoip = ["dep:maxminddb"]
xdp = ["dep:libbpf-rs", "dep:libc"]
io-uring = ["dep:tokio-splice"]
# HTTP/1.1 protocol handler: парсинг request-head, verdict Allow/Reject,
# туннелирование на upstream (см. src/protocol/http/ и [protocol.http] в конфиге).
protocol-http = []
protocol-minecraft = []
[dependencies]
tokio = { version = "1", features = ["full"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["json", "env-filter"] }
thiserror = "2"
anyhow = "1"
dashmap = "6"
hex = "0.4"
sha2 = "0.11"
subtle = "2"
socket2 = { version = "0.6", features = ["all"] }
futures = "0.3"
reqwest = { version = "0.13", default-features = false, features = ["json", "query", "rustls"] }
prometheus = { version = "0.14", features = ["process"] }
toml = "1.1"
rand = { version = "0.10", default-features = false, features = ["std", "std_rng", "thread_rng"] }
clap = { version = "4", features = ["derive"] }
chrono = { version = "0.4", features = ["serde"] }
# TUI (rampart-tui): лёгкие deps, без feature-gate
ratatui = "0.30"
crossterm = "0.29"
axum = "0.8"
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"] }
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"] }