You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@knox.apache.org by su...@apache.org on 2017/03/02 20:49:45 UTC

knox git commit: KNOX-841 Proxy suuport for Solr UI and API

Repository: knox
Updated Branches:
  refs/heads/master 5ae580ed0 -> 56d444fd8


KNOX-841 Proxy suuport for Solr UI and API


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

Branch: refs/heads/master
Commit: 56d444fd8c43c928719af1054ba54762d37408cb
Parents: 5ae580e
Author: Sumit Gupta <su...@apache.org>
Authored: Thu Mar 2 15:48:55 2017 -0500
Committer: Sumit Gupta <su...@apache.org>
Committed: Thu Mar 2 15:48:55 2017 -0500

----------------------------------------------------------------------
 .../resources/services/solr/6.1.0/rewrite.xml   | 36 ++++++++++++++++++++
 .../resources/services/solr/6.1.0/service.xml   | 28 +++++++++++++++
 2 files changed, 64 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/56d444fd/gateway-service-definitions/src/main/resources/services/solr/6.1.0/rewrite.xml
----------------------------------------------------------------------
diff --git a/gateway-service-definitions/src/main/resources/services/solr/6.1.0/rewrite.xml b/gateway-service-definitions/src/main/resources/services/solr/6.1.0/rewrite.xml
new file mode 100644
index 0000000..dec62c9
--- /dev/null
+++ b/gateway-service-definitions/src/main/resources/services/solr/6.1.0/rewrite.xml
@@ -0,0 +1,36 @@
+<?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>
+  <!-- inbound rules -->
+  <rule dir="IN" name="SOLR/solr/inbound/root" pattern="*://*:*/**/solr/">
+    <rewrite template="{$serviceUrl[SOLR]}/"/>
+  </rule>
+  <rule dir="IN" name="SOLR/solr/inbound/query" pattern="*://*:*/**/solr/{**}?{**}">
+    <rewrite template="{$serviceUrl[SOLR]}/{**}?{**}"/>
+  </rule>
+
+  <filter name="SOLR/solr/outbound/filter/contextpath">
+    <content type="application/javascript">
+      <apply path="\/solr\/" rule="SOLR/solr/outbound/contextpath"/>
+    </content>
+  </filter>
+
+  <rule dir="OUT" name="SOLR/solr/outbound/contextpath">
+    <rewrite template="{$frontend[path]}/solr/"/>
+  </rule>
+</rules>

http://git-wip-us.apache.org/repos/asf/knox/blob/56d444fd/gateway-service-definitions/src/main/resources/services/solr/6.1.0/service.xml
----------------------------------------------------------------------
diff --git a/gateway-service-definitions/src/main/resources/services/solr/6.1.0/service.xml b/gateway-service-definitions/src/main/resources/services/solr/6.1.0/service.xml
new file mode 100644
index 0000000..65eccc0
--- /dev/null
+++ b/gateway-service-definitions/src/main/resources/services/solr/6.1.0/service.xml
@@ -0,0 +1,28 @@
+<?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="SOLR" name="solr" version="6.1.0">
+    <routes>
+        <route path="/solr/">
+            <rewrite apply="SOLR/solr/inbound/root" to="request.url"/>
+        </route>
+        <route path="/solr/**?**">
+            <rewrite apply="SOLR/solr/inbound/query" to="request.url"/>
+            <rewrite apply="SOLR/solr/outbound/filter/contextpath" to="response.body"/>
+        </route>
+    </routes>
+</service>