feat(openapi): add customer-facing API documentation build#6392
Conversation
|
Claude finished @gustavosbarreto's task in 2m 21s —— View job Code Review CompleteReviewed 72 files across code quality, security, testing, Go/JS patterns, and architecture. 1 inline issue posted (critical: 1). The overall design — splitting the OpenAPI into full and customer-filtered builds via a Redocly decorator — is clean and well-implemented. The The one critical issue is that To request another review round, comment |
9539e8b to
c23d3a1
Compare
c23d3a1 to
eda826b
Compare
|
/review |
eda826b to
5ab1a50
Compare
|
/review |
|
Claude finished @gustavosbarreto's task in 11m 8s —— View job Code Review CompleteReviewed 75 files across code quality, security, testing, Go/JS patterns, and architecture. 1 inline issue posted (medium: 1). The overall design is clean and well-implemented. The The one medium-severity finding is that CI does not exercise the new customer-filter plugin or the per-edition specs — see the inline comment for details and a suggested smoke-test step. To request another review round, comment |
The published OpenAPI was a single spec exposing every route (admin, internal, billing, auth) to customers. Split it into two builds from one source: the full spec stays the internal source of truth for client generation and response validation, and a new filtered build is the customer-facing documentation. A drop-non-customer Redocly decorator keeps only the namespace-scoped, api-key usable surface: it drops /admin and /internal, operations that do not accept an api-key, and x-internal overrides, and strips the jwt scheme so the docs show api-key only. Other changes needed to make that build correct: - upgrade @redocly/cli to 2.31.5 (the pinned beta lacked decorators) and fix the schema errors the newer linter caught - fix edition composition: cloud and enterprise are siblings over a shared base, not a linear chain; enterprise no longer inherits cloud-only routes and cloud now carries the admin surface - align spec security with the Go routes (drop api-key where the handler blocks it or requires an owner-only permission) - relocate the internal session update to /internal, and tidy operation copy, tags, and the home pages
5ab1a50 to
eb389a3
Compare
|
/review |
|
Claude finished @gustavosbarreto's task in 2m 28s —— View job Code Review CompleteReviewed 75 files across code quality, security, testing, Go/JS patterns, and architecture — no issues found. The design is clean and well-implemented. The To request another review round, comment |

What
Split the OpenAPI into two builds from one source: the full spec (the internal
source of truth for frontend client generation and dev-mode response
validation) and a filtered, customer-facing documentation build that exposes
only the namespace-scoped, API-key usable surface.
Why
The published OpenAPI was a single spec that exposed every route to customers
(admin, internal, billing, auth, MFA, account management), most of which a
customer cannot call with an API key. It also carried a "NOT STABLE"
disclaimer, a stale contact address, and copy that repeated the namespace
scope on every operation.
Changes
drop-non-customerRedocly decorator(
plugins/customer-filter.js) keeps only operations that accept theapi-keyscheme and are namespace-scoped. It drops/adminand/internalpaths, operations without
api-key, andx-internaloverrides; strips thejwtscheme so the docs are api-key only; and prunes edition/meta tags andempty groups. Wired as
*-customerAPI entries inredocly.yaml, publishedon release by
openapi-cd.yml. The full spec consumed by the frontendcodegen and the dev validator keeps its full scope.
@redocly/cli1.0.0-beta.100to2.31.5(the betahad no decorators). Fixed the
nullable-type-siblingerrors the newerlinter caught.
base, not a linear chain. Fixed the broken
$ref: cloud#/pathsnesting inthe enterprise spec (it was dropping the shared routes), removed SAML from
cloud (enterprise only) and billing from enterprise (cloud only), and added
the admin surface to cloud (the cloud build registers it).
api-keyfrom operations the Go handlersblock or that require an owner-only permission (billing, namespace delete,
the user-token mint, the internal offline route); they were advertising an
auth method that can never succeed.
as a public
POST /api/sessions/{uid}. Moved it toPATCH /internal/sessions/{uid}to match the real internalUpdateSessionroute.
stated once, pagination, errors),
x-displayNameon tags ("SSH PublicKeys", "Firewall Rules", and so on), and rewritten operation
summaries/descriptions that drop the per-operation namespace redundancy and
fix grammar. Removed the unused, redundant
GET /api/users/security./openapi/customer.htmlrenders the filtered build locally;/openapi/keeps the full spec.Follow-ups tracked separately: #6390 (block API keys on account-level routes)
and #6391 (remove
GET /api/users/securityfrom the Go API).