fix(auth): address Task 13 deployment review findings

This commit is contained in:
2026-08-17 21:31:25 +02:00
parent 9558eaa508
commit 7e52df2702
22 changed files with 1279 additions and 82 deletions
+23
View File
@@ -93,6 +93,29 @@ function bridgeForChild(child: FakeBridgeChild, pathStyle: "windows" | "posix" =
}
describe("Windows auth-storage bridge", () => {
test("uses a dedicated native storage executable without replacing the harness tht", async () => {
vi.stubEnv("THT_BIN", "/opt/venv/bin/tht");
vi.stubEnv("THT_AUTH_STORAGE_BIN", "/usr/local/bin/tht-auth-storage");
const calls: Array<{ executable: string }> = [];
const bridge = createPosixAuthStorageBridge({
invoke: async (call) => {
calls.push(call);
return {
code: 0,
stdout: Buffer.from('{"version":1,"ok":true,"prepared":true}\n'),
stderr: Buffer.alloc(0),
};
},
});
await bridge.ensureLayout("/data/auth");
expect(calls).toHaveLength(1);
expect(calls[0]!.executable).toBe("/usr/local/bin/tht-auth-storage");
expect(process.env.THT_BIN).toBe("/opt/venv/bin/tht");
vi.unstubAllEnvs();
});
test("uses the same bounded hidden bridge to ensure a POSIX session layout", async () => {
const calls: Array<{ executable: string; args: readonly string[]; input: Buffer; timeoutMs: number }> = [];
const bridge = createPosixAuthStorageBridge({