Repository: knox
Updated Branches:
  refs/heads/master d6c681669 -> e4033958a


KNOX-1368 - Add websocket proxy support for Ambari 2.7.0


Project: http://git-wip-us.apache.org/repos/asf/knox/repo
Commit: http://git-wip-us.apache.org/repos/asf/knox/commit/e4033958
Tree: http://git-wip-us.apache.org/repos/asf/knox/tree/e4033958
Diff: http://git-wip-us.apache.org/repos/asf/knox/diff/e4033958

Branch: refs/heads/master
Commit: e4033958a007e0d659936c2b806986bf6801ce49
Parents: d6c6816
Author: Sandeep More <[email protected]>
Authored: Thu Jun 28 13:28:31 2018 -0400
Committer: Sandeep More <[email protected]>
Committed: Thu Jun 28 13:28:31 2018 -0400

----------------------------------------------------------------------
 .../services/ambariui/2.2.0/rewrite.xml         |  9 ++++++
 .../services/ambariws/2.2.0/rewrite.xml         | 25 +++++++++++++++
 .../services/ambariws/2.2.0/service.xml         | 33 ++++++++++++++++++++
 3 files changed, 67 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/e4033958/gateway-service-definitions/src/main/resources/services/ambariui/2.2.0/rewrite.xml
----------------------------------------------------------------------
diff --git 
a/gateway-service-definitions/src/main/resources/services/ambariui/2.2.0/rewrite.xml
 
b/gateway-service-definitions/src/main/resources/services/ambariui/2.2.0/rewrite.xml
index 9b15223..59cfd76 100644
--- 
a/gateway-service-definitions/src/main/resources/services/ambariui/2.2.0/rewrite.xml
+++ 
b/gateway-service-definitions/src/main/resources/services/ambariui/2.2.0/rewrite.xml
@@ -54,6 +54,11 @@
         <rewrite template="{$frontend[path]}/ambari/javascripts/app.js"/>
     </rule>
 
+    <!-- WS support -->
+    <rule dir="OUT" name="AMBARIUI/ambari/outbound/websocket">
+        <rewrite template="{$frontend[path]}/ambariws/api/stomp/v1"/>
+    </rule>
+
     <filter name="AMBARIUI/ambari/outbound/proxyroot">
         <content type="*/x-javascript">
             <apply path="\{proxy_root\}" 
rule="AMBARIUI/ambari/outbound/sitepath"/>
@@ -95,12 +100,16 @@
             <apply path="/img/" rule="AMBARIUI/ambari/outbound/img"/>
             <apply path="\{proxy_root\}" 
rule="AMBARIUI/ambari/outbound/sitepath"/>
             <apply path="/#/main/dashboard" 
rule="AMBARIUI/ambari/outbound/logohref"/>
+            <!-- WS support -->
+            <apply path="/api/stomp/v1" 
rule="AMBARIUI/ambari/outbound/websocket"/>
         </content>
         <content type="application/javascript">
             <apply path="/api/v1" rule="AMBARIUI/ambari/outbound/extrapath"/>
             <apply path="/img/" rule="AMBARIUI/ambari/outbound/img"/>
             <apply path="\{proxy_root\}" 
rule="AMBARIUI/ambari/outbound/sitepath"/>
             <apply path="/#/main/dashboard" 
rule="AMBARIUI/ambari/outbound/logohref"/>
+            <!-- WS support -->
+            <apply path="/api/stomp/v1" 
rule="AMBARIUI/ambari/outbound/websocket"/>
         </content>
         <content type="*/html">
         </content>

http://git-wip-us.apache.org/repos/asf/knox/blob/e4033958/gateway-service-definitions/src/main/resources/services/ambariws/2.2.0/rewrite.xml
----------------------------------------------------------------------
diff --git 
a/gateway-service-definitions/src/main/resources/services/ambariws/2.2.0/rewrite.xml
 
b/gateway-service-definitions/src/main/resources/services/ambariws/2.2.0/rewrite.xml
new file mode 100644
index 0000000..6438f17
--- /dev/null
+++ 
b/gateway-service-definitions/src/main/resources/services/ambariws/2.2.0/rewrite.xml
@@ -0,0 +1,25 @@
+<!--
+   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.
+-->
+<rules>
+    <rule dir="IN" name="AMBARIWS/ambariws/inbound/ws">
+        <rewrite template="{$serviceUrl[AMBARIWS]}/"/>
+    </rule>
+    <rule dir="IN" name="AMBARIWS/ambariws/inbound/js" 
pattern="*://*:*/**/ambariws/{**}?{**}">
+        <rewrite template="{$serviceUrl[AMBARIUI]}/{**}?{**}"/>
+    </rule>
+</rules>
+

http://git-wip-us.apache.org/repos/asf/knox/blob/e4033958/gateway-service-definitions/src/main/resources/services/ambariws/2.2.0/service.xml
----------------------------------------------------------------------
diff --git 
a/gateway-service-definitions/src/main/resources/services/ambariws/2.2.0/service.xml
 
b/gateway-service-definitions/src/main/resources/services/ambariws/2.2.0/service.xml
new file mode 100644
index 0000000..8f3b8a7
--- /dev/null
+++ 
b/gateway-service-definitions/src/main/resources/services/ambariws/2.2.0/service.xml
@@ -0,0 +1,33 @@
+<!--
+   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.
+-->
+<service role="AMBARIWS" name="ambariws" version="2.2.0">
+    <policies>
+        <policy role="webappsec"/>
+        <policy role="authentication" name="Anonymous"/>
+        <policy role="rewrite"/>
+        <policy role="authorization"/>
+    </policies>
+    <routes>
+        <route path="/ambariws/**?**">
+            <rewrite apply="AMBARIWS/ambariws/inbound/js" to="request.url"/>
+        </route>
+        <route path="/ambariws/**/websocket">
+            <rewrite apply="AMBARIWS/ambariws/inbound/ws" to="request.url"/>
+        </route>
+    </routes>
+</service>
+

Reply via email to