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
bf7dcfe235
commit
6dca0fa7d4
9 changed files with 1112 additions and 4 deletions
|
|
@ -29,6 +29,7 @@ public sealed class DeskWebApplicationFactory : TestWebApplicationFactory
|
|||
private readonly Dictionary<string, string?>? configuration;
|
||||
private readonly bool registerPorts;
|
||||
private readonly bool realCredential;
|
||||
private readonly bool fakeDoor;
|
||||
|
||||
// A configured desk needs Bifrost:Oidc (its credential validates against the local issuer): generated keys per factory.
|
||||
private readonly OidcTestKit oidcKit = new();
|
||||
|
|
@ -36,9 +37,12 @@ public sealed class DeskWebApplicationFactory : TestWebApplicationFactory
|
|||
// The chat client's secret, for a test that holds the chat client's own token.
|
||||
public string OidcSecret => oidcKit.ClientSecret;
|
||||
|
||||
public DeskWebApplicationFactory(Dictionary<string, string?>? configuration = null, bool configured = true, bool registerPorts = true, bool realCredential = false)
|
||||
// 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 realCredential = false, bool fakeDoor = true)
|
||||
{
|
||||
this.realCredential = realCredential;
|
||||
this.fakeDoor = fakeDoor;
|
||||
this.configuration = configured ? configuration ?? DefaultConfiguration() : null;
|
||||
this.registerPorts = registerPorts;
|
||||
}
|
||||
|
|
@ -141,7 +145,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