Expand description
Shared audit runtime integration for Aster services.
Product crates own audit actions, detail schemas, authorization rules,
operator-facing presentation. Forge owns the runtime lifecycle contract shared
by Aster products: record a best-effort server shutdown audit event, then flush
the audit manager before database handles close. With the db-writer feature,
Forge also owns the shared buffered database writer used by Aster products.
Products that also use a mail outbox can enable the mail-outbox-dependency
feature to make the standard audit constructors depend on the mail outbox drain
component.
Structs§
- Audit
LogBuffer Config - Buffering policy for
AuditLogManager. - Audit
LogManager - Best-effort buffered writer for Forge audit-log rows.
Constants§
- AUDIT_
LOGS_ COMPONENT - Stable component name used for process lifecycle audit records.
- AUDIT_
MANAGER_ COMPONENT - Stable component name used for the buffered audit manager.
- AUDIT_
MANAGER_ FLUSH_ SHUTDOWN_ PHASE - Stable shutdown phase name for flushing the buffered audit manager.
- DEFAULT_
AUDIT_ LOG_ BATCH_ SIZE - Default number of audit records that triggers an immediate batch flush.
- DEFAULT_
AUDIT_ LOG_ DELAYED_ FLUSH_ AFTER - Default delay before a partial audit batch is flushed.
- DEFAULT_
AUDIT_ LOG_ QUEUE_ CAPACITY - Default number of audit records retained in memory before direct-write fallback.
- SERVER_
SHUTDOWN_ AUDIT_ PHASE - Stable shutdown phase name for recording the process shutdown event.
- SERVER_
START_ AUDIT_ PHASE - Stable startup phase name for recording the process start event.
Functions§
- audit_
component - Creates the full audit lifecycle component bundle used by product entrypoints.
- audit_
component_ after - Creates the full audit lifecycle component bundle with caller-provided shutdown dependencies for the server-shutdown audit phase.
- audit_
component_ after_ infallible - Creates the full audit lifecycle component with caller-provided shutdown dependencies for hooks that cannot fail.
- audit_
component_ infallible - Creates the full audit lifecycle component for hooks that cannot fail.
- audit_
manager_ component - Creates the audit-manager flush component.
- flush_
global_ audit_ log_ manager - Flushes the process-global audit manager when initialized.
- global_
audit_ log_ manager - Returns the process-global audit manager when initialized.
- init_
global_ audit_ log_ manager - Initializes the process-global audit manager.
- record_
audit_ log - Records through the global manager, or writes directly through
fallback_dbbefore startup. - server_
shutdown_ audit_ component - Creates the server-shutdown audit component with the crate’s default dependencies.
- server_
shutdown_ audit_ component_ after - Creates the server-shutdown audit component with caller-provided dependencies.
- server_
start_ audit_ component - Creates the server-start audit startup component.
- shutdown_
audit_ component - Creates the audit shutdown component bundle without the server-start phase.
- shutdown_
audit_ component_ after - Creates the audit shutdown component bundle with caller-provided dependencies for the server-shutdown audit phase.
- shutdown_
global_ audit_ log_ manager - Cancels delayed writes and flushes the process-global audit manager when initialized.
- write_
audit_ log_ direct - Writes one audit record directly, logging persistence failures as best-effort warnings.