feat(secrets-ui): add/rotate/delete modal + audited gated reveal
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
using System.Collections.Concurrent;
|
||||
using ZB.MOM.WW.Audit;
|
||||
|
||||
namespace ZB.MOM.WW.Secrets.Ui.Tests.Fakes;
|
||||
|
||||
/// <summary>
|
||||
/// An <see cref="IAuditWriter"/> test double that collects every <see cref="AuditEvent"/> written,
|
||||
/// so a test can assert on the audit trail (action, outcome, target, actor) and — critically — that
|
||||
/// no plaintext ever appears in any audit field.
|
||||
/// </summary>
|
||||
public sealed class CapturingAuditWriter : IAuditWriter
|
||||
{
|
||||
private readonly ConcurrentQueue<AuditEvent> _events = new();
|
||||
|
||||
/// <summary>The events captured so far, in write order.</summary>
|
||||
public IReadOnlyList<AuditEvent> Events => _events.ToArray();
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task WriteAsync(AuditEvent evt, CancellationToken ct = default)
|
||||
{
|
||||
_events.Enqueue(evt);
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user