feat(xdp): auto-ban from ringbuf events; fix feature gating, exit path, pow flake
Some checks are pending
CI / Rust — check & clippy (push) Waiting to run
CI / Rust — test (push) Waiting to run
CI / Repo — module size & default secrets (push) Waiting to run
CI / Rust — cargo-deny (push) Waiting to run
CI / Docker — build edge image (push) Blocked by required conditions

- xdp: real 24-byte xdp_event parsing (fixes LE byte-swap of src IP),
  opt-in [xdp] auto_ban (RATE_LIMIT always, CONN_DROP at fails>=threshold;
  EVENT_BAN/POLICY_DROP excluded by design), rampart_xdp_autobans_total;
  wired in app before load(); 10 tests in tests/xdp_events.rs
- build: --no-default-features compiles — redis paths cfg-gated behind
  store-redis, manager fail-fasts without it; CI gates the config now
- app: RunExit enum replaces process::exit in lib; single exit site in main
- tests: seed PoW roundtrip token (was ~1/16 flaky; 50 pre-fix fails -> 0)
- docs: TODO statuses refreshed (round 2)
This commit is contained in:
Loki 2026-09-16 00:49:41 +02:00
parent aa615a1141
commit bd40a44980
Signed by: boba
GPG key ID: 253067914055423B
23 changed files with 714 additions and 50 deletions

View file

@ -31,6 +31,18 @@ impl Challenge {
}
}
/// Challenge с явным токеном — для детерминированных тестов, где
/// случайный дайджест даёт flaky-исход.
#[must_use]
pub fn with_token(token: [u8; 32], difficulty: u8) -> Self {
Self {
token,
created_at: Instant::now(),
difficulty,
used: false,
}
}
#[must_use]
pub fn is_expired(&self) -> bool {
self.created_at.elapsed().as_secs() >= CHALLENGE_TTL_SECS