This is an automated email from the ASF dual-hosted git repository.

chengpan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-kyuubi.git


The following commit(s) were added to refs/heads/master by this push:
     new bea8e4f1c [KYUUBI #3710] Delete the swagger UI related resource files 
from the source folder
bea8e4f1c is described below

commit bea8e4f1cb1859ebc6fa46a7f26b59bedf08ed23
Author: Fu Chen <[email protected]>
AuthorDate: Sat Oct 29 10:40:07 2022 +0000

    [KYUUBI #3710] Delete the swagger UI related resource files from the source 
folder
    
    ### _Why are the changes needed?_
    
    This pr aims to reduce the source file size.
    
    This PR removes the swagger UI resource file in the folder 
`kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger` which was 
introduced by [PR-2061](https://github.com/apache/incubator-kyuubi/pull/2061) , 
and now we rely on Maven dependency `org.webjars::swagger-ui::4.9.1` to package 
these resource files, we also add a new REST endpoint `/swagger-static/` for 
downloading these resource files
    
    ### _How was this patch tested?_
    - [ ] Add some test cases that check the changes thoroughly including 
negative and positive cases if possible
    
    - [ ] Add screenshots for manual tests if appropriate
    
    - [x] [Run 
test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests)
 locally before make a pull request
    
    Closes #3710 from cfmcgrady/reduce-src-size.
    
    Closes #3710
    
    c83bd313 [Fu Chen] update comment
    441129b5 [Fu Chen] update LICENSE-binary
    14eac59b [Fu Chen] update dev/dependencyList
    7971c388 [Fu Chen] bump swagger-ui to  4.9.1
    455aa206 [Fu Chen] reduce source file size
    
    Authored-by: Fu Chen <[email protected]>
    Signed-off-by: Cheng Pan <[email protected]>
---
 LICENSE-binary                                     |   3 -
 dev/dependencyList                                 |   1 +
 kyuubi-server/pom.xml                              |   5 ++
 .../org/apache/kyuubi/ui/swagger/favicon-16x16.png | Bin 665 -> 0 bytes
 .../org/apache/kyuubi/ui/swagger/favicon-32x32.png | Bin 628 -> 0 bytes
 .../org/apache/kyuubi/ui/swagger/index.html        |  10 +--
 .../apache/kyuubi/ui/swagger/oauth2-redirect.html  |  92 ---------------------
 .../apache/kyuubi/ui/swagger/swagger-ui-bundle.js  |   3 -
 .../kyuubi/ui/swagger/swagger-ui-bundle.js.map     |   1 -
 .../kyuubi/ui/swagger/swagger-ui-es-bundle-core.js |   3 -
 .../ui/swagger/swagger-ui-es-bundle-core.js.map    |   1 -
 .../kyuubi/ui/swagger/swagger-ui-es-bundle.js      |   3 -
 .../kyuubi/ui/swagger/swagger-ui-es-bundle.js.map  |   1 -
 .../ui/swagger/swagger-ui-standalone-preset.js     |   3 -
 .../ui/swagger/swagger-ui-standalone-preset.js.map |   1 -
 .../org/apache/kyuubi/ui/swagger/swagger-ui.css    |   4 -
 .../apache/kyuubi/ui/swagger/swagger-ui.css.map    |   1 -
 .../org/apache/kyuubi/ui/swagger/swagger-ui.js     |   3 -
 .../org/apache/kyuubi/ui/swagger/swagger-ui.js.map |   1 -
 .../kyuubi/server/KyuubiRestFrontendService.scala  |   1 +
 pom.xml                                            |  13 +++
 21 files changed, 25 insertions(+), 125 deletions(-)

diff --git a/LICENSE-binary b/LICENSE-binary
index 4ea04cdea..186f9b001 100644
--- a/LICENSE-binary
+++ b/LICENSE-binary
@@ -321,9 +321,6 @@ io.vertx:vertx-core
 io.vertx:vertx-grpc
 org.apache.zookeeper:zookeeper
 
-
-kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/*
-
 BSD
 ------------
 jline:jline
diff --git a/dev/dependencyList b/dev/dependencyList
index 42f6d7d05..3876b2f06 100644
--- a/dev/dependencyList
+++ b/dev/dependencyList
@@ -173,6 +173,7 @@ swagger-core/2.2.1//swagger-core-2.2.1.jar
 swagger-integration/2.2.1//swagger-integration-2.2.1.jar
 swagger-jaxrs2/2.2.1//swagger-jaxrs2-2.2.1.jar
 swagger-models/2.2.1//swagger-models-2.2.1.jar
+swagger-ui/4.9.1//swagger-ui-4.9.1.jar
 vertx-core/4.3.2//vertx-core-4.3.2.jar
 vertx-grpc/4.3.2//vertx-grpc-4.3.2.jar
 zjsonpatch/0.3.0//zjsonpatch-0.3.0.jar
diff --git a/kyuubi-server/pom.xml b/kyuubi-server/pom.xml
index 4eea6e4c7..4864629ad 100644
--- a/kyuubi-server/pom.xml
+++ b/kyuubi-server/pom.xml
@@ -356,6 +356,11 @@
             </exclusions>
         </dependency>
 
+        <dependency>
+            <groupId>org.webjars</groupId>
+            <artifactId>swagger-ui</artifactId>
+        </dependency>
+
         <dependency>
             <groupId>org.apache.hive</groupId>
             <artifactId>hive-exec</artifactId>
diff --git 
a/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/favicon-16x16.png
 
b/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/favicon-16x16.png
deleted file mode 100644
index 8b194e617..000000000
Binary files 
a/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/favicon-16x16.png
 and /dev/null differ
diff --git 
a/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/favicon-32x32.png
 
b/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/favicon-32x32.png
deleted file mode 100644
index 249737fe4..000000000
Binary files 
a/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/favicon-32x32.png
 and /dev/null differ
diff --git 
a/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/index.html 
b/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/index.html
index c60044d1f..61172b2af 100644
--- a/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/index.html
+++ b/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/index.html
@@ -21,10 +21,10 @@
     <meta charset="UTF-8">
     <title>Apache Kyuubi REST API Documentation</title>
                <link rel="stylesheet" type="text/css" 
href="../static/semantic.min.css">
-               <link rel="stylesheet" type="text/css" href="./swagger-ui.css" 
/>
+               <link rel="stylesheet" type="text/css" 
href="../swagger-static/swagger-ui.css" />
                <link rel="stylesheet" type="text/css" 
href="../static/icon.min.css">
-               <link rel="icon" type="image/png" href="./favicon-32x32.png" 
sizes="32x32" />
-               <link rel="icon" type="image/png" href="./favicon-16x16.png" 
sizes="16x16" />
+               <link rel="icon" type="image/png" 
href="../swagger-static/favicon-32x32.png" sizes="32x32" />
+               <link rel="icon" type="image/png" 
href="../swagger-static/favicon-16x16.png" sizes="16x16" />
                <script src="../static/jquery-3.6.0.min.js"></script>
                <script src="../static/semantic.min.js"></script>
     <style>
@@ -69,8 +69,8 @@
 
                <div id="swagger-ui"></div>
 
-    <script src="./swagger-ui-bundle.js" charset="UTF-8"> </script>
-    <script src="./swagger-ui-standalone-preset.js" charset="UTF-8"> </script>
+    <script src="../swagger-static/swagger-ui-bundle.js" charset="UTF-8"> 
</script>
+    <script src="../swagger-static/swagger-ui-standalone-preset.js" 
charset="UTF-8"> </script>
     <script>
     window.onload = function() {
       // Begin Swagger UI call region
diff --git 
a/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/oauth2-redirect.html
 
b/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/oauth2-redirect.html
deleted file mode 100644
index adfecbb21..000000000
--- 
a/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/oauth2-redirect.html
+++ /dev/null
@@ -1,92 +0,0 @@
-<!--
-  ~ Licensed to the Apache Software Foundation (ASF) under one or more
-  ~ contributor license agreements.  See the NOTICE file distributed with
-  ~ this work for additional information regarding copyright ownership.
-  ~ The ASF licenses this file to You under the Apache License, Version 2.0
-  ~ (the "License"); you may not use this file except in compliance with
-  ~ the License.  You may obtain a copy of the License at
-  ~
-  ~    http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~ See the License for the specific language governing permissions and
-  ~ limitations under the License.
-  -->
-
-<!doctype html>
-<html lang="en">
-<head>
-    <title>Swagger UI: OAuth2 Redirect</title>
-</head>
-<body>
-<script>
-    'use strict';
-    function run () {
-        var oauth2 = window.opener.swaggerUIRedirectOauth2;
-        var sentState = oauth2.state;
-        var redirectUrl = oauth2.redirectUrl;
-        var isValid, qp, arr;
-
-        if (/code|token|error/.test(window.location.hash)) {
-            qp = window.location.hash.substring(1);
-        } else {
-            qp = location.search.substring(1);
-        }
-
-        arr = qp.split("&");
-        arr.forEach(function (v,i,_arr) { _arr[i] = '"' + v.replace('=', 
'":"') + '"';});
-        qp = qp ? JSON.parse('{' + arr.join() + '}',
-                function (key, value) {
-                    return key === "" ? value : decodeURIComponent(value);
-                }
-        ) : {};
-
-        isValid = qp.state === sentState;
-
-        if ((
-          oauth2.auth.schema.get("flow") === "accessCode" ||
-          oauth2.auth.schema.get("flow") === "authorizationCode" ||
-          oauth2.auth.schema.get("flow") === "authorization_code"
-        ) && !oauth2.auth.code) {
-            if (!isValid) {
-                oauth2.errCb({
-                    authId: oauth2.auth.name,
-                    source: "auth",
-                    level: "warning",
-                    message: "Authorization may be unsafe, passed state was 
changed in server Passed state wasn't returned from auth server"
-                });
-            }
-
-            if (qp.code) {
-                delete oauth2.state;
-                oauth2.auth.code = qp.code;
-                oauth2.callback({auth: oauth2.auth, redirectUrl: redirectUrl});
-            } else {
-                let oauthErrorMsg;
-                if (qp.error) {
-                    oauthErrorMsg = "["+qp.error+"]: " +
-                        (qp.error_description ? qp.error_description+ ". " : 
"no accessCode received from the server. ") +
-                        (qp.error_uri ? "More info: "+qp.error_uri : "");
-                }
-
-                oauth2.errCb({
-                    authId: oauth2.auth.name,
-                    source: "auth",
-                    level: "error",
-                    message: oauthErrorMsg || "[Authorization failed]: no 
accessCode received from the server"
-                });
-            }
-        } else {
-            oauth2.callback({auth: oauth2.auth, token: qp, isValid: isValid, 
redirectUrl: redirectUrl});
-        }
-        window.close();
-    }
-
-    window.addEventListener('DOMContentLoaded', function () {
-      run();
-    });
-</script>
-</body>
-</html>
diff --git 
a/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/swagger-ui-bundle.js
 
b/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/swagger-ui-bundle.js
deleted file mode 100644
index 2cbe107db..000000000
--- 
a/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/swagger-ui-bundle.js
+++ /dev/null
@@ -1,3 +0,0 @@
-/*! For license information please see swagger-ui-bundle.js.LICENSE.txt */
-!function(e,t){"object"==typeof exports&&"object"==typeof 
module?module.exports=t():"function"==typeof 
define&&define.amd?define([],t):"object"==typeof 
exports?exports.SwaggerUIBundle=t():e.SwaggerUIBundle=t()}(this,(function(){return
 function(e){var t={};function n(r){if(t[r])return t[r].exports;var 
o=t[r]={i:r,l:!1,exports:{}};return 
e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return 
n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r
 [...]
":95===e?" ":76===e?"\u2028":80===e?"\u2029":""}function oe(e){return 
e<=65535?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10),56320+(e-65536&1023))}for(var
 ae=new Array(256),ie=new 
Array(256),ue=0;ue<256;ue++)ae[ue]=re(ue)?1:0,ie[ue]=re(ue);function 
se(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||W,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledIm
 [...]
᠎"!=="​…᠎"[e]()||r&&a[e].name!==e}))}},function(e,t,n){var 
r=n(102),o=n(254);e.exports=function(e){return 
o(r(e).toLowerCase())}},function(e,t,n){var 
r=n(133),o=n(387),a=n(52),i=n(188),u=r?r.prototype:void 0,s=u?u.toString:void 
0;e.exports=function e(t){if("string"==typeof t)return t;if(a(t))return 
o(t,e)+"";if(i(t))return s?s.call(t):"";var 
n=t+"";return"0"==n&&1/t==-Infinity?"-0":n}},function(e,t,n){var 
r=n(664),o=n(389),a=n(665),i=n(102);e.exports=function(e){return 
function(t){t=i(t);var n=o( [...]
-//# sourceMappingURL=swagger-ui-bundle.js.map
\ No newline at end of file
diff --git 
a/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/swagger-ui-bundle.js.map
 
b/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/swagger-ui-bundle.js.map
deleted file mode 100644
index c4e47ba2f..000000000
--- 
a/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/swagger-ui-bundle.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["webpack://SwaggerUIBundle/webpack/universalModuleDefinition","webpack://SwaggerUIBundle/webpack/bootstrap","webpack://SwaggerUIBundle/./node_modules/react/index.js","webpack://SwaggerUIBundle/./node_modules/immutable/dist/immutable.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/concat.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/helpers/defineProperty.js","webpack://SwaggerUIBundle/./node_modul
 [...]
\ No newline at end of file
diff --git 
a/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/swagger-ui-es-bundle-core.js
 
b/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/swagger-ui-es-bundle-core.js
deleted file mode 100644
index bdab354b3..000000000
--- 
a/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/swagger-ui-es-bundle-core.js
+++ /dev/null
@@ -1,3 +0,0 @@
-/*! For license information please see 
swagger-ui-es-bundle-core.js.LICENSE.txt */
-module.exports=function(e){var t={};function n(r){if(t[r])return 
t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return 
e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return 
n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof
 
Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return
 e; [...]
᠎"!=="​…᠎"[e]()||r&&o[e].name!==e}))}},function(e,t,n){var 
r=n(98),a=n(230);e.exports=function(e){return 
a(r(e).toLowerCase())}},function(e,t,n){var 
r=n(122),a=n(358),o=n(52),i=n(175),s=r?r.prototype:void 0,c=s?s.toString:void 
0;e.exports=function e(t){if("string"==typeof t)return t;if(o(t))return 
a(t,e)+"";if(i(t))return c?c.call(t):"";var 
n=t+"";return"0"==n&&1/t==-Infinity?"-0":n}},function(e,t,n){var 
r=n(612),a=n(360),o=n(613),i=n(98);e.exports=function(e){return 
function(t){t=i(t);var n=a(t) [...]
-//# sourceMappingURL=swagger-ui-es-bundle-core.js.map
\ No newline at end of file
diff --git 
a/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/swagger-ui-es-bundle-core.js.map
 
b/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/swagger-ui-es-bundle-core.js.map
deleted file mode 100644
index 04f85671e..000000000
--- 
a/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/swagger-ui-es-bundle-core.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["webpack://SwaggerUIBundle/webpack/bootstrap","webpack://SwaggerUIBundle/external
 \"react\"","webpack://SwaggerUIBundle/external 
\"immutable\"","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/concat.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/helpers/defineProperty.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/map.js","webpack://SwaggerUIBundle/./src/co
 [...]
\ No newline at end of file
diff --git 
a/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/swagger-ui-es-bundle.js
 
b/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/swagger-ui-es-bundle.js
deleted file mode 100644
index b4f2375fc..000000000
--- 
a/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/swagger-ui-es-bundle.js
+++ /dev/null
@@ -1,3 +0,0 @@
-/*! For license information please see swagger-ui-es-bundle.js.LICENSE.txt */
-module.exports=function(e){var t={};function n(r){if(t[r])return 
t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return 
e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return 
n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof
 
Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return
 e; [...]
":95===e?" ":76===e?"\u2028":80===e?"\u2029":""}function oe(e){return 
e<=65535?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10),56320+(e-65536&1023))}for(var
 ae=new Array(256),ie=new 
Array(256),ue=0;ue<256;ue++)ae[ue]=re(ue)?1:0,ie[ue]=re(ue);function 
se(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||W,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledIm
 [...]
᠎"!=="​…᠎"[e]()||r&&a[e].name!==e}))}},function(e,t,n){var 
r=n(102),o=n(254);e.exports=function(e){return 
o(r(e).toLowerCase())}},function(e,t,n){var 
r=n(133),o=n(387),a=n(52),i=n(188),u=r?r.prototype:void 0,s=u?u.toString:void 
0;e.exports=function e(t){if("string"==typeof t)return t;if(a(t))return 
o(t,e)+"";if(i(t))return s?s.call(t):"";var 
n=t+"";return"0"==n&&1/t==-Infinity?"-0":n}},function(e,t,n){var 
r=n(664),o=n(389),a=n(665),i=n(102);e.exports=function(e){return 
function(t){t=i(t);var n=o( [...]
-//# sourceMappingURL=swagger-ui-es-bundle.js.map
\ No newline at end of file
diff --git 
a/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/swagger-ui-es-bundle.js.map
 
b/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/swagger-ui-es-bundle.js.map
deleted file mode 100644
index ef70fd0df..000000000
--- 
a/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/swagger-ui-es-bundle.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["webpack://SwaggerUIBundle/webpack/bootstrap","webpack://SwaggerUIBundle/./node_modules/react/index.js","webpack://SwaggerUIBundle/./node_modules/immutable/dist/immutable.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/concat.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/helpers/defineProperty.js","webpack://SwaggerUIBundle/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/map.js","web
 [...]
\ No newline at end of file
diff --git 
a/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/swagger-ui-standalone-preset.js
 
b/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/swagger-ui-standalone-preset.js
deleted file mode 100644
index 064e19085..000000000
--- 
a/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/swagger-ui-standalone-preset.js
+++ /dev/null
@@ -1,3 +0,0 @@
-/*! For license information please see 
swagger-ui-standalone-preset.js.LICENSE.txt */
-!function(t,e){"object"==typeof exports&&"object"==typeof 
module?module.exports=e():"function"==typeof 
define&&define.amd?define([],e):"object"==typeof 
exports?exports.SwaggerUIStandalonePreset=e():t.SwaggerUIStandalonePreset=e()}(this,(function(){return
 function(t){var e={};function n(r){if(e[r])return e[r].exports;var 
i=e[r]={i:r,l:!1,exports:{}};return 
t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return 
n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumer 
[...]
":95===t?" ":76===t?"\u2028":80===t?"\u2029":""}function it(t){return 
t<=65535?String.fromCharCode(t):String.fromCharCode(55296+(t-65536>>10),56320+(t-65536&1023))}for(var
 ot=new Array(256),ut=new 
Array(256),st=0;st<256;st++)ot[st]=rt(st)?1:0,ut[st]=rt(st);function 
at(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||G,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledIm
 [...]
᠎"!=="​…᠎"[t]()||r&&o[t].name!==t}))}},function(t,e,n){var 
r=n(71),i=n(151);t.exports=function(t){return 
i(r(t).toLowerCase())}},function(t,e,n){var 
r=n(92),i=n(420),o=n(26),u=n(93),s=r?r.prototype:void 0,a=s?s.toString:void 
0;t.exports=function t(e){if("string"==typeof e)return e;if(o(e))return 
i(e,t)+"";if(u(e))return a?a.call(e):"";var 
n=e+"";return"0"==n&&1/e==-Infinity?"-0":n}},function(t,e){t.exports=function(t,e){for(var
 n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i [...]
-//# sourceMappingURL=swagger-ui-standalone-preset.js.map
\ No newline at end of file
diff --git 
a/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/swagger-ui-standalone-preset.js.map
 
b/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/swagger-ui-standalone-preset.js.map
deleted file mode 100644
index 57cb62fee..000000000
--- 
a/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/swagger-ui-standalone-preset.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["webpack://SwaggerUIStandalonePreset/webpack/universalModuleDefinition","webpack://SwaggerUIStandalonePreset/webpack/bootstrap","webpack://SwaggerUIStandalonePreset/./node_modules/core-js-pure/internals/global.js","webpack://SwaggerUIStandalonePreset/./node_modules/immutable/dist/immutable.js","webpack://SwaggerUIStandalonePreset/./node_modules/core-js-pure/internals/export.js","webpack://SwaggerUIStandalonePreset/./node_modules/react/index.js","webpack://SwaggerU
 [...]
\ No newline at end of file
diff --git 
a/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/swagger-ui.css 
b/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/swagger-ui.css
deleted file mode 100644
index e43a572a1..000000000
--- 
a/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/swagger-ui.css
+++ /dev/null
@@ -1,4 +0,0 @@
-.swagger-ui{color:#3b4151;
-  /*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css 
*/font-family:sans-serif}.swagger-ui 
html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;line-height:1.15}.swagger-ui
 body{margin:0}.swagger-ui article,.swagger-ui aside,.swagger-ui 
footer,.swagger-ui header,.swagger-ui nav,.swagger-ui 
section{display:block}.swagger-ui h1{font-size:2em;margin:.67em 0}.swagger-ui 
figcaption,.swagger-ui figure,.swagger-ui main{display:block}.swagger-ui 
figure{margin:1em 40 [...]
-
-/*# sourceMappingURL=swagger-ui.css.map*/
\ No newline at end of file
diff --git 
a/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/swagger-ui.css.map
 
b/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/swagger-ui.css.map
deleted file mode 100644
index 715873f11..000000000
--- 
a/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/swagger-ui.css.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["webpack:///./src/style/main.scss","webpack:///./src/style/_type.scss","webpack:///./src/style/_variables.scss","webpack:///./node_modules/tachyons-sass/scss/_normalize.scss","webpack:///./node_modules/tachyons-sass/scss/_debug-children.scss","webpack:///./node_modules/tachyons-sass/scss/_debug-grid.scss","webpack:///./node_modules/tachyons-sass/scss/_box-sizing.scss","webpack:///./node_modules/tachyons-sass/scss/_aspect-ratios.scss","webpack:///./node_modules/tac
 [...]
\ No newline at end of file
diff --git 
a/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/swagger-ui.js 
b/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/swagger-ui.js
deleted file mode 100644
index c1cbc57ce..000000000
--- 
a/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/swagger-ui.js
+++ /dev/null
@@ -1,3 +0,0 @@
-/*! For license information please see swagger-ui.js.LICENSE.txt */
-!function(e,t){"object"==typeof exports&&"object"==typeof 
module?module.exports=t():"function"==typeof 
define&&define.amd?define([],t):"object"==typeof 
exports?exports.SwaggerUICore=t():e.SwaggerUICore=t()}(this,(function(){return 
function(e){var t={};function n(r){if(t[r])return t[r].exports;var 
a=t[r]={i:r,l:!1,exports:{}};return 
e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return 
n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=fun
 [...]
᠎"!=="​…᠎"[e]()||r&&o[e].name!==e}))}},function(e,t,n){var 
r=n(98),a=n(230);e.exports=function(e){return 
a(r(e).toLowerCase())}},function(e,t,n){var 
r=n(122),a=n(358),o=n(52),i=n(175),s=r?r.prototype:void 0,c=s?s.toString:void 
0;e.exports=function e(t){if("string"==typeof t)return t;if(o(t))return 
a(t,e)+"";if(i(t))return c?c.call(t):"";var 
n=t+"";return"0"==n&&1/t==-Infinity?"-0":n}},function(e,t,n){var 
r=n(612),a=n(360),o=n(613),i=n(98);e.exports=function(e){return 
function(t){t=i(t);var n=a(t) [...]
-//# sourceMappingURL=swagger-ui.js.map
\ No newline at end of file
diff --git 
a/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/swagger-ui.js.map
 
b/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/swagger-ui.js.map
deleted file mode 100644
index 90b78aaad..000000000
--- 
a/kyuubi-server/src/main/resources/org/apache/kyuubi/ui/swagger/swagger-ui.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["webpack://SwaggerUICore/webpack/universalModuleDefinition","webpack://SwaggerUICore/webpack/bootstrap","webpack://SwaggerUICore/external
 \"react\"","webpack://SwaggerUICore/external 
\"immutable\"","webpack://SwaggerUICore/./node_modules/@babel/runtime-corejs3/core-js-stable/instance/concat.js","webpack://SwaggerUICore/./node_modules/@babel/runtime-corejs3/helpers/defineProperty.js","webpack://SwaggerUICore/./node_modules/@babel/runtime-corejs3/core-js-stable/inst
 [...]
\ No newline at end of file
diff --git 
a/kyuubi-server/src/main/scala/org/apache/kyuubi/server/KyuubiRestFrontendService.scala
 
b/kyuubi-server/src/main/scala/org/apache/kyuubi/server/KyuubiRestFrontendService.scala
index 56065b357..964240ab0 100644
--- 
a/kyuubi-server/src/main/scala/org/apache/kyuubi/server/KyuubiRestFrontendService.scala
+++ 
b/kyuubi-server/src/main/scala/org/apache/kyuubi/server/KyuubiRestFrontendService.scala
@@ -84,6 +84,7 @@ class KyuubiRestFrontendService(override val serverable: 
Serverable)
     server.addStaticHandler("org/apache/kyuubi/ui/static", "/static/")
     server.addRedirectHandler("/", "/static/")
     server.addRedirectHandler("/static", "/static/")
+    server.addStaticHandler("META-INF/resources/webjars/swagger-ui/4.9.1/", 
"/swagger-static/")
     server.addStaticHandler("org/apache/kyuubi/ui/swagger", "/swagger/")
     server.addRedirectHandler("/docs", "/swagger/")
     server.addRedirectHandler("/docs/", "/swagger/")
diff --git a/pom.xml b/pom.xml
index de639d049..33d614bb9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -176,6 +176,7 @@
         
<spark.archive.mirror>${apache.archive.dist}/spark/spark-${spark.version}</spark.archive.mirror>
         <spark.archive.download.skip>false</spark.archive.download.skip>
         <swagger.version>2.2.1</swagger.version>
+        <swagger-ui.version>4.9.1</swagger-ui.version>
         <testcontainers-scala.version>0.40.7</testcontainers-scala.version>
         <thrift.version>0.9.3</thrift.version>
         <trino.client.version>363</trino.client.version>
@@ -867,6 +868,18 @@
                 </exclusions>
             </dependency>
 
+            <!--
+              1. This library only contains swagger-ui static resource 
(.html/.css/.js/.png), for more detail, see
+                 https://github.com/swagger-api/swagger-ui/blob/master/dist/
+              2. Note that when trying to upgrade swagger-ui, we should also 
update the version in the file(
+                 
kyuubi-server/src/main/scala/org/apache/kyuubi/server/KyuubiRestFrontendService.scala).
+            -->
+            <dependency>
+                <groupId>org.webjars</groupId>
+                <artifactId>swagger-ui</artifactId>
+                <version>${swagger-ui.version}</version>
+            </dependency>
+
             <dependency>
                 <groupId>io.netty</groupId>
                 <artifactId>netty-all</artifactId>

Reply via email to