Class RouteAdminAuditService
Persistent admin audit sink: hands each event to the direct://tsak-audit route,
which writes it into tsak_audit_log.
Fire-and-forget by design. Events go through a bounded in-memory queue drained by a
background pump, so an API call never waits for the database and a broken audit backend can
never take the node down. The trade-off is explicit: on a hard kill the queued tail is lost,
and under a sustained flood the oldest queued events are dropped (with a warning) rather
than growing memory without bound.
Until is called — and permanently when Tsak runs without a database —
events fall through to the fallback the constructor takes, the log sink.
public sealed class RouteAdminAuditService : IAdminAuditService, IAsyncDisposable
Inheritance
Implements
Properties
IsPersisting
True once a route context is attached and events are being persisted.
public bool IsPersisting { get; }
Methods
Attach(IRouteContext)
Binds the sink to the route context that hosts the audit writer route. Called by
public void Attach(IRouteContext context)
DisposeAsync()
Performs application-defined tasks associated with freeing, releasing, or
public ValueTask DisposeAsync()
RecordAsync(AdminAuditEvent, CancellationToken)
public Task RecordAsync(AdminAuditEvent @event, CancellationToken ct)