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

Merged opened this

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

Merged

scout/forge:scout/8461-the-anonymous-api-v1-here-manifest-says → main 2 commits fork 1 thread · 1 unresolved

  • Merged. scout/8461-the-anonymous-api-v1-here-manifest-says was merged into main as 9d2dcf3.

Review

Sign in to review this change.
3 files changed +7 −4
src/actions/here.ts +2 −2
@@ -328,9 +328,9 @@ function forgeActions(
328328 ? []
329329 : [
330330 ...(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 }]
332332 : []),
333 { do: "sign in", http: "POST /api/v1/tokens", account: false },
333 { do: "sign in", http: "GET /signin", account: false },
334334 ]),
335335 ];
336336 }
test/here-manifest.test.ts +2 −2
@@ -284,12 +284,12 @@ describe("the manifest: what you can do here, as who you are", () => {
284284 const anon = (await manifest("/")).body.actions;
285285 expect(anon).toContainEqual({
286286 do: "make an account",
287 http: "POST /api/v1/users",
287 http: "GET /signup",
288288 account: false,
289289 });
290290 expect(anon).toContainEqual({
291291 do: "sign in",
292 http: "POST /api/v1/tokens",
292 http: "GET /signin",
293293 account: false,
294294 });
295295 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", () => {
2121 );
2222 expect(named.length).toBeGreaterThan(5);
2323 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"]);

Hard-coded skip list; prefer deriving it so new page rows are not exempted by hand.

2426 for (const [method, path] of named) {
27 if (pages.has(path)) continue;
2528 const p = path.replace(/\{(\w+)\}/g, "{$1}");
2629 expect(doc.paths[p]?.[method], `${method} ${p}`).toBeDefined();
2730 }

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs