Versions 116 to 318
new file, 171 lines
1+// abso init and join sign in with the box sign-in, and use this machine's ~/.abso/token only with --token-file. A
2+// project is never made or joined with a shared credential that happened to be in a file, and both say what they sign
3+// in with. The client runs as its own process with its own home, so nothing on this machine is read.
4+
17+
22+// Stands in for a server that takes box sign-ins: it notes each request, then answers 500 so the run stops there.
32+
47+
66+
87+
93+
95+
97+ it("the token file only with --token-file, never into a folder with a key; ABSO_TOKEN as given", () => {
102+ assert.equal(tokenCredential(none, {}, server, temp(), file), undefined, "a token file alone is not used");
107+ assert.throws(() => tokenCredential(asked, {}, server, temp(), () => undefined), /this machine has none/);
112+ assert.equal(tokenCredential(none, { ABSO_TOKEN: "env-token" }, server, temp(), file)?.words, "ABSO_TOKEN");
114+
115+ it("init with a token file and a box sign-in, no flag: signs in with the box, and says so", async () => {
116+ const run = await client(home(boxesUrl), folder(), "init", "--project", "made", "--server", boxesUrl);
128+
129+ it("init with only a token file, no flag: refused before anything is made, naming --token-file", async () => {
130+ const run = await client(home(), folder(), "init", "--project", "unasked", "--agent", "me", "--server", fake.url);
132+ assert.match(run.stderr, /abso login signs it in\. ~\/\.abso\/token is used only with --token-file\./);
133+ const status = await fetch(`${fake.url}/p/unasked/status`, { headers: { authorization: `Bearer ${TOKEN}` } });
136+
152+ assert.match(made.stderr, /Signing in with the token file, ~\/\.abso\/token, as --token-file asks\./);
154+ const unasked = await client(homeDir, temp(), "join", "asked", "--agent", "other", "--server", fake.url);
- MCP
- compare on this site's /mcp
- CLI
- abso diff 116 318 client/test/init-credential.test.ts --json
- JSON
- /christopher/abso-core/compare/116..318?file=client%2Ftest%2Finit-credential.test.ts&format=json