mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 10:59:59 +00:00
Twenty-five specs called the Playwright APIs with default or hardcoded timeouts. Routed over Tor those budgets are too small, so a spec fails on transport latency rather than on the behaviour it asserts. Route the waits through resolveTimeout and reach pages via gotoOnion, the helpers the tor branch introduced for exactly this. The remaining changes in the diff are import wrapping around those calls. The repository lint enforces this: a raw numeric timeout in a role spec is rejected with a pointer to resolveTimeout, which is how a hardcoded 500ms wait added during this session was caught. Merge work rather than authored here; not deployed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
28 lines
1016 B
JavaScript
28 lines
1016 B
JavaScript
const { test, expect } = require("@playwright/test");
|
|
const { resolveTimeout } = require("./timeouts");
|
|
|
|
const { skipUnlessServiceEnabled } = require("./service-gating");
|
|
|
|
exports.register = function (shared) {
|
|
test("mcp: the gateway holding the MCP credentials refuses an unauthenticated caller", async ({ request }) => {
|
|
skipUnlessServiceEnabled("mcp");
|
|
|
|
const anonymous = await request.post(`${shared.env.baseUrl.replace(/\/+$/, "")}/api/agent`, {
|
|
failOnStatusCode: false,
|
|
maxRedirects: 0,
|
|
headers: { "Content-Type": "application/json" },
|
|
data: { prompt: "list your configured mcp servers" },
|
|
timeout: resolveTimeout(30_000),
|
|
});
|
|
expect(
|
|
anonymous.status(),
|
|
"an unauthenticated agent call must be redirected or refused; the gateway holds one bearer per MCP server",
|
|
).toBeGreaterThanOrEqual(300);
|
|
|
|
expect(
|
|
await anonymous.text(),
|
|
"a refused request must not leak the configured MCP servers",
|
|
).not.toContain("jsonrpc");
|
|
});
|
|
};
|