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§
- Audit
LogBuffer Config - Product-neutral audit buffering configuration.
- Audit
Writer - 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.