fix(auth): address Task 13 deployment review findings
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user