Skip to main content

Crate aster_forge_audit

Crate aster_forge_audit 

Source
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§

AuditLogBufferConfig
Buffering policy for AuditLogManager.
AuditLogManager
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_db before 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.