armature_audit/
lib.rs

1//! Audit logging and compliance for Armature
2//!
3//! This crate provides comprehensive audit logging for security, compliance,
4//! and operational tracking.
5//!
6//! # Features
7//!
8//! - **Audit Events** - Structured audit event logging
9//! - **Request/Response Logging** - HTTP payload logging
10//! - **Data Masking** - Automatic PII/sensitive data masking
11//! - **Retention Policies** - Automatic log cleanup
12//! - **Multiple Backends** - File, JSON, database storage
13//! - **Filtering** - Configurable event filtering
14//!
15//! # Quick Start
16//!
17//! ```no_run
18//! use armature_audit::*;
19//!
20//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
21//! // Create audit logger
22//! let audit = AuditLogger::builder()
23//!     .backend(FileBackend::new("audit.log"))
24//!     .build();
25//!
26//! // Log an event
27//! audit.log(AuditEvent::new("user.login")
28//!     .user("alice")
29//!     .resource("system")
30//!     .action("authenticate")
31//!     .status(AuditStatus::Success)).await?;
32//! # Ok(())
33//! # }
34//! ```
35
36pub mod backend;
37pub mod event;
38pub mod logger;
39pub mod masking;
40pub mod middleware;
41pub mod retention;
42
43pub use backend::*;
44pub use event::*;
45pub use logger::*;
46pub use masking::*;
47pub use middleware::*;
48pub use retention::*;
49
50#[cfg(test)]
51mod tests {
52    use super::*;
53
54    #[test]
55    fn test_module_exports() {
56        // Just ensure all exports are accessible
57        let _ = AuditEvent::new("test");
58    }
59}