Versions 302 to 318
Lines 21–71 at 318 (were 21–50 at 302)
2323
24−/** The website a server's handoff goes to: --site as given (https only), else the staging site beside it. */
25−export function siteFor(server: string, site?: string): string {
26− if (site !== undefined) {
27− let url: URL;
28− try {
29− url = new URL(site);
30− } catch {
31− throw new UsageError(
32− `--site takes the website's address, like https://abso-website-staging.chrisazy.workers.dev`,
33− );
34− }
35− if (url.protocol !== "https:" && url.hostname !== "localhost" && url.hostname !== "127.0.0.1")
36− throw new UsageError("--site has to be https, or this machine");
37− return url.origin;
38− }
25+ * The website a handoff's credential goes to (Security condition 6, Code Review): the staging website beside the folder's own
26+ * staging server, from the fixed list above, and never an origin from a flag. A server that isn't on the list is refused,
27+ * prod included. --site is only for a test account's PAT on this machine (http://localhost or 127.0.0.1); a box's sign-in
43− `abso login --web is for staging: ${origin} has no staging website beside it that abso knows, and agents never sign in to the website on prod. --site names one.`,
35+ `abso login --web is for staging: ${origin} has no staging website beside it that abso knows, and agents never sign in to the website on prod. Nothing was sent.`,
45− return known;
39+ throw new UsageError(`--site isn't taken with a box's sign-in, which goes only to ${known}. Nothing was sent.`);
46+ if (url === null || url.protocol !== "http:" || (url.hostname !== "localhost" && url.hostname !== "127.0.0.1"))
48+ "--site, with --pat-file, names this machine only (http://localhost:<port> or http://127.0.0.1:<port>). Nothing was sent.",
4752
54+ * abso login --web: where the credential would go is settled before it is read, so a refusal reads and sends nothing
55+ * (Security). `credential` reads the box's sign-in or the PAT only once the website is one it may go to.
68+
Lines 128–141 at 318 (were 107–117 at 302)
109130
110−/** What abso login --web says: the one link, how long it works, and who it signs in as. */
111−export function handoffText(h: Handoff, site: string, now = Date.now()): string {
131+/** What abso login --web says: the one link, how long it works, who it signs in as, and what it reaches (Security). */
135+ ? "only to the projects this box was granted, at most as a writer, until the box is revoked or ends"
114− `Open this link in your browser within ${seconds} seconds. It signs that browser in to ${site} as ${h.name}, until ${h.sessionEnds}, and works once:`,
138+ `Open this link in your browser within ${seconds} seconds. It signs that browser in to ${site} as ${h.name}, until ${h.sessionEnds}, and works once. It reaches ${reach}:`,
- MCP
- compare on this site's /mcp
- CLI
- abso diff 302 318 client/src/web-session.ts --json
- JSON
- /christopher/abso-core/compare/302..318?file=client%2Fsrc%2Fweb-session.ts&format=json