docs(openapi): hide websiteOnlyCors routes from public docs#180
docs(openapi): hide websiteOnlyCors routes from public docs#180
Conversation
Flip `x-internal: false` to `x-internal: true` on four routes whose indexer handlers are wrapped in the `websiteOnlyCors` middleware (origin-locked to bitbadges.io). Public docs were advertising them, which would cause 3rd-party devs to hit CORS errors when calling them. Affected: - POST /dynamicStores (createDynamicDataStore) - PUT /dynamicStores (updateDynamicDataStore) - DELETE /dynamicStores (deleteDynamicDataStore) - GET /swapActivities (getSwapActivities) Verified via indexer grep: each of these handlers includes the `websiteOnlyCors` middleware. No behavior change — just hides them from the Stoplight public surface. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Greptile SummaryThis PR hides four Confidence Score: 5/5Safe to merge — documentation-only change with no runtime impact. All four changes are minimal, targeted, and correct. No logic, runtime behavior, or security posture is affected — only which routes appear in the public Stoplight docs. No P0/P1 findings. No files require special attention.
|
| Filename | Overview |
|---|---|
| packages/bitbadgesjs-sdk/openapitypes-helpers/routes.yaml | Flips x-internal from false to true on four websiteOnlyCors-gated routes (POST/PUT/DELETE /dynamicStores and GET /swapActivities) to hide them from public API docs. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[routes.yaml] --> B{x-internal?}
B -->|true| C[Hidden from public docs\nStoplight / public navigation]
B -->|false| D[Visible in public docs]
subgraph Changed Routes
E["POST /dynamicStores\n(createDynamicDataStore)"]
F["PUT /dynamicStores\n(updateDynamicDataStore)"]
G["DELETE /dynamicStores\n(deleteDynamicDataStore)"]
H["GET /swapActivities\n(getSwapActivities)"]
end
E -->|false → true| C
F -->|false → true| C
G -->|false → true| C
H -->|false → true| C
C --> I[websiteOnlyCors middleware\norigin-locked to bitbadges.io]
I --> J[3rd-party calls CORS-rejected\nbefore this fix: docs advertised them]
Reviews (1): Last reviewed commit: "docs(openapi): hide websiteOnlyCors rout..." | Re-trigger Greptile
Summary
Flip
x-internal: falsetox-internal: trueon four routes whose indexer handlers are wrapped in thewebsiteOnlyCorsmiddleware (origin-locked to bitbadges.io).Public docs were advertising these as callable, which would cause 3rd-party devs to hit CORS errors when calling them. The invariant per the docs-watch spec is: every
websiteOnlyCorsroute MUST be absent fromroutes.yamlor havex-internal: true.Routes affected
/dynamicStorescreateDynamicDataStore/dynamicStoresupdateDynamicDataStore/dynamicStoresdeleteDynamicDataStore/swapActivitiesgetSwapActivitiesWhy hide instead of expose
These are mutations that require the
Manage Dynamic Storesscope or return user-activity feeds; not core 3p-dev integration surface. Dynamic data stores are managed via the frontend UI today — exposing public docs for routes that then CORS-reject third-party origins is worse than hiding them.If any of these should actually be publicly callable, the indexer middleware needs to change (remove
websiteOnlyCors) — that's a separate security-shaped call and a human should make it.Test plan
genapi.ymlruns cleanly on merge and opens the usualupdate-openapi-hostedPRDetected by docs-watch agent, 2026-04-24.
Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com