# Embedded RapiDoc assets
RapiDoc **12.0.0**, enabled by the optional `rapidoc-embedded` feature.
The preset targets this version's native `rapi-doc` attributes.
Source: <https://registry.npmjs.org/rapidoc/-/rapidoc-12.0.0.tgz>
Upstream commit: `f8f38be861c6cf9a4b7ced7dd1ae5ca49c1dc7a1`.
The archive was verified against the npm release's SHA-512 integrity value.
- Tarball SHA-256: `b117cf2026d5ba553b2ea1447a2336a37486d90584b4b04d99df45a77b1d08fb`
- Original `package/dist/rapidoc-min.js` SHA-256:
`c93169b174b281c6205f9f3ff2a32d57d002c2e5090cdd98ef833fa153645f94`
- Distributed bundle SHA-256:
`7852ff1037363802478078df321924e71b39aeaeb86d39b646f5c6c09d6f1192`
The bundle remains a standalone ES module. Both it and the initializer are loaded
as module scripts, in document order. Consumers need no npm, Node, build script
or build-time network access. The changes below are local corrections to the
upstream bundle; the bundle is their single source, with no patch generator.
## OAuth security patch
The readable section between `OAuth security patch start` and
`OAuth security patch end` preserves the bundled authorization transaction's
lifecycle and validation guarantees. Upstream 12 already generates random state,
nonce and PKCE values, validates popup message origin/source/state, and displays
errors as text; those native primitives are reused where applicable.
The original helpers are in
<https://github.com/rapi-doc/RapiDoc/blob/f8f38be861c6cf9a4b7ced7dd1ae5ca49c1dc7a1/packages/rapidoc/src/templates/security-scheme-template.js>.
Only a complete response for the expected grant from the expected popup, receiver
origin and state can finish authorization. Unrelated or malformed messages leave
the listener active. Successful callbacks are consumed once. Popup closure,
cancellation, replacement, page navigation and a five-minute deadline clean up
listeners and outstanding requests. Concurrent schemes remain independent;
starting an attempt for the same scheme cancels its predecessor. Changing the
loaded specification prevents an old attempt from applying credentials.
The popup is opened before asynchronous PKCE calculation to retain the user
gesture. Receiver URLs must remain on the documentation origin, and authorization
URLs must use HTTP(S). Authorization, token and refresh URLs resolve against
the complete selected server path, including relative and protocol-relative URLs.
Token responses must be successful, well-formed and free of provider errors.
Credential whitespace is preserved; HTTP Basic encodes the client ID and secret
separately as required by OAuth. Punctuated security scheme IDs work without
being interpreted as CSS selectors.
The local `oauth-receiver.js` posts `{state, code, responseType: "code"}` or
`{state, access_token, token_type, responseType: "token"}` and sends provider
failures as `{state, error, error_description}`. Duplicate or ambiguous query
and fragment parameters are rejected. Custom receivers must use this format.
This integration uses `window.opener`, not BroadcastChannel; the documentation
and callback routes need the COOP configuration described in the public rustdoc.
The preset selects the local receiver and disables credential persistence.
## OpenAPI parsing corrections
Path filtering retains shared Path Item metadata, including references and
arbitrary extensions, only when an operation survives. It preserves the upstream
OpenAPI 3.2 `query` and `additionalOperations` support. Non-path entries in the
Paths Object are excluded from rendering so `x-*` values cannot become fake
endpoints or break loading. Upstream 12 fixes regex matching itself, so the old
regex replacement is no longer needed.
Paths and webhooks render separately: a webhook named `/items` cannot replace
an ordinary `/items` operation. Each retains its own parameters and servers.
Navigation IDs use the upstream slugger with distinct path/webhook identities,
so same-named operations remain independently navigable. The old custom collision
encoding is removed. The served and downloaded specification is unchanged.
Operation servers override Path Item servers when present, instead of extending
them. Omitted servers inherit the Path Item list; an explicit empty list remains
empty for the native request component's document-server fallback.
## Verification and notices
Run the offline regression checks from the repository root:
```sh
node --test tests/rapidoc_security.test.cjs
```
The tests check the distributed SHA-256 and unique OAuth markers, exercise exact
functions extracted from the bundle, and run the actual receiver and initializer
with simulated browser APIs. They use only Node.js built-ins and never modify
assets. The checksum detects unrecorded changes, not whether a recorded change
is correct. Review updates against the original archive and bundle above and
verify actual module loading, OAuth, native options and CSP in a browser.
RapiDoc 12 uses system fonts natively and does not load external fonts. Applications
own external references, Markdown images, API servers and overridden resource
URLs. Disabling the preset does not introduce font requests.
`LICENSES.txt` preserves the upstream copyright and complete license texts from
the runtime dependency closure of the pinned
[lockfile](https://github.com/rapi-doc/RapiDoc/blob/f8f38be861c6cf9a4b7ced7dd1ae5ca49c1dc7a1/package-lock.json)
(SHA-256 `5bb4c198767d594759e65d17af78f9e5d98b076da7ff9e547cbc1d9ed1ef6606`).
This is a conservative superset, including Node.js and type-only packages that
may not enter the browser bundle; it is not a reconstructed bundle SBOM.
Dependency archives were checked against the lockfile's integrity hashes.
Versioned official sources supply missing Lit SSR shim and Scalar type-package
license files; their URLs are recorded in the notices.