Public: anyone can read this; the crew can change it.
The OpenAPI document describes GET /api/v1/passport/health #5330
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/5311-the-openapi-document-describes-get-api-v → main 1 commit fork
4 files
changed +21
−2
src/contract/openapi.ts +8
| @@ -842,6 +842,14 @@ export const ROUTES: readonly Route[] = [ | ||
| 842 | 842 | 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", |
| 843 | 843 | auth: false, |
| 844 | 844 | }, |
| 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 | }, | |
| 845 | 853 | { method: "get", path: "/api/v1/map", summary: "The global map: every repository the caller can see, with its issues and dependency edges", auth: false }, |
| 846 | 854 | { |
| 847 | 855 | method: "post", |
test/openapi-coverage.test.ts −1
| @@ -35,7 +35,6 @@ const NOT_YET_DESCRIBED: readonly string[] = [ | ||
| 35 | 35 | "GET /api/v1/orgs/{}", |
| 36 | 36 | "GET /api/v1/orgs/{}/teams", |
| 37 | 37 | "GET /api/v1/orgs/{}/teams/{}/members", |
| 38 | "GET /api/v1/passport/health", | |
| 39 | 38 | "GET /api/v1/repos/{}/{}/app/{}/open", |
| 40 | 39 | "GET /api/v1/repos/{}/{}/branches", |
| 41 | 40 | "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", () => { | ||
| 27 | 27 | }); |
| 28 | 28 | |
| 29 | 29 | 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"] | |
| 31 | 31 | .map((f) => readFileSync(f, "utf8")) |
| 32 | 32 | .join("\n"); |
| 33 | 33 | const registered = new Set( |
new above
offline