Expand description
Audit logging and compliance for Armature
This crate provides comprehensive audit logging for security, compliance, and operational tracking.
§Features
- Audit Events - Structured
AuditEventlogging with status/severity - Request/Response Logging -
AuditMiddlewarelogs HTTP payloads and records the caller’s real principal from the bearer token’s subject claim - Data Masking - PII/sensitive data masking via
mask_json,mask_string, andmask_value - Retention Policies -
RetentionManagerdeletes logs past their age - Backends -
FileBackend(JSON-lines file),MemoryBackend,StdoutBackend, andMultiBackendfan-out
Events serialize to JSON; there is no bundled database or query backend.
§Quick Start
use armature_audit::*;
// Create audit logger
let audit = AuditLogger::builder()
.backend(FileBackend::new("audit.log"))
.build();
// Log an event
audit.log(AuditEvent::new("user.login")
.user("alice")
.resource("system")
.action("authenticate")
.status(AuditStatus::Success)).await?;Re-exports§
pub use backend::*;pub use event::*;pub use logger::*;pub use masking::*;pub use middleware::*;pub use retention::*;