[rest] Fix content-security-policy violation issue on RestCatalog API#5340
Merged
JingsongLi merged 4 commits intoapache:masterfrom Mar 25, 2025
Merged
[rest] Fix content-security-policy violation issue on RestCatalog API#5340JingsongLi merged 4 commits intoapache:masterfrom
JingsongLi merged 4 commits intoapache:masterfrom
Conversation
JingsongLi
reviewed
Mar 25, 2025
|
|
||
| docs/assets/github.css (css generated by Hugo) from https://github.com/alecthomas/chroma version 2 | ||
| docs/static/js/anchor.min.js from https://github.com/bryanbraun/anchorjs version 5.0 | ||
| docs/static/js/redoc.standalone.js from https://github.com/Redocly/redoc version 2.0.0 |
Contributor
There was a problem hiding this comment.
We should add its license to licenses directory.
JingsongLi
reviewed
Mar 25, 2025
| <redoc spec-url="https://raw.githubusercontent.com/apache/paimon/master/paimon-open-api/rest-catalog-open-api.yaml"></redoc> | ||
| <script src="https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js"></script> | ||
| <div id="redoc-container"></div> | ||
| <script src="/docs/master/js/redoc.standalone.js"></script> |
Contributor
There was a problem hiding this comment.
Refer it just like "{{.Site.BaseURL}}/js/flink.js"?
Contributor
Author
There was a problem hiding this comment.
After setting <script src="{{.Site.BaseURL}}/js/redoc.standalone.js"></script>, throw following error:
GET http://localhost:1313/docs/master/concepts/rest/rest-api/%7B%7B.Site.BaseURL%7D%7D/js/redoc.standalone.js net::ERR_ABORTED 404 (Not Found)
Contributor
There was a problem hiding this comment.
Maybe add this <script to head.html, and this file just refer js function?
JingsongLi
reviewed
Mar 25, 2025
licenses/LICENSE.redoc
Outdated
| @@ -0,0 +1,21 @@ | |||
| The MIT License (MIT) | |||
Contributor
There was a problem hiding this comment.
Contributor
|
+1 |
danzhewuju
pushed a commit
to danzhewuju/paimon
that referenced
this pull request
Mar 31, 2025
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.
Purpose
Apache refuses to load the https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js script due to Content Security Policy (CSP) restrictions. We could import the file, and it also makes loading faster.
As mentioned in Redocly/redoc#1191, we should disable search to avoid
javascript file refer to https://cdn.jsdelivr.net/npm/redoc@2.0.0/bundles/redoc.standalone.js
Tests
API and Format
Documentation