fix(secrets-ui): preserve metadata on rotate + audit unexpected mutation/reveal failures

This commit is contained in:
Joseph Doherty
2026-07-15 17:31:34 -04:00
parent 0ab276dac0
commit 294f53b49a
8 changed files with 306 additions and 37 deletions
@@ -3,15 +3,17 @@ namespace ZB.MOM.WW.Secrets.Abstractions;
/// <summary>
/// Resolves the current principal (the ZB.MOM.WW.Auth identity) for audit attribution when a
/// secret is resolved. A consumer wires this to whatever surfaces the ambient caller — an HTTP
/// context accessor, an actor context, a CLI identity, etc. A <c>null</c> <see cref="CurrentActor"/>
/// (or no accessor at all) is treated as the <c>"system"</c> actor by the resolver, so keyless /
/// background resolutions are still attributed rather than left blank.
/// context accessor, an actor context, a CLI identity, etc. When <see cref="CurrentActor"/> is
/// <c>null</c> (or no accessor is registered), the fallback actor string is consumer-defined so an
/// action is still attributed rather than left blank — e.g. <c>"system"</c> for background/keyless
/// resolution, or <c>"unknown"</c> for an unauthenticated UI action (the value the UI's
/// <c>SecretActorResolver</c> uses).
/// </summary>
public interface ISecretActorAccessor
{
/// <summary>
/// The current principal to record as the audit <c>Actor</c>, or <c>null</c> when no
/// principal is available (treated as <c>"system"</c>).
/// principal is available (the resolver then substitutes its consumer-defined fallback actor).
/// </summary>
string? CurrentActor { get; }
}