20 lines
707 B
C#
20 lines
707 B
C#
namespace w4c_workflows.Services.Audit;
|
|
|
|
/// <summary>
|
|
/// Destination for the action audit trail. Implementations must be
|
|
/// best-effort: a sink failure (transport, auth, index error) must be logged and
|
|
/// swallowed, never propagated, so audit never fails a workflow run.
|
|
/// </summary>
|
|
public interface IActionAuditSink
|
|
{
|
|
Task RecordAsync(ActionAuditEntry entry, CancellationToken ct);
|
|
}
|
|
|
|
/// <summary>Default sink: drops entries. Used when auditing is disabled.</summary>
|
|
public sealed class NullActionAuditSink : IActionAuditSink
|
|
{
|
|
public static readonly NullActionAuditSink Instance = new();
|
|
|
|
public Task RecordAsync(ActionAuditEntry entry, CancellationToken ct) => Task.CompletedTask;
|
|
}
|