lib.rs
36 lignes · 1512 octets
//! Real-time abuse detection and ban management for the Rustwarden //! ActivityPub federation layer (RFC 0028+). //! //! Mirrors the pattern of `gitrust-ssh-guard` adapted to ActivityPub //! semantics: domain- and actor-level events feed a sliding-window //! detector chain that may auto-ban abusive sources. Admin overrides //! and a manual allow/deny ACL sit on top, all backed by a hybrid //! in-memory plus Postgres store for hot-path checks at request time. //! //! # Architecture //! //! ```text //! incoming AP event ───► GuardEvent ───► sinks (tracing/file) //! └──► store.insert_event() //! └──► detectors (per-domain windows) //! └► BanManager::auto_ban() //! └► store.insert_ban() //! request hot path ──► BanManager::is_banned(domain) ──► allow / deny //! ``` pub mod ban; pub mod config; pub mod detector; pub mod events; pub mod observer; pub mod sinks; pub mod store; #[cfg(feature = "ui")] pub mod ui; pub use ban::{BanDecision, BanManager}; pub use config::{DetectorThreshold, GuardConfig, GuardConfigError}; pub use detector::{Detector, ThresholdDetector, default_detectors, run_all}; pub use events::{GuardEvent, GuardEventKind, GuardEventSink}; pub use observer::GuardObserver; pub use store::{AclEntry, AclKind, BanEntry, GuardStore, HybridStore, MemoryStore, PostgresStore};
GitRust