Skip to content

Commit 1e4b824

Browse files
liyubin117danzhewuju
authored andcommitted
[rest] Fix content-security-policy violation on RestCatalog API yaml (apache#5355)
1 parent 799145f commit 1e4b824

File tree

5 files changed

+2303
-7
lines changed

5 files changed

+2303
-7
lines changed

docs/content/concepts/rest/rest-api.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,5 @@ under the License.
2424
-->
2525

2626
<body>
27-
<div id="redoc-container"></div>
28-
<script>
29-
Redoc.init('https://raw.githubusercontent.com/apache/paimon/master/paimon-open-api/rest-catalog-open-api.yaml', {
30-
disableSearch: true
31-
}, document.getElementById('redoc-container'));
32-
</script>
27+
{{< redoc_rest_catalog_api >}}
3328
</body>

docs/layouts/partials/docs/inject/head.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,5 @@
2424
<script src="{{.Site.BaseURL}}/js/flink.js"></script>
2525
<!-- Only takes effect when the `redocPage` variable is true. -->
2626
{{ if .Params.redocPage }}
27-
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline' 'unsafe-eval'; default-src 'self' data: blob: 'unsafe-inline' https://raw.githubusercontent.com/apache/paimon/master/paimon-open-api/;">
2827
<script src="{{.Site.BaseURL}}/js/redoc.standalone.js"></script>
2928
{{ end }}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{{/*
2+
Licensed to the Apache Software Foundation (ASF) under one
3+
or more contributor license agreements. See the NOTICE file
4+
distributed with this work for additional information
5+
regarding copyright ownership. The ASF licenses this file
6+
to you under the Apache License, Version 2.0 (the
7+
"License"); you may not use this file except in compliance
8+
with the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing,
13+
software distributed under the License is distributed on an
14+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
KIND, either express or implied. See the License for the
16+
specific language governing permissions and limitations
17+
under the License.
18+
*/}}{{/*
19+
Shortcode for RestCatalog open-api rendered by Redoc
20+
*/}}
21+
<div id="redoc-container"></div>
22+
<script>
23+
Redoc.init('{{.Site.BaseURL}}/rest-catalog-open-api.yaml', {
24+
disableSearch: true
25+
}, document.getElementById('redoc-container'));
26+
</script>

0 commit comments

Comments
 (0)