Skip to content

RapiDoc Portal 1.0 and rapidoc 15: security fixes, clean-ups and a new sidebar - #1244

Merged
mrin9 merged 7 commits into
masterfrom
release/portal-1.0-rapidoc-15
Nov 23, 2026
Merged

mrin9 merged 7 commits into
masterfrom
release/portal-1.0-rapidoc-15

Conversation

@mrin9

@mrin9 mrin9 commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator

The first stable release of RapiDoc Portal and a major release of rapidoc. Every package was reviewed before the 1.0 promise; this pull request fixes what the review found, settles the names that become the 1.0 contract, and adds a redesigned sidebar.

Versions (from the changesets)

Package Version
@rapidoc/cli, portal, server, mock, prerender, mcp, create-rapidoc 0.2.6 → 1.0.0
@rapidoc/embed, @rapidoc/hono, @rapidoc/express, @rapidoc/fastify 0.x → 1.0.0
rapidoc 14.2.1 → 15.0.0
@rapidoc/starlight, vitepress, docusaurus patch

Security fixes

  • @rapidoc/server: sign-in bypass (affects the published 0.2.6). The sign-in cookie, which /_rapidoc/auth/login gives any visitor, was accepted as a session, so signed-in zones opened without signing in. Group and email zones were not affected. Every sealed token now has one use, each with its own key. Worth a security advisory when this is released.
  • Server hardening: refuses a split build whose rapidoc-server.json is missing, needs a public URL to sign in outside localhost, limits request bodies, sends frame-ancestors (RAPIDOC_FRAME_ANCESTORS), referrer and HSTS headers, and starts when the sign-in provider is down.
  • Spec content: an allow-list sanitizer that works without a DOM (pre-rendered pages were not sanitized at all), no javascript: links from a spec, and the prerender serializer treats only Lit's own objects as markup.
  • rapidoc build --out-dir public (the CLI's own example) emptied public/; source folders are now refused.
  • rapidoc mock and rapidoc dev listen on localhost; the mock's spec import accepts only local programs and its own page and cannot read other local files.
  • MCP reads credentials only from MCP_ variables.

1.0 clean-ups (no aliases kept)

Old names are removed, not aliased. Every change is listed, old and new, on the new pages sites/rapi-portal/docs/getting-started/upgrading-to-1-0.md, sites/rapidoc/docs/rapidoc/migration/v14-to-v15.mdx and removed-attributes.mdx.

  • Portal and CLI: {% api-operation api= %}, {% workflow document= %}, {% tab label= %}, card-grid columns works; the unused second Markdoc implementation is removed; migrate --force; no canonical links to developer.portal without site.url.
  • Server and mock: createApp() returns a secret-free summary; the mock's entry exports only its public API.
  • Embed and integrations: uiPath means the path within the mount everywhere (Hono now works under basePath()); peer ranges bounded; six new conformance fixtures, no existing fixture changed; Python and .NET ports updated.
  • MCP: MCP_AUTH_<SCHEME>, MCP_BASE_URL, MCP_EXTERNAL_HOSTS; stable tool names capped at 64 characters; resources only with x-mcp-resource.
  • Prerender: one option-naming rule, unknown options rejected, the element's own defaults, a smaller public entry (./internal for this repository); a spec that cannot be loaded throws, and the portal build fails on it and builds tag pages for remote specs.
  • <rapi-doc> 15: scrollTo removed, one nav-active-change shape, persist-auth per API, deprecated attributes out of the reference, plus fixes for the mock after a move, relative server URLs, PKCE scheme names, css-file and YAML local files.

New

  • Three-level sidebar in <rapi-doc>, the static sidebar and the portal's docs sidebar: section labels, rows with icons, compact operation rows under a guide line. Every item is a real link, a tag's arrow is a separate button, the current item has aria-current, and right-to-left works.
  • Fifteen more rapidoc lint rules, including three casing-consistency rules that need no settings.
  • Smaller bundles: rapidoc-flow-min.js 283.0 → 241.2 KB (js-yaml for Arazzo); rapidoc-min.js 685.2 → 680.1 KB minified (seven rarely used highlighter grammars dropped). Gzipped, rapidoc-min.js is 2 KB larger (184.2 → 186.2 KB), mostly the new sanitizer and MCP code.

Testing

All run locally on the final tree:

Suite Result
npm run test:unit 781 pass
npm run test:portal 775 pass
npm run test:e2e 74 pass
npm run test:component 12 pass
npm run test:rapipdf 97 pass
npm run lint, npm run format clean
Python integration (pytest) 43 pass
.NET integration (dotnet test, net10.0 only) 39 pass

Not run: the .NET tests on net8.0 (not installed here), and the Docusaurus component in a real Docusaurus site (checked by hand per its AGENTS.md).

For reviewers

  • Breaking by design. Several defaults changed for safety (localhost binding, the public URL for sign-in, frame-ancestors, failing builds on unloadable specs, four lint rules that are errors by default). They are listed in the upgrade pages and release notes.
  • Companion change in rapi-portal-demo, branch portal-1.0: the example portals use the renamed tag attributes. rapidoc-portal-starter still needs the same update.
  • After release: a security advisory for the sign-in fix; scripts/sync.sh and a new tag in rapidoc-go; Python and .NET release on their own schedules (both bumped to 0.3.0 here).
  • packages/rapidoc/dist/ and rapidoc-build-info.* are not committed, per AGENTS.md.

🤖 Generated with Claude Code

mrin9 and others added 7 commits November 23, 2026 15:58
Security fixes from a review of every package before the first stable
release:
- server: the sign-in cookie was accepted as a session, opening pages for
  all signed-in readers without signing in; every sealed token now has one
  use. Also refuse a split build without rapidoc-server.json, require a
  public URL to sign in outside localhost, limit request bodies, and send
  frame-ancestors, referrer and HSTS headers.
- rapidoc and prerender: an allow-list sanitizer that works without a DOM,
  so pre-rendered pages are sanitized too; no javascript: links from a
  spec; the serializer only treats Lit's own objects as markup.
- build refuses an output folder that is a source folder; mock and dev
  listen on localhost; the mock's spec import accepts only local programs
  and its own page, and cannot read other local files.

Clean-ups that become the 1.0 contract (no aliases kept):
- Markdoc tags take api= and document=; tab takes label; card-grid columns
  works; the unused second Markdoc implementation is removed.
- server returns a secret-free summary and starts when the provider is
  down; the mock's entry exports only its public API.
- embed: uiPath means the path within the mount everywhere, Hono included;
  0.x aliases removed; peer ranges bounded; new conformance fixtures.
- MCP: credentials only from MCP_ variables, stable tool names capped at
  64 characters, resources only with x-mcp-resource, Swagger 2 Basic and
  form parameters, no calls to localhost without a base URL.
- prerender: one option-naming rule with unknown options rejected, the
  element's defaults, a smaller public entry, errors for specs that cannot
  be loaded; the portal fails the build on them and builds tag pages for
  remote specs.
- rapi-doc 15: scrollTo removed, one nav-active-change shape, saved keys
  per API, deprecated attributes out of the reference with a "Removed
  attributes" page, and fixes for the mock after a move, relative server
  URLs, PKCE scheme names, css-file and YAML local files.

New:
- A three-level sidebar in rapi-doc, the static sidebar and the portal's
  docs sidebar, with real links, a button for each tag's arrow,
  aria-current and right-to-left support.
- Fifteen more rapidoc lint rules.
- rapidoc-flow-min.js is 42 KB smaller (js-yaml for Arazzo documents) and
  rapidoc-min.js drops seven rarely used highlighter grammars.

Versions come from the changesets: rapidoc 15.0.0; the portal group,
@rapidoc/embed and the Hono, Express and Fastify integrations 1.0.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The rows, the tag arrow and the portal's docs sidebar rows used multiples of
--radius (2x and 1.5x). They now use --radius (--portal-radius in the
portal) as every other element does, so the radius attribute and a theme's
radius set them directly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Section labels, tags shown as labels and the portal's docs sidebar labels
used 650, which most fonts render as 600 or 700 depending on the face.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The current item's text was set in weight 550 (700 for an upper-case tag),
so it widened and the row shifted when it became current. It now keeps the
row's weight and takes the accent color, on the same tinted block; this
applies to rapi-doc, the static sidebar and the portal's docs sidebar.

Accent text on the tint fell below 4.5:1 in the portal's dark theme, so:
- --sidebar-active-background (new) holds the block's color; the portal
  points it at --portal-primary-tint, its tint for accent text.
- --sidebar-primary defaults to --primary-text, the readable accent, not
  the fill color --primary (orange on white was about 2.8:1, now 5.3:1).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…on run

RUN WORKFLOW, STOP and CLEAR LOGS match RapiDoc's TRY and CLEAR: upper
case, right-aligned, the primary action last. A run scrolls the
Execution Log into view when it is off screen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sets the color scheme of <rapi-flow> and <rapi-doc>, the logo and the
page's own colors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mrin9
mrin9 merged commit 5a77a84 into master Nov 23, 2026
7 checks passed
@mrin9
mrin9 deleted the release/portal-1.0-rapidoc-15 branch November 23, 2026 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant