namespace ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; /// /// Resolves the Actor for an audit row from the current authenticated /// principal (Phase 3 of the audit re-architecture). User-facing emit sites /// (the inbound API middleware on a cookie/LDAP-authenticated request) read /// so the canonical AuditEvent.Actor records /// the real authenticated user, rather than a generic system/identity fallback. /// /// /// The seam is deliberately ASP.NET-free (a plain string?) so it can /// live in Commons and be consumed by any project without pulling an HTTP /// dependency. The HTTP-backed implementation /// (ZB.MOM.WW.ScadaBridge.Security.HttpAuditActorAccessor) reads the /// authenticated principal off IHttpContextAccessor.HttpContext?.User. /// This seam is for the authenticated, interactive actor only. /// System-originated emitters (script/notification/db-outbound) keep their own /// system actor/fallback and do NOT consult this accessor — there is no /// interactive principal to read in those flows. /// public interface IAuditActorAccessor { /// /// The actor string for the currently authenticated principal, or /// null when there is no authenticated interactive user (no ambient /// request, or an unauthenticated / auth-failure request). A null result /// signals the caller to fall back to its existing actor (API-key name, /// "system", etc.) — an unauthenticated principal is never echoed back. /// string? CurrentActor { get; } }