Versions 5 to 318
Lines 3–12 at 318 (were 3–11 at 5)
33
6−import { join } from "node:path";
910
Lines 16–22 at 318 (were 15–21 at 5)
1718
18−/** The admin token goes only to a server named in AVCS_ADMIN_SERVERS (comma-separated): none is built in. */
19+/** The admin token goes only to a server named in ABSO_ADMIN_SERVERS (comma-separated): none is built in. */
Lines 29–48 at 318 (were 28–42 at 5)
2930
3031export function adminToken(env: Readonly<Record<string, string | undefined>> = process.env): string {
31− const fromEnv = env.AVCS_ADMIN_TOKEN?.trim();
32− if (fromEnv) return fromEnv;
34− const fromFile = readFileSync(join(homedir(), ".avcs", "admin-token"), "utf8").trim();
37− throw new UsageError("abso key needs the admin token in AVCS_ADMIN_TOKEN or ~/.avcs/admin-token");
38+ throw new UsageError("abso key needs the admin token in ABSO_ADMIN_TOKEN or ~/.abso/admin-token");
3940
41+/** What an admin command says each time it uses the admin token, and where it came from. Never the token. */
42+export function adminTokenWords(env: Readonly<Record<string, string | undefined>> = process.env): string {
43+ return `Using the admin token, from ${fromEnv(env, "ADMIN_TOKEN")?.trim() ? "ABSO_ADMIN_TOKEN" : "~/.abso/admin-token"}.`;
45+
4248 for (const secret of secrets) if (secret.length > 0) out = out.split(secret).join("[redacted]");
Lines 50–58 at 318 (were 44–52 at 5)
4551
4652async function call(config: Config, admin: string, method: "GET" | "POST", path: string): Promise<unknown> {
47− if (!adminGoesTo(config.server, process.env.AVCS_ADMIN_SERVERS))
49− `abso key will not send the admin token to ${config.server}; AVCS_ADMIN_SERVERS names the servers it may go to`,
55+ `abso key will not send the admin token to ${config.server}; ABSO_ADMIN_SERVERS names the servers it may go to`,
Lines 61–67 at 318 (were 55–61 at 5)
58− "x-avcs-admin": admin,
- MCP
- compare on this site's /mcp
- CLI
- abso diff 5 318 client/src/key-admin.ts --json
- JSON
- /christopher/abso-core/compare/5..318?file=client%2Fsrc%2Fkey-admin.ts&format=json