| Crates.io | armature-audit |
| lib.rs | armature-audit |
| version | 0.1.1 |
| created_at | 2025-12-26 20:42:16.599279+00 |
| updated_at | 2025-12-29 00:25:49.935776+00 |
| description | Audit logging and compliance for Armature |
| homepage | https://pegasusheavy.github.io/armature |
| repository | https://github.com/pegasusheavy/armature |
| max_upload_size | |
| id | 2006224 |
| size | 106,199 |
Audit logging and compliance for the Armature framework.
[dependencies]
armature-audit = "0.1"
use armature_audit::{AuditLog, AuditEntry};
let audit = AuditLog::new()
.sink(DatabaseSink::new(pool))
.sink(FileSink::new("/var/log/audit.log"));
// Log an action
audit.log(AuditEntry {
actor: "user123",
action: "user.update",
resource: "user/456",
changes: json!({
"before": {"email": "old@example.com"},
"after": {"email": "new@example.com"}
}),
}).await?;
let app = Application::new()
.with_middleware(AuditMiddleware::new(audit))
.put("/users/:id", update_user);
let logs = audit.query()
.actor("user123")
.action("user.*")
.since(Utc::now() - Duration::days(30))
.execute()
.await?;
MIT OR Apache-2.0