Versions 2 to 318
new file, 346 lines
3+// - no Authorization header and no cookie go out, with a token in the environment and a box sign-in
10+
25+
30+
31+/** Every command a visitor folder refuses. A new command fails the allow-list test until it's here or a read. */
93+
107+
108+const json = (res: import("node:http").ServerResponse, status: number, body: unknown, headers = {}) =>
109+ res.writeHead(status, { "content-type": "application/json", ...headers }).end(JSON.stringify(body));
110+
130+ { error: `too many signed-out reads from this address: 120 a minute; sign in, or try again ${ESC}[2Jlater` },
149+
150+/** Runs the client as its own process, in `cwd`, with `home` as its home and only the environment given. */
172+
183+
185+ it("join --reader, signed out, to a public project writes only its config, from the command line", async () => {
197+
198+ it("sends no Authorization and no cookie, with a token set and a box sign-in present, and follows no redirect", async () => {
225+
226+ it("asks fetch to follow no redirect and sends no credential, join's public check too (a fetch spy)", async () => {
236+ const out = await main(["status"], { cwd: root, env: { ABSO_TOKEN: TOKEN }, write: () => {} });
250+
251+ it("join answers a private project, a members-only one and a missing one alike, by the code alone", async () => {
255+ runs.push({ root, ...(await client(root, temp("home"), ["join", project, "--reader", "--server", url])) });
265+
266+ it("every request its Api makes goes through one send: reads only, no redirect, no sign-in", async () => {
274+ const visitor = new Api({ server: url, project: "abso-core", agent: "", visitor: true, token: TOKEN });
276+ await assert.rejects(visitor.send(`${url}/p/abso-core/a/x/run`, { method: "POST" }), /sends only reads/);
288+
289+ it("runs only its reads: every other command is refused before any call, and a new command fails here", async () => {
315+ assert.match(out.stderr, /This folder reads abso-core signed out\. To work on it: abso login/, argv.join(" "));
322+
334+
- MCP
- compare on this site's /mcp
- CLI
- abso diff 2 318 client/test/visitor.test.ts --json
- JSON
- /christopher/abso-core/compare/2..318?file=client%2Ftest%2Fvisitor.test.ts&format=json