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 stop/join the caller-owned audit writer 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
Product-neutral audit buffering configuration.
AuditWriter
Caller-owned audit writer. Construction starts no workers, timers, or database operations.

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.
AUDIT_WRITER_START_PHASE
Explicit writer startup phase, before product lifecycle audit hooks.
DEFAULT_AUDIT_LOG_BATCH_SIZE
Default immediate-flush threshold.
DEFAULT_AUDIT_LOG_DELAYED_FLUSH_AFTER
Default partial-batch delay.
DEFAULT_AUDIT_LOG_QUEUE_CAPACITY
Default queue capacity; an additional single overflow record can be pending.
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_component_with_writer
Composes owned writer startup, product lifecycle hooks, and mandatory shutdown drain.
audit_component_with_writer_after
Owned audit bundle with explicit producer dependencies, for example a follower with tasks but no mail outbox. Writer startup still precedes product hooks; stop follows every declared producer. Use this rather than registering placeholder components to satisfy default edges.
audit_manager_component
Creates the audit-manager flush component.
audit_writer_component
Registers explicit writer startup and drain/stop on the existing audit graph.
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.