Repository navigation
RapiDoc Portal 1.0 and rapidoc 15: security fixes, clean-ups and a new sidebar - #1244
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)
@rapidoc/cli,portal,server,mock,prerender,mcp,create-rapidoc@rapidoc/embed,@rapidoc/hono,@rapidoc/express,@rapidoc/fastifyrapidoc@rapidoc/starlight,vitepress,docusaurusSecurity fixes
@rapidoc/server: sign-in bypass (affects the published 0.2.6). The sign-in cookie, which/_rapidoc/auth/logingives any visitor, was accepted as a session, sosigned-inzones 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.rapidoc-server.jsonis missing, needs a public URL to sign in outsidelocalhost, limits request bodies, sendsframe-ancestors(RAPIDOC_FRAME_ANCESTORS), referrer and HSTS headers, and starts when the sign-in provider is down.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) emptiedpublic/; source folders are now refused.rapidoc mockandrapidoc devlisten onlocalhost; the mock's spec import accepts only local programs and its own page and cannot read other local files.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.mdxandremoved-attributes.mdx.{% api-operation api= %},{% workflow document= %},{% tab label= %},card-grid columnsworks; the unused second Markdoc implementation is removed;migrate --force; no canonical links todeveloper.portalwithoutsite.url.createApp()returns a secret-freesummary; the mock's entry exports only its public API.uiPathmeans the path within the mount everywhere (Hono now works underbasePath()); peer ranges bounded; six new conformance fixtures, no existing fixture changed; Python and .NET ports updated.MCP_AUTH_<SCHEME>,MCP_BASE_URL,MCP_EXTERNAL_HOSTS; stable tool names capped at 64 characters; resources only withx-mcp-resource../internalfor 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:scrollToremoved, onenav-active-changeshape,persist-authper API, deprecated attributes out of the reference, plus fixes for the mock after a move, relative server URLs, PKCE scheme names,css-fileand YAML local files.New
<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 hasaria-current, and right-to-left works.rapidoc lintrules, including three casing-consistency rules that need no settings.rapidoc-flow-min.js283.0 → 241.2 KB (js-yaml for Arazzo);rapidoc-min.js685.2 → 680.1 KB minified (seven rarely used highlighter grammars dropped). Gzipped,rapidoc-min.jsis 2 KB larger (184.2 → 186.2 KB), mostly the new sanitizer and MCP code.Testing
All run locally on the final tree:
npm run test:unitnpm run test:portalnpm run test:e2enpm run test:componentnpm run test:rapipdfnpm run lint,npm run formatdotnet test, net10.0 only)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
localhostbinding, 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.rapi-portal-demo, branchportal-1.0: the example portals use the renamed tag attributes.rapidoc-portal-starterstill needs the same update.scripts/sync.shand a new tag inrapidoc-go; Python and .NET release on their own schedules (both bumped to 0.3.0 here).packages/rapidoc/dist/andrapidoc-build-info.*are not committed, per AGENTS.md.🤖 Generated with Claude Code