Versions 301 to 302
new file, 71 lines
1+// abso login --web: a staging website session handed to a browser as a one-use link, with no secret printed.
2+
9+
13+
14+test("the website is the staging one beside the server, or --site; prod has none, since agents never sign in there", () => {
17+ assert.throws(() => siteFor("https://api.abso.dev"), /for staging.*never sign in to the website on prod/);
18+ assert.equal(siteFor("https://api.abso.dev", "http://localhost:8871/x"), "http://localhost:8871");
21+
22+test("the credential goes in Authorization only, and the answer is the one link and who it signs in as", async () => {
25+ seen.push({ url, authorization: new Headers(init.headers).get("authorization"), body: init.body ?? null });
35+ assert.deepEqual(seen, [{ url: `${SITE}/login/handoff`, authorization: `Bearer ${BOX}`, body: null }]);
42+
43+test("a refusal says why without the credential; an answer that isn't the site's own link is refused", async () => {
45+ Response.json({ error: `that key was refused: ${BOX}` }, { status: 401 })) as unknown as typeof fetch;
51+ const off = (async () => Response.json({ error: "not found" }, { status: 404 })) as unknown as typeof fetch;
61+
- MCP
- compare on this site's /mcp
- CLI
- abso diff 301 302 client/test/web-session.test.ts --json
- JSON
- /christopher/abso-core/compare/301..302?file=client%2Ftest%2Fweb-session.test.ts&format=json