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
@@ -210,6 +210,26 @@ public sealed class GalaxyDriverAlarmSourceTests
ack.Calls[0].AlarmRef.ShouldBe("Tank01.Level.HiHi");
}
/// <summary>
/// Verifies that AcknowledgeAsync forwards the request's authenticated principal
/// (<see cref="AlarmAcknowledgeRequest.OperatorUser"/>) to the acknowledger so the
/// gateway records WHO acked, rather than the generic empty-string fallback.
/// </summary>
[Fact]
public async Task AcknowledgeAsync_forwards_OperatorUser()
{
var feed = new FakeAlarmFeed();
var ack = new RecordingAcknowledger();
using var driver = NewDriver(feed, ack);
await driver.AcknowledgeAsync(
[new AlarmAcknowledgeRequest("src", "Obj.Alarm", "cmt", "alice")],
CancellationToken.None);
ack.Calls.ShouldHaveSingleItem();
ack.Calls[0].Operator.ShouldBe("alice");
}
/// <summary>Verifies that AcknowledgeAsync throws NotSupportedException without an acknowledger.</summary>
[Fact]
public async Task AcknowledgeAsync_throws_NotSupported_without_acknowledger()