Public: anyone can read this; the crew can change it.
The anonymous /api/v1/here manifest says how to get an account: make one and sign in, each with its route #8478
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/8461-the-anonymous-api-v1-here-manifest-says → main 2 commits fork 1 thread · 1 unresolved
3 files
changed +7
−4
src/actions/here.ts +2 −2
| @@ -328,9 +328,9 @@ function forgeActions( | ||
| 328 | 328 | ? [] |
| 329 | 329 | : [ |
| 330 | 330 | ...(activeEdgeToken(app) === undefined |
| 331 | ? [{ do: "make an account", http: "POST /api/v1/users", account: false }] | |
| 331 | ? [{ do: "make an account", http: "GET /signup", account: false }] | |
| 332 | 332 | : []), |
| 333 | { do: "sign in", http: "POST /api/v1/tokens", account: false }, | |
| 333 | { do: "sign in", http: "GET /signin", account: false }, | |
| 334 | 334 | ]), |
| 335 | 335 | ]; |
| 336 | 336 | } |
test/here-manifest.test.ts +2 −2
| @@ -284,12 +284,12 @@ describe("the manifest: what you can do here, as who you are", () => { | ||
| 284 | 284 | const anon = (await manifest("/")).body.actions; |
| 285 | 285 | expect(anon).toContainEqual({ |
| 286 | 286 | do: "make an account", |
| 287 | http: "POST /api/v1/users", | |
| 287 | http: "GET /signup", | |
| 288 | 288 | account: false, |
| 289 | 289 | }); |
| 290 | 290 | expect(anon).toContainEqual({ |
| 291 | 291 | do: "sign in", |
| 292 | http: "POST /api/v1/tokens", | |
| 292 | http: "GET /signin", | |
| 293 | 293 | account: false, |
| 294 | 294 | }); |
| 295 | 295 | expect(anon.findIndex((a: any) => a.do === "use the MCP")).toBeLessThan( |
test/openapi.test.ts +3
| @@ -21,7 +21,10 @@ test("every http route the manifest names is described", () => { | ||
| 21 | 21 | ); |
| 22 | 22 | expect(named.length).toBeGreaterThan(5); |
| 23 | 23 | const doc = openapi("https://f.test", "1") as any; |
| 24 | // The sign-up and sign-in pages are HTML for a person, not part of the API. | |
| 25 | const pages = new Set(["/signup", "/signin"]); | |
| 24 | 26 | for (const [method, path] of named) { |
| 27 | if (pages.has(path)) continue; | |
| 25 | 28 | const p = path.replace(/\{(\w+)\}/g, "{$1}"); |
| 26 | 29 | expect(doc.paths[p]?.[method], `${method} ${p}`).toBeDefined(); |
| 27 | 30 | } |
new above
offline
Hard-coded skip list; prefer deriving it so new page rows are not exempted by hand.