From 2d75cc80b2608ca4604cee54bb8ae4c5cfe956c8 Mon Sep 17 00:00:00 2001 From: "paseo-bot[bot]" <266920839+paseo-bot[bot]@users.noreply.github.com> Date: Sun, 1 Nov 2026 18:34:57 +0000 Subject: [PATCH] test(server): cover routed permissions in one host journey (#8486) Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com> --- .../server/connected-hosts/hosts.e2e.test.ts | 36 ++++++------------- 1 file changed, 10 insertions(+), 26 deletions(-) diff --git a/packages/server/src/server/connected-hosts/hosts.e2e.test.ts b/packages/server/src/server/connected-hosts/hosts.e2e.test.ts index 264589f82e..ec47461386 100644 --- a/packages/server/src/server/connected-hosts/hosts.e2e.test.ts +++ b/packages/server/src/server/connected-hosts/hosts.e2e.test.ts @@ -183,7 +183,7 @@ test("ordinary routed APIs isolate scopes and enforce one-hop, disable and origi await paseo.dispose(); }); -test("routed authority is bounded by the caller, with isolated simultaneous sessions", async () => { +test("routed authority isolates simultaneous sessions and preserves ordinary permission RPC errors", async () => { const b = await daemon(); const a = await daemon(); const owner = await api(a); @@ -210,33 +210,16 @@ test("routed authority is bounded by the caller, with isolated simultaneous sess code: "permission_denied", }); expect((await owner.paseo.hosts.list()).hosts).toHaveLength(1); - await remote.dispose(); -}); - -test("SDK host clients preserve ordinary permission RPC errors", async () => { - const b = await daemon(); - const a = await daemon(); - const owner = await api(a); - await owner.paseo.hosts.add({ connection: `127.0.0.1:${b.port}` }); - const serverId = (await online(owner.paseo)).hosts[0]!.serverId!; - const clients = [a, b].map((host) => - createHostClient(`127.0.0.1:${host.port}`, { - clientId: crypto.randomUUID(), - sessionPermissions: ["daemon.read", "workspace.read"], - reconnect: { enabled: false }, - }), - ); - for (const client of clients) { - cleanup.push(() => client.close()); - await client.connect(); - } - const origin = createPaseoApi(clients[0]!); - const direct = createPaseoApi(clients[1]!); - const remote = await origin.hosts.client(serverId); + const directClient = createHostClient(`127.0.0.1:${b.port}`, { + clientId: crypto.randomUUID(), + sessionPermissions: ["daemon.read", "workspace.read"], + reconnect: { enabled: false }, + }); + await directClient.connect(); + const direct = createPaseoApi(directClient); cleanup.push(async () => { - await remote.dispose(); await direct.dispose(); - await origin.dispose(); + await directClient.close(); }); const input = { source: { kind: "directory" as const, path: b.staticDir } }; const directError = (await direct.workspaces.create(input).catch((error: unknown) => error)) as { @@ -247,6 +230,7 @@ test("SDK host clients preserve ordinary permission RPC errors", async () => { }; expect(directError.code).toBe("access_denied"); expect(remoteError.code).toBe(directError.code); + await remote.dispose(); }); test("distinct origin sessions cannot collide through a caller-selected route scope, including terminal binary output", async () => {