Public: anyone can read this; the crew can change it.

GET /healthz answers the same as /api/v1/health, so an uptime probe that tries the usual path gets the truth #13198

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

torque/forge:torque/13191-get-healthz-answers-the-same-as-api-v1-h → main 7 commits fork 3 threads · 3 unresolved

  • Merged. torque/13191-get-healthz-answers-the-same-as-api-v1-h was merged into main as d71543b.

Review

Sign in to review this change.
11 files changed +143 −32
src/contract/openapi/routes/getHealth.ts added +11
@@ -0,0 +1,11 @@
1 import type { Route } from "../shared.ts";
2
3 export const route: Route = {
4 method: "get",
5 path: "/health",

Path '/health' is rendered under the /api/v1 base by the generator, so this likely documents /api/v1/health twice rather than the root /health; confirm in the generated document.

6 summary:
7 "The same answer as GET /api/v1/health, at the path an uptime monitor tries first (#13191); /healthz stays the orchestrator's liveness probe and answers ok whenever the process and its database do",
8 auth: false,
9 role: "anonymous",
10 reply: { ok: "boolean", draining: "boolean", schedules: "object" },
11 };
src/contract/openapi/routes/index.ts +1
@@ -243,6 +243,7 @@ export { route as getApiV1UsersUsernameRepos } from "./getApiV1UsersUsernameRepo
243243 export { route as getApiV1UsersUsernameSignins } from "./getApiV1UsersUsernameSignins.ts";
244244 export { route as getApiV1Version } from "./getApiV1Version.ts";
245245 export { route as getContractOpenapiJson } from "./getContractOpenapiJson.ts";
246 export { route as getHealth } from "./getHealth.ts";
246247 export { route as getMetrics } from "./getMetrics.ts";
247248 export { route as getOwnerNamePullsNumberCheckTxt } from "./getOwnerNamePullsNumberCheckTxt.ts";
248249 export { route as patchApiV1AdminSettings } from "./patchApiV1AdminSettings.ts";
src/core/reserved.ts +5
@@ -58,6 +58,11 @@ export const SYSTEM_NAMES: readonly string[] = [
5858 "contact",
5959 // the forge's own pages
6060 "api",
61 // the probes' paths (#13191): answered before the web router, so a profile there could never
outdated

Reserving new names is not in the issue and can invalidate an existing owner/repo called health; justify it or drop it.

62 // be reached; an account that already holds one keeps it (see the head of this file)
63 "health",
64 "healthz",
65 "readyz",
6166 "apps",
6267 "asks",
6368 "assets",
src/http/api.ts +25 −14
@@ -810,7 +810,9 @@ function editFailure(error: { kind: string } & Record<string, unknown>) {
810810 const ANCHOR_FORMAT =
811811 'An anchor is {"path": a file in the pull\'s diff, "line": its line number, "side": "new" (the head\'s numbering, for added or kept lines) or "old" (the base\'s, for removed lines)}; the line must be inside one of the diff\'s hunks: in `@@ -a,b +c,d @@` the hunk\'s first line is c on the new side and a on the old. GET …/pulls/N returns the diff.';
812812
813 /** A review's line comments as the API was sent them; undefined when they are not a list of objects. */
813 /**
814 * A review's line comments as the API was sent them; undefined when they are not a list of objects.
815 */
814816 function reviewLines(raw: unknown): ReviewInput[] | undefined {
815817 if (raw === undefined || raw === null) return [];
816818 // The cap is `submitReview`'s to refuse, by name (`too_many_lines`).
@@ -1969,7 +1971,8 @@ export function apiRoutes(router: Router<Handler>): void {
19691971 const from = at + 1;
19701972 const items = all.slice(from, from + limit);
19711973 const more = from + limit < all.length;
1972 // The tag is of the exact bytes sent: a pushed, moved or deleted tag changes them, and so does the page.
1974 // The tag is of the exact bytes sent: a pushed, moved or deleted tag changes them, and so
1975 // does the page.
19731976 const text = JSON.stringify({ items, next_cursor: more ? items[items.length - 1]!.name : null });
19741977 const etag = weakEtag(text);
19751978 const headers = { etag, "cache-control": "private, no-cache", vary: "authorization, cookie" };
@@ -2419,8 +2422,8 @@ export function apiRoutes(router: Router<Handler>): void {
24192422 },
24202423 );
24212424 // One action on a whole limb (#733): defer, resume, or close as not
2422 // doing, or raise or lower it among its siblings (#1064). A fleet operation in every respect — a dry run by default with a
2423 // read credential, an admin token to apply, the receipt in
2425 // doing, or raise or lower it among its siblings (#1064). A fleet operation in every respect — a
2426 // dry run by default with a read credential, an admin token to apply, the receipt in
24242427 // /api/v1/fleet/ops/:id and its undo at …/undo.
24252428 router.add(
24262429 "POST",
@@ -2500,7 +2503,8 @@ export function apiRoutes(router: Router<Handler>): void {
25002503 const since = parseSince(ctx.url.searchParams.get("since"));
25012504 if (since === undefined) return apiError("invalid_since", 422, "since is day, week or month");
25022505 const scope = sealedScope(ctx.app.db, repo, ctx.auth.user);
2503 // Built by the map's worker, so the thread serves everything else meanwhile; a snapshot of this write clock answers at once.
2506 // Built by the map's worker, so the thread serves everything else meanwhile; a snapshot of this
2507 // write clock answers at once.
25042508 const got = await snapshotMap(ctx.app, { repoId: repo.id, scope, now: new Date() });
25052509 if (got === undefined) return notFound();
25062510 // The growth line is read here, not in the snapshot: it moves with the clock, not with writes.
@@ -2539,7 +2543,8 @@ export function apiRoutes(router: Router<Handler>): void {
25392543 });
25402544 });
25412545 // What people asked of the crew in the repositories the caller can write —
2542 // by default what has nothing merged yet, oldest first — and what became of each (core/asked.ts, the /asked page).
2546 // by default what has nothing merged yet, oldest first — and what became of each (core/asked.ts,
2547 // the /asked page).
25432548 router.add("GET", "/api/v1/asked", (ctx) => {
25442549 notePhase(ctx.request, "session", takeSessionTime(ctx.request));
25452550 const denied = requireScope(ctx, "ro");
@@ -2658,8 +2663,8 @@ export function apiRoutes(router: Router<Handler>): void {
26582663 ...(states[i] ?? {}),
26592664 }));
26602665 });
2661 // The tag is of the exact bytes sent, so a new verdict, head or state is never hidden behind a 304;
2662 // the page, state, limit, cursor and fields are in the body or the query that chose it.
2666 // The tag is of the exact bytes sent, so a new verdict, head or state is never hidden behind a
2667 // 304; the page, state, limit, cursor and fields are in the body or the query that chose it.
26632668 return timePhase(ctx.request, "render", () => {
26642669 const text = JSON.stringify(paged(items, query.limit, (p) => p.number));
26652670 const etag = weakEtag(text);
@@ -2851,7 +2856,8 @@ export function apiRoutes(router: Router<Handler>): void {
28512856 ...(diff === undefined ? {} : { diff }),
28522857 hold: hold === undefined ? null : holdJson(hold),
28532858 });
2854 // Tagged by the exact bytes sent, after access was checked: a new head, verdict, review or merge is never hidden behind a 304.
2859 // Tagged by the exact bytes sent, after access was checked: a new head, verdict, review or
2860 // merge is never hidden behind a 304.
28552861 const etag = weakEtag(text);
28562862 const headers = { etag, "cache-control": "private, no-cache", vary: "authorization, cookie" };
28572863 if (holds(ctx.request, etag)) return new Response(null, { status: 304, headers });
@@ -3535,8 +3541,11 @@ export function apiRoutes(router: Router<Handler>): void {
35353541
35363542 // How the forge is: anyone may ask (a monitor has no account), a stranger
35373543 // is told little, the release machinery's probe and a site admin the
3538 // whole of it (`actions/health.ts`).
3539 router.add("GET", "/api/v1/health", (ctx) => {
3544 // whole of it (`actions/health.ts`). `/health` is the same answer at the
3545 // path an uptime monitor tries first (#13191); `/healthz` stays the
3546 // liveness probe's (`http/health.ts`), which must not turn red on a
3547 // drain or a broken cause, or the orchestrator restarts a busy forge.
3548 const healthRoute: Handler = (ctx) => {
35403549 notePhase(ctx.request, "session", takeSessionTime(ctx.request));
35413550 const body = timePhase(ctx.request, "health", () =>
35423551 healthAnswer(ctx.app, ctx.auth.user, isProbe(ctx.request, ctx.app.config.dataDir)),
@@ -3544,7 +3553,9 @@ export function apiRoutes(router: Router<Handler>): void {
35443553 return timePhase(ctx.request, "render", () =>
35453554 json(body, 200, { "cache-control": "no-store", vary: "authorization, cookie, x-forge-probe" }),
35463555 );
3547 });
3556 };
3557 router.add("GET", "/api/v1/health", healthRoute);

The issue asks for /healthz, not /health. Add /healthz here (or move the orchestrator probe), or have the issue amended.

3558 router.add("GET", "/health", healthRoute);
35483559
35493560 // Open egress connections per app and destination, as Prometheus text
35503561 // (#3719). Repository names are in the labels, so a site admin only.
@@ -3712,8 +3723,8 @@ export function apiRoutes(router: Router<Handler>): void {
37123723 return kept ? json(await beatAnswer(ctx.app, raw)) : apiError("not_found", 404, "no such door");
37133724 });
37143725
3715 // A child asking its parent to broker an origin sign-in (`spawn/origin_broker.ts`): signed with the
3716 // heartbeat key; every refusal is the same 404, so nothing says who is a child.
3726 // A child asking its parent to broker an origin sign-in (`spawn/origin_broker.ts`): signed with
3727 // the heartbeat key; every refusal is the same 404, so nothing says who is a child.
37173728 router.add("POST", "/api/v1/broker/origins", async (ctx) => {
37183729 const bytes = await readBounded(ctx.request, CALL_BODY_MAX);
37193730 if (bytes === "too_large") return apiError("not_found", 404, "no such door");
src/http/asset_miss.ts +1 −1
@@ -6,7 +6,7 @@
66
77 const ASSET_EXTENSION = /\.(?:xml|json|txt|js|css|map|png|ico)$/;
88 /** Machine surfaces that keep their own JSON miss; the one list server.ts shares. */
9 export const MACHINE_PREFIX = /^\/(?:api|contract|mcp|oauth|\.well-known|metrics|healthz)(?:\/|$)/;
9 export const MACHINE_PREFIX = /^\/(?:api|contract|mcp|oauth|\.well-known|metrics|health|healthz|readyz)(?:\/|$)/;
1010
1111 export function isAssetMiss(request: Request, pathname: string): boolean {
1212 if (request.method !== "GET" && request.method !== "HEAD") return false;
src/http/route_marks.ts +13 −3
@@ -16,7 +16,10 @@ import { Router } from "./router.ts";
1616
1717 export type Mark = "admin" | "open";
1818
19 /** Every head of a registered route: one mark for all of it, or `mixed` when each route is listed below. */
19 /**
20 * Every head of a registered route: one mark for all of it, or `mixed` when each route is listed
21 * below.
22 */
2023 export const HEADS: Readonly<Record<string, Mark | "mixed">> = {
2124 "/": "open",
2225 "/-": "open",
@@ -140,6 +143,7 @@ export const HEADS: Readonly<Record<string, Mark | "mixed">> = {
140143 "/maintenance": "admin",
141144 "/manifest.webmanifest": "open",
142145 "/map": "open",
146 "/health": "open",
143147 "/mcp": "open",
144148 "/metrics": "open",
145149 "/migrate": "open",
@@ -422,7 +426,10 @@ export function markOf(pattern: string): Mark | undefined {
422426 }
423427
424428 let listed: Router<Mark> | undefined;
425 /** ROUTES as a matcher, literal segments before parameters so `/packs/new` is not read as `/packs/:name`. */
429 /**
430 * ROUTES as a matcher, literal segments before parameters so `/packs/new` is not read as
431 * `/packs/:name`.
432 */
426433 function listedRoutes(): Router<Mark> {
427434 if (listed !== undefined) return listed;
428435 const params = (p: string) => p.split("/").filter((s) => s.startsWith(":") || s.startsWith("*")).length;
@@ -432,7 +439,10 @@ function listedRoutes(): Router<Mark> {
432439 return (listed = matcher);
433440 }
434441
435 /** Whether a request path falls on a route marked `admin`; unlisted under a `mixed` head counts as `admin`. */
442 /**
443 * Whether a request path falls on a route marked `admin`; unlisted under a `mixed` head counts as
444 * `admin`.
445 */
436446 export function isAdminRoute(path: string): boolean {
437447 const own = listedRoutes().match("*", path);
438448 if (own !== undefined) return own.handler === "admin";
src/http/server.ts +12 −7
@@ -912,7 +912,8 @@ export function buildRouter(): Router<Handler> {
912912 router.add("GET", "/", home);
913913 // The home is `/`; its old address goes there (web/pages/home_flow.ts). Literal, above /:owner.
914914 router.add("GET", "/home", homeRedirect);
915 // The new home's action bar: preview or apply one bulk action over the rows picked (web/pages/home_table.ts).
915 // The new home's action bar: preview or apply one bulk action over the rows picked
916 // (web/pages/home_table.ts).
916917 router.add("POST", "/home/act", homeActPost);
917918 router.add("POST", "/desk", deskLeave);
918919 router.add("POST", "/desk/clear", deskClear);
@@ -1044,7 +1045,8 @@ export function buildRouter(): Router<Handler> {
10441045 router.add("GET", "/new/issue", newIssueAnywhere);
10451046 router.add("GET", "/repos", myReposPage);
10461047 router.add("GET", "/displays", displaysPage);
1047 // A repository's display, read only (`display.ts`): 404 without a display.json or without read access.
1048 // A repository's display, read only (`display.ts`): 404 without a display.json or without read
1049 // access.
10481050 router.add("GET", "/:owner/:name/display", displayPage);
10491051 router.add("POST", "/:owner/:name/display", displayChoose);
10501052 router.add("GET", "/now/:stage", nowPage);
@@ -1080,8 +1082,9 @@ export function buildRouter(): Router<Handler> {
10801082 router.add("GET", "/migrate/jobs/:job", migrationJobPage);
10811083 // Every app on one canvas; a literal route, so it must sit above /:owner.
10821084 router.add("GET", "/map", globalMapPage);
1083 // The pipeline moved to a panel on /boards (#2774); the old address follows it. Literal, above /:owner.
1084 // /flow is the week's valves (#8698); a query string is an old pipeline drill, which went to /boards.
1085 // The pipeline moved to a panel on /boards (#2774); the old address follows it. Literal, above
1086 // /:owner. /flow is the week's valves (#8698); a query string is an old pipeline drill, which
1087 // went to /boards.
10851088 router.add("GET", "/flow", flowPage);
10861089 router.add("POST", "/flow/valve", valveSet);
10871090 router.add("POST", "/flow/backup/retry", backupRetry);
@@ -2733,7 +2736,8 @@ export async function serve(app: App): Promise<Servers> {
27332736 });
27342737 // The minute ledger's history: one write a minute, never on a request.
27352738 const trafficWriter = createTrafficWriter(app.db, liveOf(app).perfRecord.ledger, app.log);
2736 // Page views are buffered by the beacon doors and written here; GitHub's traffic is pulled daily when a token is set.
2739 // Page views are buffered by the beacon doors and written here; GitHub's traffic is pulled daily
2740 // when a token is set.
27372741 const viewWriter = createViewWriter(app.db, app.log);
27382742 const githubPull = startGithubPull(app.db, app.log);
27392743 const featureSchedule = startFeatureSchedule(app);
@@ -3188,8 +3192,9 @@ async function answerGet(
31883192 // generic as `/:owner/:name` can never claim it — a route added there
31893193 // next year still can't bring the HTML 404 back for an API caller.
31903194 const isApiPath = url.pathname === "/api" || url.pathname.startsWith("/api/");
3191 // `/metrics` is the API router's too: a scraper, not a page.
3192 const matched = isApiPath || url.pathname === "/metrics"
3195 // `/metrics` is the API router's too: a scraper, not a page; and
3196 // `/health`, a monitor's (#13191).
3197 const matched = isApiPath || url.pathname === "/metrics" || url.pathname === "/health"
31933198 ? apiRouter.match(routeMethod, url.pathname)
31943199 : router.match(routeMethod, url.pathname);
31953200 if (!matched) {
src/web/standards.ts +23 −5
@@ -131,7 +131,10 @@ export function securityTxt(ctx: Ctx): Response {
131131 );
132132 }
133133
134 /** A discovery document and its ETag, per kind and origin, made again only when its inputs read differently. */
134 /**
135 * A discovery document and its ETag, per kind and origin, made again only when its inputs read
136 * differently.
137 */
135138 const discoveryBodies = new Map<string, { inputs: string; body: string; etag: string }>();
136139
137140 /**
@@ -147,7 +150,8 @@ function discovery(ctx: Ctx, kind: string, inputs: string, make: () => unknown,
147150 const etag = `"${new Bun.CryptoHasher("sha256").update(body).digest("hex").slice(0, 32)}"`;
148151 kept = { inputs, body, etag };
149152 // Origins come from the Host header: keep a handful, not one per guess.
150 // The oldest goes first (a Map keeps insertion order), so junk hosts never flush the real ones at once.
153 // The oldest goes first (a Map keeps insertion order), so junk hosts never flush the real ones
154 // at once.
151155 discoveryBodies.delete(key);
152156 if (discoveryBodies.size >= 48) discoveryBodies.delete(discoveryBodies.keys().next().value!);
153157 discoveryBodies.set(key, kept);
@@ -177,12 +181,18 @@ export async function agentCardJson(ctx: Ctx): Promise<Response> {
177181 return discovery(ctx, `agent-card ${signedIn}`, JSON.stringify([now.version, toolsKey()]), () => agentCard(ctx.url.origin, now, signedIn), "application/json", signedIn ? "private, max-age=3600" : "public, max-age=3600", true, "Cookie, Authorization");
178182 }
179183
180 /** GET /.well-known/api-catalog — RFC 9727: one linkset naming each API's description and docs. Anonymous. */
184 /**
185 * GET /.well-known/api-catalog — RFC 9727: one linkset naming each API's description and docs.
186 * Anonymous.
187 */
181188 export function apiCatalogJson(ctx: Ctx): Response {
182189 return discovery(ctx, "api-catalog", "", () => apiCatalog(ctx.url.origin), 'application/linkset+json; profile="https://www.rfc-editor.org/info/rfc9727"', "public, max-age=300");
183190 }
184191
185 /** GET /.well-known/forge — the standards this forge implements, by id and version (docs/standards/). */
192 /**
193 * GET /.well-known/forge — the standards this forge implements, by id and version
194 * (docs/standards/).
195 */
186196 export function forgeJson(ctx: Ctx): Response {
187197 const version = running().version;
188198 return discovery(ctx, "forge", version, () => forgeDocument(version), "application/json", "public, max-age=3600");
@@ -244,6 +254,11 @@ export function robotsTxt(ctx: Ctx): Response {
244254 "Disallow: /settings",
245255 "Disallow: /search",
246256 "Disallow: /api/",
257 // A probe's answers, never a page (#13191); `$` so a profile named
258 // `healthy` stays open.
259 "Disallow: /health$",
260 "Disallow: /healthz$",
261 "Disallow: /readyz$",
247262 // The deep paths, at every ref and in every mirror: each is a git walk
248263 // (#8129). Repository roots, docs and the home page stay open.
249264 ...DEEP_SEGMENTS.map((segment) => `Disallow: /*/*/${segment}`),
@@ -419,7 +434,10 @@ function runningSentence(): string {
419434 : `Running ${r.version} at ${r.commit.slice(0, 7)}`;
420435 }
421436
422 /** llms.txt and its ETag per origin, valid while the listing read, the build, the tell command and the plugin source being public are the same. */
437 /**
438 * llms.txt and its ETag per origin, valid while the listing read, the build, the tell command and
439 * the plugin source being public are the same.
440 */
423441 const llmsBodies = new Map<string, { repos: LlmsListing; running: string; tell: string | undefined; plugins: string | undefined; plans: string; tools: number; body: string; etag: string }>();
424442
425443 /**
test/health.test.ts +47
@@ -12,6 +12,8 @@ import {
1212 readyResponse,
1313 startDraining,
1414 } from "../src/http/health.ts";
15 import { openapi } from "../src/contract/openapi.ts";
16 import { reservedName } from "../src/core/reserved.ts";
1517 import { serve, type Servers } from "../src/http/server.ts";
1618 import { ownProbeHeaders } from "../src/kernel/probe.ts";
1719 import { running } from "../src/kernel/version.ts";
@@ -144,6 +146,51 @@ describe("the served paths", () => {
144146 expect((await fetch(`${servers.url}/`)).status).toBe(200);
145147 });
146148
149 // A monitor tries /health first and must hear the report, not a 10 KB page (#13191).
150 test("/health answers what /api/v1/health answers, without a cookie, behind the security floor", async () => {
151 const strip = (b: Record<string, unknown>) => ({ ...b, at: undefined });
152 for (const draining of [false, true]) {
153 if (draining) startDraining(recordingLog(), "SIGTERM");
154 const [short, long] = await Promise.all([
155 fetch(`${servers.url}/health`),
156 fetch(`${servers.url}/api/v1/health`),
157 ]);
158 expect(short.status).toBe(long.status);
159 expect(short.headers.get("content-type")).toContain("application/json");
160 const body = (await short.json()) as Record<string, unknown>;
161 expect(strip(body)).toEqual(strip((await long.json()) as Record<string, unknown>));
162 expect(body.draining).toBe(draining);
163 expect(short.headers.get("set-cookie")).toBeNull();
164 expect(short.headers.get("cache-control")).toBe("no-store");
165 expect(short.headers.get("x-content-type-options")).toBe("nosniff");
166 expect(short.headers.get("referrer-policy")).toBeTruthy();
167 expect(short.headers.get("content-security-policy")).toBeTruthy();
168 }
169 // The liveness probe keeps its own answer through the drain.
170 expect((await fetch(`${servers.url}/healthz`)).status).toBe(200);
171 });
172
173 test("robots.txt keeps crawlers off the probes' paths, and the sitemap names none", async () => {
174 const robots = await (await fetch(`${servers.url}/robots.txt`)).text();
175 for (const path of ["/health", "/healthz", "/readyz"]) expect(robots).toContain(`Disallow: ${path}$`);
176 const sitemap = await (await fetch(`${servers.url}/sitemap.xml`)).text();
177 expect(sitemap).not.toMatch(/\/(?:health|healthz|readyz)</);
178 // Nobody can take a probe's path as a profile.
179 for (const name of ["health", "healthz", "readyz"]) expect(reservedName(app.db, name)).toBe("system");
180 });
181
182 // The document's server is the bare origin, so `/health` is the root path, not a second
183 // /api/v1/health.
184 test("the OpenAPI document lists /health at the root, beside /api/v1/health", () => {
185 const doc = openapi("https://forge.example", "1", "anonymous") as {
186 servers: { url: string }[];
187 paths: Record<string, Record<string, unknown>>;
188 };
189 expect(doc.servers).toEqual([{ url: "https://forge.example" }]);
190 expect(doc.paths["/health"]?.["get"]).toBeDefined();
191 expect(doc.paths["/api/v1/health"]?.["get"]).toBeDefined();
192 });
193
147194 test("HEAD /readyz is 200 with an empty body", async () => {
148195 const head = await fetch(`${servers.url}/readyz`, { method: "HEAD" });
149196 expect(head.status).toBe(200);
test/openapi-drift.test.ts +4 −2
@@ -10,6 +10,7 @@ const NOT_ROUTED: Readonly<Record<string, string>> = {
1010 "GET /contract/openapi.json": "the document, an alias of /api/v1/openapi.json served outside /api/v1",
1111 "GET /api/v1/repos/{}/{}/app/production/open": "the described form of the routed /app/:env/open, with env fixed to production",
1212 "GET /metrics": "routed outside /api/v1 (src/http/api.ts); the scan reads /api/v1 routes only",
13 "GET /health": "routed outside /api/v1 (src/http/api.ts), the monitor's alias of /api/v1/health (#13191)",
1314 "GET /{}/{}/pulls/{}/check.txt": "routed outside /api/v1 (src/http/server.ts, check_text.ts); test/openapi-check-txt.test.ts pins it to server.ts",
1415 "POST /mcp": "routed outside /api/v1 (src/http/mcp.ts); the MCP has its own card and tool list",
1516 };
@@ -83,8 +84,9 @@ test("every operation names its role, as the pinned list says", () => {
8384 /**
8485 * The routes that need a signed-in account but refuse a bearer token: a browser
8586 * session or the password, never a token (`auth` false, role `member`). Pinned
86 * from the handlers in src/http/api/tokens.ts, src/http/api.ts and src/http/api/conversation_confirms.ts.
87 * `DELETE /api/v1/sessions` is not here: without a session it answers 200 all the same.
87 * from the handlers in src/http/api/tokens.ts, src/http/api.ts and
88 * src/http/api/conversation_confirms.ts. `DELETE /api/v1/sessions` is not here: without a session
89 * it answers 200 all the same.
8890 */
8991 const SESSION_ONLY: ReadonlySet<string> = new Set([
9092 "GET /api/v1/tokens",
test/security-sweep.test.ts +1
@@ -73,6 +73,7 @@ const NO_405: Record<string, string> = {
7373 "/api/v1": "the API root is read-only and answers a write as it always did: no route (`answerGet`, src/http/server.ts)",
7474 "/api/v1/": "the API root with its slash, the same read-only root as /api/v1",
7575 "/metrics": "a scraper's path outside /api/, so its miss is the machine-path 404, not the API's 405",
76 "/health": "a monitor's path outside /api/ (#13191), so its miss is the machine-path 404 as /metrics's is",
7677 };
7778
7879 /** Cookies a page's own script must read, so not HttpOnly → why. */

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs