feat(alarms): AlarmAcknowledgeRequest carries OperatorUser; Galaxy/ScriptedAlarmSource honor it [H6b]

This commit is contained in:
Joseph Doherty
2026-06-15 14:11:40 -04:00
parent c236263e8d
commit ed941c51da
5 changed files with 65 additions and 7 deletions
@@ -68,11 +68,11 @@ public sealed class ScriptedAlarmSource : IAlarmSource, IDisposable
if (acknowledgements is null) throw new ArgumentNullException(nameof(acknowledgements));
foreach (var a in acknowledgements)
{
// The base interface doesn't carry a user identity — Stream G provides the
// authenticated principal at the OPC UA dispatch layer + proxies through
// the engine's richer AcknowledgeAsync. Here we default to "opcua-client"
// so callers using the raw IAlarmSource still produce an audit entry.
await _engine.AcknowledgeAsync(a.ConditionId, "opcua-client", a.Comment, cancellationToken)
// Honor the authenticated principal carried on the request when present
// (the OPC UA dispatch layer / Stream G threads it through). When absent —
// the raw/non-OPC-UA path — default to "opcua-client" so the ack still
// produces an audit entry.
await _engine.AcknowledgeAsync(a.ConditionId, a.OperatorUser ?? "opcua-client", a.Comment, cancellationToken)
.ConfigureAwait(false);
}
}