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

The OpenAPI document describes GET /api/v1/passport/health #5330

Merged opened this

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

Merged

scout/forge:scout/5311-the-openapi-document-describes-get-api-v → main 1 commit fork

  • Merged. scout/5311-the-openapi-document-describes-get-api-v was merged into main as b30bd7c.

Review

Sign in to review this change.
4 files changed +21 −2
src/contract/openapi.ts +8
@@ -842,6 +842,14 @@ export const ROUTES: readonly Route[] = [
842842 summary: "How the forge is, uncached; anyone may ask, a stranger is told little, the release probe and a site admin the whole of it",
843843 auth: false,
844844 },
845 {
846 method: "get",
847 path: "/api/v1/passport/health",
848 summary:
849 "The forge's public health, for a caller holding a passport (`Authorization: Passport <token>`, audience `forge`, scope `health:read`) rather than a token; answers the same body as the anonymous health, uncached",
850 auth: false,
851 refusals: { unauthorized: "the passport is missing, malformed, expired, or not for this audience and scope (always 401)" },
852 },
845853 { method: "get", path: "/api/v1/map", summary: "The global map: every repository the caller can see, with its issues and dependency edges", auth: false },
846854 {
847855 method: "post",
test/openapi-coverage.test.ts −1
@@ -35,7 +35,6 @@ const NOT_YET_DESCRIBED: readonly string[] = [
3535 "GET /api/v1/orgs/{}",
3636 "GET /api/v1/orgs/{}/teams",
3737 "GET /api/v1/orgs/{}/teams/{}/members",
38 "GET /api/v1/passport/health",
3938 "GET /api/v1/repos/{}/{}/app/{}/open",
4039 "GET /api/v1/repos/{}/{}/branches",
4140 "GET /api/v1/repos/{}/{}/commits",
test/openapi-oa-passport.test.ts added +12
@@ -0,0 +1,12 @@
1 /** The OpenAPI document describes the passport edge. */
2 import { expect, test } from "bun:test";
3 import { openapi } from "../src/contract/openapi.ts";
4
5 test("GET /api/v1/passport/health is described, with its passport and its one refusal", () => {
6 const doc = openapi("https://f.test", "1") as any;
7 const op = doc.paths["/api/v1/passport/health"]?.get;
8 expect(op).toBeDefined();
9 expect(op.summary).toContain("Passport");
10 expect(op.summary).toContain("health:read");
11 expect(JSON.stringify(op)).toContain("unauthorized");
12 });
test/openapi.test.ts +1 −1
@@ -27,7 +27,7 @@ test("every http route the manifest names is described", () => {
2727 });
2828
2929 test("every described route is registered in the router", () => {
30 const src = ["src/http/server.ts", "src/http/api.ts", "src/http/mcp.ts"]
30 const src = ["src/http/server.ts", "src/http/api.ts", "src/http/mcp.ts", "src/http/passport_edge.ts"]
3131 .map((f) => readFileSync(f, "utf8"))
3232 .join("\n");
3333 const registered = new Set(

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs