{"version":268,"agent":"readspeed","message":"abso init and join sign in with the box sign-in; ~/.abso/token only with --token-file\n\nBefore, abso init used ~/.abso/token whenever the file existed, ahead of the box sign-in. So a project could be made with whatever credential happened to be in that file, without the agent knowing. abso join with --agent fell back to the same file.\n\n- init signs in with the box sign-in when there is one. A token named in the environment (ABSO_TOKEN, or a pipeline run's ABSO_KEY_FILE) is used as given.\n- ~/.abso/token is used only with the new --token-file flag, on init and on join, and never by itself. Without the flag and with nothing else to sign in with, init refuses before it makes anything (\"~/.abso/token is used only with --token-file\"), and so does join's sign-in error.\n- --token-file is refused in a folder that already has a key.\n- Both say what they sign in with before they make or join anything: \"this box's sign-in, b_...\", \"a new key from this box's sign-in\", \"this folder's key\", \"ABSO_TOKEN\", or \"the token file, ~/.abso/token, as --token-file asks\".\n- config.ts: trustedToken and tokenFile are exported, and readConfig takes tokenFileOk (default true, so other commands are unchanged).\n\nTests: client/test/init-credential.test.ts (4). With a token file and a box sign-in, init sends only the box's credential. With only a token file, init is refused and no project is made. With --token-file, init and join use the file and say so. All client tests pass (440).\n\nCloses issue 25.","time":1792100173679,"timeIso":"2026-10-15T21:36:13.679Z","changes":5,"change":4066,"files":["client/src/config.ts","client/src/join-commands.ts","client/src/main.ts","client/test/init-credential.test.ts"],"draft":null,"diff":[{"path":"client/src/config.ts","added":26,"removed":5,"diff":"--- a/client/src/config.ts\n+++ b/client/src/config.ts\n@@ -48,7 +48,11 @@\n \t}\n }\n \n-export function readConfig(root: string, env: Readonly<Record<string, string | undefined>> = process.env): Config {\n+export function readConfig(\n+\troot: string,\n+\tenv: Readonly<Record<string, string | undefined>> = process.env,\n+\ttokenFileOk = true,\n+): Config {\n \tconst raw = JSON.parse(readFileSync(configPath(root), \"utf8\")) as Partial<Settings>;\n \tif (raw.visitor === true) {\n \t\tfor (const key of [\"server\", \"project\"] as const) {\n@@ -60,7 +64,7 @@\n \tfor (const key of [\"server\", \"project\", \"agent\"] as const) {\n \t\tif (typeof raw[key] !== \"string\" || raw[key] === \"\") throw new Error(`${configPath(root)} has no \"${key}\"`);\n \t}\n-\tconst token = tokenFor(raw.server!, env, root);\n+\tconst token = tokenFor(raw.server!, env, root, tokenFileOk);\n \treturn {\n \t\tserver: raw.server!,\n \t\tproject: raw.project!,\n@@ -178,6 +182,7 @@\n \tserver: string,\n \tenv: Readonly<Record<string, string | undefined>> = process.env,\n \troot?: string,\n+\ttokenFileOk = true,\n ): string | undefined {\n \tif (root) {\n \t\tconst key = readKeyFile(root);\n@@ -187,9 +192,20 @@\n \t\t\treturn key.key;\n \t\t}\n \t}\n-\tconst token = fromEnv(env, \"TOKEN\")?.trim() || runKey(env) || readToken(env);\n-\tconst trusted = trustedServers(env);\n-\tif (token === undefined || tokenGoesTo(server, trusted)) return token;\n+\treturn trustedToken(\n+\t\tserver,\n+\t\tenv,\n+\t\tfromEnv(env, \"TOKEN\")?.trim() || runKey(env) || (tokenFileOk ? readToken(env) : undefined),\n+\t);\n+}\n+\n+/** The token as given, if abso may send it to this server; refused, in words, if not. */\n+export function trustedToken(\n+\tserver: string,\n+\tenv: Readonly<Record<string, string | undefined>>,\n+\ttoken: string | undefined,\n+): string | undefined {\n+\tif (token === undefined || tokenGoesTo(server, trustedServers(env))) return token;\n \tthrow new UsageError(\n \t\t`this folder's server is ${server}, and abso sends your token only to ${[...TOKEN_SERVERS, \"this machine\"].join(\", \")}, and the servers ~/.abso/servers.json or ABSO_TRUSTED_SERVERS name. ` +\n \t\t\t`If ${server} is yours, name it in ~/.abso/servers.json or ABSO_TRUSTED_SERVERS (comma-separated); if you didn't set it, someone else wrote .abso/config.json.`,\n@@ -235,6 +251,11 @@\n \treturn key;\n }\n \n+/** This machine's token file (~/.abso/token, else ~/.avcs/token), or none. abso init and join read it only with --token-file. */\n+export function tokenFile(): string | undefined {\n+\treturn readToken({});\n+}\n+\n /** ABSO_TOKEN if set, else ~/.abso/token, else ~/.avcs/token, else none. */\n export function readToken(env: Readonly<Record<string, string | undefined>> = process.env): string | undefined {\n \tconst fromVar = fromEnv(env, \"TOKEN\");"},{"path":"client/src/join-commands.ts","added":76,"removed":8,"diff":"--- a/client/src/join-commands.ts\n+++ b/client/src/join-commands.ts\n@@ -19,7 +19,16 @@\n import { CLIENT_DIR } from \"./client-version.ts\";\n import { type Env, type Output, plural } from \"./command-env.ts\";\n import { leftOutText, syncFolder, uploadBlobs } from \"./commands.ts\";\n-import { findRoot, installKey, readConfig, type Settings, tokenFor, writeConfig } from \"./config.ts\";\n+import {\n+\tfindRoot,\n+\tinstallKey,\n+\treadConfig,\n+\trunKey,\n+\ttype Settings,\n+\ttokenFile,\n+\ttrustedToken,\n+\twriteConfig,\n+} from \"./config.ts\";\n import { elsewhereText } from \"./doctor.ts\";\n import { fromEnv } from \"./env-names.ts\";\n import { clearKnown, loadIgnore, readFolder, writeKnown } from \"./folder.ts\";\n@@ -59,6 +68,42 @@\n \treturn ['The project is empty. Put its files in this folder, then abso push -m \"why\" publishes them.'];\n }\n \n+/** A credential other than the box's, and how init and join name it when they say what they sign in with. */\n+export interface Credential {\n+\treadonly token: string | undefined;\n+\treadonly words: string;\n+}\n+\n+/**\n+ * What init and join sign in with when it isn't the box's sign-in. The machine's token file only with --token-file, and\n+ * never into a folder that already has a key; else a token the environment names (ABSO_TOKEN, or a pipeline run's\n+ * ABSO_KEY_FILE); else none. The token file is never read unasked, so a project is never made or joined with a shared\n+ * credential nobody chose.\n+ */\n+export function tokenCredential(\n+\targs: Parsed,\n+\tenv: Env[\"env\"],\n+\tserver: string,\n+\troot: string,\n+\tfile: () => string | undefined = tokenFile,\n+): Credential | undefined {\n+\tif (bool(args, \"token-file\")) {\n+\t\tif (existsSync(join(stateDir(root), \"key\")))\n+\t\t\tthrow new UsageError(`${root} already has a key, so it signs in with that: leave off --token-file`);\n+\t\tconst token = trustedToken(server, env, file());\n+\t\tif (!token) throw new UsageError(\"--token-file reads ~/.abso/token, and this machine has none\");\n+\t\treturn { token, words: \"the token file, ~/.abso/token, as --token-file asks\" };\n+\t}\n+\tconst named = fromEnv(env, \"TOKEN\")?.trim();\n+\tif (named) return { token: trustedToken(server, env, named), words: \"ABSO_TOKEN\" };\n+\tconst run = runKey(env);\n+\tif (run) return { token: trustedToken(server, env, run), words: \"a pipeline run's key (ABSO_KEY_FILE)\" };\n+\treturn undefined;\n+}\n+\n+/** Why a token file is no fallback: said when one is here and nothing else signs in. */\n+const TOKEN_FILE_ASKED = \"~/.abso/token is used only with --token-file.\";\n+\n export async function runInit(args: Parsed, env: Env): Promise<Output> {\n \tif (args.positionals.length > 1) throw new UsageError(\"init takes one folder\");\n \tconst root = resolve(env.cwd, args.positionals[0] ?? \".\");\n@@ -67,12 +112,21 @@\n \tconst project = str(args, \"project\");\n \tif (!project) throw new UsageError(\"give the project a name with --project <name>\");\n \tif (bool(args, \"public\") && bool(args, \"private\")) throw new UsageError(\"--public or --private, not both\");\n-\t// A box signed in here, and no token for this server: the project is made as the person who approved the box,\n-\t// the way the website makes one (abso 663).\n+\t// A box signed in here, and no other credential asked for: the project is made as the person who approved the box,\n+\t// the way the website makes one (abso 663). The token file only with --token-file, never by itself.\n \tconst server = serverFrom(args, env);\n \tconst box = readBox(server);\n-\tif (box && !tokenFor(server, env.env) && !fromEnv(env.env, \"KEY_FILE\"))\n+\tconst credential = tokenCredential(args, env.env, server, root);\n+\tconst say = env.writeErr ?? env.write;\n+\tif (box && credential === undefined) {\n+\t\tsay(`Signing in with this box's sign-in, ${box.id}.\n+`);\n \t\treturn initFromBox(args, env, root, project, server, box);\n+\t}\n+\tif (credential === undefined && tokenFile() !== undefined)\n+\t\tthrow new UsageError(\n+\t\t\t`abso init signs in with this box's sign-in, and this box isn't signed in to ${server}: abso login signs it in. ${TOKEN_FILE_ASKED}`,\n+\t\t);\n \tconst org = str(args, \"org\");\n \tif (org !== undefined) return initInOrg(org, server);\n \tconst config = makeSettings(args, env, project);\n@@ -83,7 +137,9 @@\n \t// What the server runs on each new version (#39), guessed from package.json; recorded with the rest.\n \tconst wroteProject = asIs ? \"exists\" : writeStartingProjectFile(root);\n \tconst { files, blobs, modes, leftOut } = readFolder(root, loadIgnore(root));\n-\tconst token = tokenFor(config.server, env.env);\n+\tconst token = credential?.token;\n+\tsay(`Signing in with ${credential?.words ?? `no credential: nothing here signs in to ${server}`}.\n+`);\n \tconst api = new Api({ ...config, ...(token ? { token } : {}) });\n \tawait uploadBlobs(api, blobs);\n \tconst answer = await api.init(\n@@ -309,11 +365,16 @@\n \tconst server = serverFrom(args, env);\n \tconst box = readBox(server);\n \tconst hasKey = existsSync(join(stateDir(root), \"key\"));\n+\tconst credential = tokenCredential(args, env.env, server, root);\n+\tconst tokenFileAsked = bool(args, \"token-file\");\n \tlet agent: string;\n \tlet minted: { key: string; id: string } | undefined;\n \tif (str(args, \"agent\") !== undefined) {\n \t\tagent = agentFrom(args);\n-\t\tminted = box && !hasKey && !fromEnv(env.env, \"KEY_FILE\") ? await mintKey(box, project, agent) : undefined;\n+\t\tminted =\n+\t\t\tbox && !hasKey && !fromEnv(env.env, \"KEY_FILE\") && !tokenFileAsked\n+\t\t\t\t? await mintKey(box, project, agent)\n+\t\t\t\t: undefined;\n \t} else if (fromEnv(env.env, \"KEY_FILE\")) {\n \t\t// A pipeline run's key (ABSO_KEY_FILE) belongs to one agent, which the runner names in ABSO_AGENT.\n \t\tconst named = fromEnv(env.env, \"AGENT\");\n@@ -337,7 +398,13 @@\n \twriteConfig(root, config);\n \tclearKnown(root);\n \tif (minted) installKey(root, JSON.stringify(minted));\n-\tconst settings = readConfig(root, env.env);\n+\t// The token file only with --token-file: readConfig reads it otherwise.\n+\tconst read = readConfig(root, env.env, false);\n+\tconst settings = tokenFileAsked ? { ...read, token: credential?.token } : read;\n+\t(env.writeErr ?? env.write)(\n+\t\t`Signing in with ${minted && box ? `a new key from this box's sign-in, ${box.id}` : hasKey ? \"this folder's key\" : (credential?.words ?? `no credential: nothing here signs in to ${server}`)}.\n+`,\n+\t);\n \tconst api = new Api(settings);\n \tlet synced: Awaited<ReturnType<typeof syncFolder>>;\n \ttry {\n@@ -348,7 +415,8 @@\n \t} catch (error) {\n \t\tif (!(error instanceof ApiError && error.status === 401 && !box && !settings.token)) throw error;\n \t\trmSync(stateDir(root), { recursive: true, force: true });\n-\t\tthrow new UsageError(await signedOut(config.server, project));\n+\t\tconst why = await signedOut(config.server, project);\n+\t\tthrow new UsageError(!tokenFileAsked && tokenFile() !== undefined ? `${why} ${TOKEN_FILE_ASKED}` : why);\n \t}\n \treturn {\n \t\ttext: ["},{"path":"client/src/main.ts","added":7,"removed":5,"diff":"--- a/client/src/main.ts\n+++ b/client/src/main.ts\n@@ -118,10 +118,12 @@\n \t\t\torg: \"string\",\n \t\t\tpublic: \"boolean\",\n \t\t\tprivate: \"boolean\",\n+\t\t\t\"token-file\": \"boolean\",\n \t\t},\n-\t\tusage: \"abso init [folder] --project <name> [--agent <name>] [--as-is] [--org <org>] [--public|--private]\",\n+\t\tusage:\n+\t\t\t\"abso init [folder] --project <name> [--agent <name>] [--as-is] [--org <org>] [--public|--private] [--token-file]\",\n \t\tabout:\n-\t\t\t\"Create a project on the server from a folder's text files The folder becomes that agent's folder. It writes a starting .absoignore, and, when the folder has no avcs.json and package.json gives a check or a build to guess, an avcs.json (setup, check, build and out): what the server's CI runs on each new version of shared. Without one, CI runs what it can guess itself, or nothing. --as-is writes neither: the folder goes up exactly as it is (an import). On a server this box is signed in to (abso login, approving all your projects), the project is made as you, the way the website's New project makes it: you own it, it's private unless you say --public, and the folder joins it at once with its own key (--agent names it; else the box's name). --org <org> makes it that organization's project. Elsewhere it needs --agent and the server's token.\",\n+\t\t\t\"Create a project on the server from a folder's text files The folder becomes that agent's folder. It writes a starting .absoignore, and, when the folder has no avcs.json and package.json gives a check or a build to guess, an avcs.json (setup, check, build and out): what the server's CI runs on each new version of shared. Without one, CI runs what it can guess itself, or nothing. --as-is writes neither: the folder goes up exactly as it is (an import). On a server this box is signed in to (abso login, approving all your projects), the project is made as you, the way the website's New project makes it: you own it, it's private unless you say --public, and the folder joins it at once with its own key (--agent names it; else the box's name). --org <org> makes it that organization's project. Elsewhere it needs --agent and a token: ABSO_TOKEN, or with --token-file this machine's ~/.abso/token, which is never used unasked. Before it makes anything, it says what it signs in with.\",\n \t\trun: (args, env) => runInit(args, env),\n \t},\n \tkey: {\n@@ -322,10 +324,10 @@\n \t\t},\n \t},\n \tjoin: {\n-\t\tflags: { server: \"string\", agent: \"string\", dir: \"string\", reader: \"boolean\" },\n-\t\tusage: \"abso join <project> [--agent <name>] [--dir <folder>] [--reader]\",\n+\t\tflags: { server: \"string\", agent: \"string\", dir: \"string\", reader: \"boolean\", \"token-file\": \"boolean\" },\n+\t\tusage: \"abso join <project> [--agent <name>] [--dir <folder>] [--reader] [--token-file]\",\n \t\tabout:\n-\t\t\t\"Join a project as a new agent and write its shared files into a folder: --dir, else here when this folder is empty, else ./<project> (which has to be new or empty). Without --agent the agent is named after this box (the name abso login gave it, lower-cased), or the next free <name>-2, <name>-3; that needs the box signed in with abso login. --reader joins as a reader: it reads everything and records nothing, and the server refuses its edits, records and pushes. With --reader and no sign-in, a public project is joined to read signed out: the folder holds only its settings, sends no sign-in, and runs status, log, show, files, blame, why, where, issues, issue and search; every other command is refused.\",\n+\t\t\t\"Join a project as a new agent and write its shared files into a folder: --dir, else here when this folder is empty, else ./<project> (which has to be new or empty). Without --agent the agent is named after this box (the name abso login gave it, lower-cased), or the next free <name>-2, <name>-3; that needs the box signed in with abso login. --reader joins as a reader: it reads everything and records nothing, and the server refuses its edits, records and pushes. With --reader and no sign-in, a public project is joined to read signed out: the folder holds only its settings, sends no sign-in, and runs status, log, show, files, blame, why, where, issues, issue and search; every other command is refused. It says what it signs in with: a new key from this box's sign-in, the folder's key, or ABSO_TOKEN; this machine's ~/.abso/token only with --token-file, never unasked.\",\n \t\trun: runJoin,\n \t},\n \trecord: {"},{"path":"client/test/init-credential.test.ts","added":171,"removed":0,"diff":"--- /dev/null\n+++ b/client/test/init-credential.test.ts\n@@ -0,0 +1,171 @@\n+// abso init and join sign in with the box sign-in, and use this machine's ~/.abso/token only with --token-file. A\n+// project is never made or joined with a shared credential that happened to be in a file, and both say what they sign\n+// in with. The client runs as its own process with its own home, so nothing on this machine is read.\n+\n+import assert from \"node:assert/strict\";\n+import { execFile } from \"node:child_process\";\n+import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from \"node:fs\";\n+import { createServer, type IncomingHttpHeaders, type Server } from \"node:http\";\n+import type { AddressInfo } from \"node:net\";\n+import { tmpdir } from \"node:os\";\n+import { join, resolve } from \"node:path\";\n+import { after, before, describe, it } from \"node:test\";\n+import { parseArgs } from \"../src/args.ts\";\n+import { writeBox } from \"../src/box.ts\";\n+import { tokenCredential } from \"../src/join-commands.ts\";\n+import { type Fake, startFake } from \"./fake-server.ts\";\n+\n+const CLIENT = resolve(import.meta.dirname, \"..\", \"abso.ts\");\n+const TOKEN = \"file-token-not-secret\";\n+const CREDENTIAL = \"abso_bx_box-credential-not-secret\";\n+let fake: Fake;\n+// Stands in for a server that takes box sign-ins: it notes each request, then answers 500 so the run stops there.\n+let boxes: Server;\n+let boxesUrl: string;\n+const heard: { url: string; headers: IncomingHttpHeaders }[] = [];\n+const dirs: string[] = [];\n+const temp = () => {\n+\tconst dir = mkdtempSync(join(tmpdir(), \"abso-test-init-credential-\"));\n+\tdirs.push(dir);\n+\treturn dir;\n+};\n+\n+before(async () => {\n+\tfake = await startFake(0, TOKEN);\n+\tboxes = createServer((req, res) => {\n+\t\theard.push({ url: req.url ?? \"\", headers: req.headers });\n+\t\tres.writeHead(500, { \"content-type\": \"application/json\" }).end('{\"error\":\"stop here\"}');\n+\t});\n+\tawait new Promise<void>((done) => boxes.listen(0, \"127.0.0.1\", done));\n+\tboxesUrl = `http://127.0.0.1:${(boxes.address() as AddressInfo).port}`;\n+});\n+after(async () => {\n+\tawait fake.close();\n+\tboxes.close();\n+\tfor (const dir of dirs) rmSync(dir, { recursive: true, force: true });\n+});\n+\n+/** A home holding a token file, and a box sign-in for `boxFor` when given. */\n+function home(boxFor?: string): string {\n+\tconst dir = temp();\n+\tmkdirSync(join(dir, \".abso\"), { recursive: true });\n+\twriteFileSync(join(dir, \".abso\", \"token\"), `${TOKEN}\\n`);\n+\tif (boxFor)\n+\t\twriteBox(\n+\t\t\t{\n+\t\t\t\tserver: boxFor,\n+\t\t\t\tid: \"b_0123abcd\",\n+\t\t\t\tcredential: CREDENTIAL,\n+\t\t\t\tgrant: { projects: [], scopes: [{ kind: \"member-all\", role: \"owner\" }] },\n+\t\t\t\texpiresAt: Date.now() + 86_400_000,\n+\t\t\t},\n+\t\t\tdir,\n+\t\t);\n+\treturn dir;\n+}\n+\n+function client(\n+\thomeDir: string,\n+\tcwd: string,\n+\t...args: string[]\n+): Promise<{ code: number; stdout: string; stderr: string }> {\n+\tconst env: Record<string, string> = {\n+\t\tPATH: process.env.PATH ?? \"\",\n+\t\tHOME: homeDir,\n+\t\tUSERPROFILE: homeDir,\n+\t\tAVCS_SERVERS_FILE: \"no-servers.json\",\n+\t\tABSO_NO_BROWSER: \"1\",\n+\t};\n+\tif (process.env.CLAUDE_CONFIG_DIR) env.CLAUDE_CONFIG_DIR = process.env.CLAUDE_CONFIG_DIR;\n+\tif (process.env.SystemRoot) env.SystemRoot = process.env.SystemRoot;\n+\treturn new Promise((done) => {\n+\t\texecFile(process.execPath, [CLIENT, ...args], { cwd, env }, (error, stdout, stderr) =>\n+\t\t\tdone({ code: typeof error?.code === \"number\" ? error.code : 0, stdout, stderr }),\n+\t\t);\n+\t});\n+}\n+\n+function folder(): string {\n+\tconst dir = temp();\n+\twriteFileSync(join(dir, \"a.txt\"), \"hi\\n\");\n+\treturn dir;\n+}\n+\n+const FLAGS = { \"token-file\": \"boolean\" } as const;\n+\n+describe(\"what init and join sign in with\", () => {\n+\tit(\"the token file only with --token-file, never into a folder with a key; ABSO_TOKEN as given\", () => {\n+\t\tconst server = \"http://127.0.0.1:1\";\n+\t\tconst file = () => TOKEN;\n+\t\tconst none = parseArgs(\"init\", [], FLAGS);\n+\t\tconst asked = parseArgs(\"init\", [\"--token-file\"], FLAGS);\n+\t\tassert.equal(tokenCredential(none, {}, server, temp(), file), undefined, \"a token file alone is not used\");\n+\t\tassert.deepEqual(tokenCredential(asked, {}, server, temp(), file), {\n+\t\t\ttoken: TOKEN,\n+\t\t\twords: \"the token file, ~/.abso/token, as --token-file asks\",\n+\t\t});\n+\t\tassert.throws(() => tokenCredential(asked, {}, server, temp(), () => undefined), /this machine has none/);\n+\t\tconst keyed = temp();\n+\t\tmkdirSync(join(keyed, \".abso\"));\n+\t\twriteFileSync(join(keyed, \".abso\", \"key\"), \"{}\");\n+\t\tassert.throws(() => tokenCredential(asked, {}, server, keyed, file), /already has a key/);\n+\t\tassert.equal(tokenCredential(none, { ABSO_TOKEN: \"env-token\" }, server, temp(), file)?.words, \"ABSO_TOKEN\");\n+\t});\n+\n+\tit(\"init with a token file and a box sign-in, no flag: signs in with the box, and says so\", async () => {\n+\t\tconst run = await client(home(boxesUrl), folder(), \"init\", \"--project\", \"made\", \"--server\", boxesUrl);\n+\t\tassert.match(run.stderr, /Signing in with this box's sign-in, b_0123abcd\\./);\n+\t\tassert.ok(heard.length > 0);\n+\t\tassert.ok(\n+\t\t\theard.every((h) => h.headers.authorization === `Box ${CREDENTIAL}`),\n+\t\t\t\"every request carried the box's sign-in\",\n+\t\t);\n+\t\tassert.ok(\n+\t\t\theard.every((h) => !String(h.headers.authorization).includes(TOKEN)),\n+\t\t\t\"the token file was never sent\",\n+\t\t);\n+\t});\n+\n+\tit(\"init with only a token file, no flag: refused before anything is made, naming --token-file\", async () => {\n+\t\tconst run = await client(home(), folder(), \"init\", \"--project\", \"unasked\", \"--agent\", \"me\", \"--server\", fake.url);\n+\t\tassert.notEqual(run.code, 0);\n+\t\tassert.match(run.stderr, /abso login signs it in\\. ~\\/\\.abso\\/token is used only with --token-file\\./);\n+\t\tconst status = await fetch(`${fake.url}/p/unasked/status`, { headers: { authorization: `Bearer ${TOKEN}` } });\n+\t\tassert.equal(status.status, 404, \"no project was made\");\n+\t});\n+\n+\tit(\"init and join with --token-file: sign in with the file, and say so\", async () => {\n+\t\tconst homeDir = home();\n+\t\tconst made = await client(\n+\t\t\thomeDir,\n+\t\t\tfolder(),\n+\t\t\t\"init\",\n+\t\t\t\"--project\",\n+\t\t\t\"asked\",\n+\t\t\t\"--agent\",\n+\t\t\t\"me\",\n+\t\t\t\"--token-file\",\n+\t\t\t\"--server\",\n+\t\t\tfake.url,\n+\t\t);\n+\t\tassert.equal(made.code, 0, made.stderr);\n+\t\tassert.match(made.stderr, /Signing in with the token file, ~\\/\\.abso\\/token, as --token-file asks\\./);\n+\t\tassert.match(made.stdout, /Created project asked/);\n+\t\tconst unasked = await client(homeDir, temp(), \"join\", \"asked\", \"--agent\", \"other\", \"--server\", fake.url);\n+\t\tassert.notEqual(unasked.code, 0, \"join without the flag sends no token\");\n+\t\tassert.match(unasked.stderr, /~\\/\\.abso\\/token is used only with --token-file\\./);\n+\t\tconst joined = await client(\n+\t\t\thomeDir,\n+\t\t\ttemp(),\n+\t\t\t\"join\",\n+\t\t\t\"asked\",\n+\t\t\t\"--agent\",\n+\t\t\t\"other\",\n+\t\t\t\"--token-file\",\n+\t\t\t\"--server\",\n+\t\t\tfake.url,\n+\t\t);\n+\t\tassert.equal(joined.code, 0, joined.stderr);\n+\t\tassert.match(joined.stderr, /Signing in with the token file/);\n+\t});\n+});"}],"ci":null}