KNOX-2355 - Update Atlas rewrite.xml/service.xml for new Atlas UI changes (#323)
diff --git a/gateway-service-definitions/src/main/resources/services/atlas/2.1.0/rewrite.xml b/gateway-service-definitions/src/main/resources/services/atlas/2.1.0/rewrite.xml
new file mode 100644
index 0000000..c825e1a
--- /dev/null
+++ b/gateway-service-definitions/src/main/resources/services/atlas/2.1.0/rewrite.xml
@@ -0,0 +1,45 @@
+<!--
+ 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="ATLAS/atlas/inbound/root" pattern="*://*:*/**/atlas/">
+ <rewrite template="{$serviceUrl[ATLAS]}/"/>
+ </rule>
+
+ <rule dir="IN" name="ATLAS/atlas/inbound/path" pattern="*://*:*/**/atlas/{**}">
+ <rewrite template="{$serviceUrl[ATLAS]}/{**}"/>
+ </rule>
+
+ <rule dir="IN" name="ATLAS/atlas/inbound/query" pattern="*://*:*/**/atlas/{**}?{**}">
+ <rewrite template="{$serviceUrl[ATLAS]}/{**}?{**}"/>
+ </rule>
+
+ <rule dir="OUT" name="ATLAS/atlas/outbound/contextpath">
+ <rewrite template="{$frontend[path]}/atlas/"/>
+ </rule>
+
+ <rule dir="OUT" name="ATLAS/atlas/outbound/login/headers/location">
+ <match pattern="*://*:*/login.jsp"/>
+ <rewrite template="{$frontend[url]}/atlas/login.jsp"/>
+ </rule>
+
+ <filter name="ATLAS/atlas/outbound/headers">
+ <content type="application/x-http-headers">
+ <apply path="Location" rule="ATLAS/atlas/outbound/login/headers/location"/>
+ </content>
+ </filter>
+</rules>
diff --git a/gateway-service-definitions/src/main/resources/services/atlas/2.1.0/service.xml b/gateway-service-definitions/src/main/resources/services/atlas/2.1.0/service.xml
new file mode 100644
index 0000000..b951bfe
--- /dev/null
+++ b/gateway-service-definitions/src/main/resources/services/atlas/2.1.0/service.xml
@@ -0,0 +1,48 @@
+<!--
+ 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="ATLAS" name="atlas" version="2.1.0">
+ <metadata>
+ <type>UI</type>
+ <context>/atlas</context>
+ <shortDesc>Atlas UI</shortDesc>
+ <description>Apache Atlas provides open metadata management and governance capabilities for organizations to build a catalog of their data assets,
+ classify and govern these assets and provide collaboration capabilities around these data assets for data scientists, analysts and the data governance team.</description>
+ </metadata>
+ <routes>
+ <route path="/atlas">
+ <rewrite apply="ATLAS/atlas/inbound/root" to="request.url"/>
+ <rewrite apply="ATLAS/atlas/outbound/headers" to="response.headers"/>
+ </route>
+
+ <route path="/atlas/**">
+ <rewrite apply="ATLAS/atlas/inbound/path" to="request.url"/>
+ <rewrite apply="ATLAS/atlas/outbound/headers" to="response.headers"/>
+ </route>
+
+ <route path="/atlas/**?**">
+ <rewrite apply="ATLAS/atlas/inbound/query" to="request.url"/>
+ <rewrite apply="ATLAS/atlas/outbound/headers" to="response.headers"/>
+ </route>
+ </routes>
+
+ <dispatch classname="org.apache.knox.gateway.dispatch.ConfigurableDispatch" ha-classname="org.apache.knox.gateway.ha.dispatch.AtlasTrustedProxyHaDispatch" >
+ <param>
+ <name>responseExcludeHeaders</name>
+ <value>WWW-AUTHENTICATE</value>
+ </param>
+ </dispatch>
+</service>