Desk: UnixSocketDeskDoor, the production IDeskDoor over Huginn's desk socket
One connection per call, one request frame, one reply frame, 1 s deadline, 65536-byte bound each way. Request frames reproduce Huginn's golden bytes; replies are decoded by key and every failure is one DeskDoorException (503). Adds the MessagePack package for the wire codec. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
a42efc27f2
commit
3c387db58a
9 changed files with 1113 additions and 4 deletions
|
|
@ -26,9 +26,13 @@ public sealed class DeskWebApplicationFactory : TestWebApplicationFactory
|
|||
|
||||
private readonly Dictionary<string, string?>? configuration;
|
||||
private readonly bool registerPorts;
|
||||
private readonly bool fakeDoor;
|
||||
|
||||
public DeskWebApplicationFactory(Dictionary<string, string?>? configuration = null, bool configured = true, bool registerPorts = true)
|
||||
// fakeDoor false leaves the door to the app's own wiring (UnixSocketDeskDoor), for tests that stand a socket up.
|
||||
public DeskWebApplicationFactory(
|
||||
Dictionary<string, string?>? configuration = null, bool configured = true, bool registerPorts = true, bool fakeDoor = true)
|
||||
{
|
||||
this.fakeDoor = fakeDoor;
|
||||
this.configuration = configured ? configuration ?? DefaultConfiguration() : null;
|
||||
this.registerPorts = registerPorts;
|
||||
}
|
||||
|
|
@ -88,7 +92,10 @@ public sealed class DeskWebApplicationFactory : TestWebApplicationFactory
|
|||
builder.ConfigureServices(services =>
|
||||
{
|
||||
services.AddSingleton<IDeskCredential>(Credential);
|
||||
services.AddSingleton<IDeskDoor>(Door);
|
||||
if (fakeDoor)
|
||||
{
|
||||
services.AddSingleton<IDeskDoor>(Door);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue