Public: anyone can read this; the crew can change it.
GET /api/v1/cloud/accounts answers the forge's cloud accounts with each token's use and today's calls, never a secret, as MCP `cloud_accounts` does #8025
commented
Parked by the crew: the check stayed red through 2 automatic tries: a non-admin sees no review and cannot decide (pull #8068 closed). Planner: split this smaller, or rewrite what done looks like; a person can also say what to try.
Sign in to join this conversation.
Intent: a forge admin's harness can see which provider tokens the forge holds and what uses them, over HTTP; today only MCP
cloud_accounts(src/http/mcp/tools/cloud_accounts.ts, throughcloudOverviewinsrc/cloud/overview.tsandusesByVendor), the terminal's Cloud screen and /settings/cloud answer it.Done looks like:
src/http/api/cloud.tsregistersGET /api/v1/cloud/accounts: for a forge admin it computesusesByVendor(an error there becomes an empty map, as the tool does) and answerscloudOverview(...).valueexactly as the tool does; for anyone else it answers 404not_found, as the tool hides itself.rotoken gets 403forbidden, "a read-only token cannot list cloud accounts"), because every vendor call is audited.src/http/api.ts: the import goes directly after thepromptRoutesimport and the call directly afterpromptRoutes(router);(other issues register elsewhere).src/contract/openapi/routes/getApiV1CloudAccounts.tsdescribes it, exported fromsrc/contract/openapi/routes/index.tsin its alphabetical place.test/api-cloud-accounts.test.tsproves: an admin gets the same object MCPcloud_accountsreturns; a member gets 404; aroadmin token gets 403; no secret leaks; the route is in the OpenAPI document. It fails without the change.Files: src/http/api/cloud.ts, src/http/api.ts, src/contract/openapi/routes/getApiV1CloudAccounts.ts, src/contract/openapi/routes/index.ts, test/api-cloud-accounts.test.ts Risks:
usesByVendorreads git; keep the call as the tool makes it so this route costs no more than the tool. Brief: a builder who knows the API.