Repository navigation
fix(rest): serve API docs with ReDoc so zip leaves the tree #440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+31
−121
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
72103e4
fix(rest): serve API docs with ReDoc so zip leaves the tree
claude 764d109
Merge branch 'main' into claude/new-session-th4e9w
hyperpolymath 1092345
docs(rest): document API startup configuration and panic conditions
coderabbitai[bot] 78a70c2
fix(ci): exclude nested js-runtimes checker from Cargo workspace
coderabbitai[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redoc::with_urluses utoipa-redoc's default HTML template, which loadsredoc.standalone.jsfrom the mutablehttps://cdn.redoc.ly/redoc/latest/...URL. Consequently,/redocremains blank whenever the browser cannot access the public CDN—such as in an air-gapped or outbound-filtered deployment—even though the API and embedded specification are available locally; the previous Swagger UI served its build-time-bundled assets from this process. Please use a custom template backed by a locally served, pinned ReDoc bundle so the documented endpoint remains self-contained.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed, and real:
utoipa-redoc7.0's default template (res/redoc.htmlin the crate) isso
/redocis a page we serve that executes whateverlatestresolves to at request time, with no integrity attribute. The previous Swagger UI embedded its assets at build time, so this PR moved the dependency from build time to run time. Two consequences: the page is blank on an air-gapped or egress-filtered deployment, and the bundle is a mutable third-party script on a page served from our origin.The fix I propose, in a follow-up on this stack rather than here (this PR's point is dropping the vendored zip):
Redoc::with_url(...).custom_html(...)with the same template but the version pinned (/redoc/v2.x.y/bundles/...) and anintegrity="sha384-…"attribute, computed from the bundle bytes. That keeps the tree free of the bundle and makes the dependency immutable.ECHIDNA_REDOC_BUNDLEpath so an operator can serve a local copy instead of the CDN; the ENV-VARS doc gets the entry.I cannot compute the SRI hash from this session (the CDN is not reachable through its egress policy), so I am not pushing a half-pin. @hyperpolymath: say whether you want (1) alone or (1)+(2), and I will open it against this branch's merge.
Generated by Claude Code