Skip to main content

Crate hyperlane_plugin_audit

Crate hyperlane_plugin_audit 

Source
Expand description

hyperlane-plugin-audit

Tamper-evident SHA-256 hash-chained security audit trail plugin for Hyperlane with bounded ring-buffer storage, pluggable AuditSink hooks, header redaction, and cryptographic chain verification.

Structs§

AuditConfig
Configuration for AuditPlugin.
AuditPlugin
Compiled tamper-evident audit engine backing AuditRequestHook and AuditResponseHook.
AuditRecord
Single tamper-evident hash-chained HTTP audit event.
AuditRequestHook
Opt-in request middleware capturing entry timestamps for audited requests.
AuditResponseHook
Opt-in response middleware emitting hash-chained AuditRecord events to the configured sink.
InMemoryAuditSink
Bounded in-memory ring-buffer AuditSink suitable for testing and recent audit queries.

Constants§

ANONYMOUS_ACTOR
Fallback actor string when no actor attribute was set on Context.
ATTR_AUDIT_ACTION
Context attribute key storing optional custom action label attached by handlers.
ATTR_AUDIT_ACTOR
Context attribute key storing optional actor/subject identity attached by handlers or auth middleware.
ATTR_AUDIT_START
Context attribute key storing request entry timestamp for audit latency measurement.
AUDIT_GENESIS_HASH
Genesis chain hash preceding the first audit event (64 zero hex digits).
DEFAULT_AUDIT_CAPACITY
Default maximum records retained by [InMemoryAuditSink].
DEFAULT_REQUEST_ID_HEADER
Default header name checked for request correlation IDs.
REDACTED_VALUE
Placeholder emitted when a sensitive header value is redacted.

Traits§

AuditSink
Pluggable sink receiving tamper-evident AuditRecord events.

Functions§

compute_record_hash
Computes the canonical hash-chain digest for an AuditRecord given its fields.
set_audit_action
Attaches a semantic action name (for example "billing.refund") to ctx.
set_audit_actor
Attaches an authenticated actor identifier to ctx for audit trail attribution.
verify_audit_chain
Verifies cryptographic hash-chain integrity across an ordered slice of AuditRecords.