You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@knox.apache.org by mo...@apache.org on 2019/08/28 14:22:26 UTC

[knox] branch master updated: KNOX-1992: Add a service definition for Impala's debug web pages (#137)

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

more pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/knox.git


The following commit(s) were added to refs/heads/master by this push:
     new af2699b  KNOX-1992: Add a service definition for Impala's debug web pages (#137)
af2699b is described below

commit af2699b6087c710ec674db515b69a4c7705c05ab
Author: Thomas Tauber-Marshall <tm...@cloudera.com>
AuthorDate: Wed Aug 28 07:22:21 2019 -0700

    KNOX-1992: Add a service definition for Impala's debug web pages (#137)
    
    Allows for proxying connections to Impala's debug web pages.
    
    Change-Id: I85426d2844b1a6c01d9057362aee0abadfd648f6
---
 .../resources/services/impalaui/1.0.0/rewrite.xml  | 40 ++++++++++++++++++++++
 .../resources/services/impalaui/1.0.0/service.xml  | 27 +++++++++++++++
 2 files changed, 67 insertions(+)

diff --git a/gateway-service-definitions/src/main/resources/services/impalaui/1.0.0/rewrite.xml b/gateway-service-definitions/src/main/resources/services/impalaui/1.0.0/rewrite.xml
new file mode 100644
index 0000000..7affe0f
--- /dev/null
+++ b/gateway-service-definitions/src/main/resources/services/impalaui/1.0.0/rewrite.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+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="IMPALAUI/impala/inbound/extrapath">
+    <match pattern="*://*:*/**/impalaui/{**}?{scheme}?{host}?{port}?{**}"/>
+    <rewrite template="{scheme}://{host}:{port}/{**}?{**}"/>
+  </rule>
+
+  <rule dir="IN" name="IMPALAUI/impala/inbound/basepath">
+    <match pattern="*://*:*/**/impalaui/?{scheme}?{host}?{port}?{**}"/>
+    <rewrite template="{scheme}://{host}:{port}/?{**}"/>
+  </rule>
+
+  <rule dir="OUT" name="IMPALAUI/cssi-and-js" pattern="{scheme}://{host}:{port}/www/{path=**}">
+    <rewrite template="{$frontend[url]}/impalaui/www/{path}?scheme={scheme}?host={host}?port={port}"/>
+  </rule>
+
+  <rule dir="OUT" name="IMPALAUI/impala/outbound/extrapath" pattern="{scheme}://{host}:{port}/{path=**}?{**}">
+    <rewrite template="{$frontend[path]}/impalaui/{path}?scheme={scheme}?host={host}?port={port}?{**}"/>
+  </rule>
+
+  <rule dir="OUT" name="IMPALAUI/impala/outbound/basepath" pattern="{scheme}://{host}:{port}/?{**}">
+    <rewrite template="{$frontend[path]}/impalaui/?scheme={scheme}?host={host}?port={port}?{**}"/>
+  </rule>
+</rules>
diff --git a/gateway-service-definitions/src/main/resources/services/impalaui/1.0.0/service.xml b/gateway-service-definitions/src/main/resources/services/impalaui/1.0.0/service.xml
new file mode 100644
index 0000000..3fe808a
--- /dev/null
+++ b/gateway-service-definitions/src/main/resources/services/impalaui/1.0.0/service.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+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="IMPALAUI" name="impalaui" version="1.0.0">
+  <routes>
+    <route path="/impalaui/">
+      <rewrite apply="IMPALAUI/impala/inbound/basepath" to="request.url"/>
+    </route>
+    <route path="/impalaui/**">
+      <rewrite apply="IMPALAUI/impala/inbound/extrapath" to="request.url"/>
+    </route>
+  </routes>
+</service>