Repository: knox Updated Branches: refs/heads/master 129774dbf -> 191b91409
KNOX-1628 - Trusted proxy support for Atlas and Ranger (Sailaja Polavarapu and Nixon Rodrigues via Sandeep More) Project: http://git-wip-us.apache.org/repos/asf/knox/repo Commit: http://git-wip-us.apache.org/repos/asf/knox/commit/191b9140 Tree: http://git-wip-us.apache.org/repos/asf/knox/tree/191b9140 Diff: http://git-wip-us.apache.org/repos/asf/knox/diff/191b9140 Branch: refs/heads/master Commit: 191b91409ee388637bcc9f67572a92c64b573148 Parents: 129774d Author: Sandeep More <m...@apache.org> Authored: Wed Nov 28 14:54:56 2018 -0500 Committer: Sandeep More <m...@apache.org> Committed: Wed Nov 28 14:54:56 2018 -0500 ---------------------------------------------------------------------- .../services/atlas-api/0.1.2.0/rewrite.xml | 23 ++++++ .../services/atlas-api/0.1.2.0/service.xml | 26 ++++++ .../services/atlas/0.1.2.0/rewrite.xml | 87 ++++++++++++++++++++ .../services/atlas/0.1.2.0/service.xml | 44 ++++++++++ .../services/ranger/0.1.0.0/rewrite.xml | 21 +++++ .../services/ranger/0.1.0.0/service.xml | 23 ++++++ 6 files changed, 224 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/knox/blob/191b9140/gateway-service-definitions/src/main/resources/services/atlas-api/0.1.2.0/rewrite.xml ---------------------------------------------------------------------- diff --git a/gateway-service-definitions/src/main/resources/services/atlas-api/0.1.2.0/rewrite.xml b/gateway-service-definitions/src/main/resources/services/atlas-api/0.1.2.0/rewrite.xml new file mode 100644 index 0000000..291b7d0 --- /dev/null +++ b/gateway-service-definitions/src/main/resources/services/atlas-api/0.1.2.0/rewrite.xml @@ -0,0 +1,23 @@ +<!-- + 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="ATLAS-API/atlas/inbound" pattern="*://*:*/**/atlas/api/{path=**}?{**}"> + <rewrite template="{$serviceUrl[ATLAS-API]}/api/{path=**}?{**}"/> + </rule> +</rules> http://git-wip-us.apache.org/repos/asf/knox/blob/191b9140/gateway-service-definitions/src/main/resources/services/atlas-api/0.1.2.0/service.xml ---------------------------------------------------------------------- diff --git a/gateway-service-definitions/src/main/resources/services/atlas-api/0.1.2.0/service.xml b/gateway-service-definitions/src/main/resources/services/atlas-api/0.1.2.0/service.xml new file mode 100644 index 0000000..95c571c --- /dev/null +++ b/gateway-service-definitions/src/main/resources/services/atlas-api/0.1.2.0/service.xml @@ -0,0 +1,26 @@ +<!-- + 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-API" name="atlas-api" version="0.1.2.0"> + + <routes> + <route path="/atlas/api/**"/> + </routes> + + <dispatch classname="org.apache.knox.gateway.dispatch.DefaultDispatch" ha-classname="org.apache.knox.gateway.ha.dispatch.AtlasApiHaDispatch"/> +</service> http://git-wip-us.apache.org/repos/asf/knox/blob/191b9140/gateway-service-definitions/src/main/resources/services/atlas/0.1.2.0/rewrite.xml ---------------------------------------------------------------------- diff --git a/gateway-service-definitions/src/main/resources/services/atlas/0.1.2.0/rewrite.xml b/gateway-service-definitions/src/main/resources/services/atlas/0.1.2.0/rewrite.xml new file mode 100644 index 0000000..84b4edf --- /dev/null +++ b/gateway-service-definitions/src/main/resources/services/atlas/0.1.2.0/rewrite.xml @@ -0,0 +1,87 @@ +<!-- + 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/links" pattern="css/{**}"> + <rewrite template="{$frontend[path]}/atlas/css/{**}"/> + </rule> + + + <rule dir="OUT" name="ATLAS/atlas/outbound/links" pattern="js/{**}"> + <rewrite template="{$frontend[path]}/atlas/js/{**}"/> + </rule> + + <rule dir="OUT" name="ATLAS/atlas/outbound/styles" pattern="img/{**}"> + <rewrite template="{$frontend[path]}/atlas/img/{**}"/> + </rule> + + + <rule dir="OUT" name="ATLAS/atlas/outbound/contextpath"> + <rewrite template="{$frontend[path]}/atlas/"/> + </rule> + + <rule dir="OUT" name="ATLAS/atlas/outbound/extrapath"> + <rewrite template="{$frontend[topology]}/atlas/j_spring_security_check"/> + </rule> + + <rule dir="OUT" name="ATLAS/atlas/outbound/index"> + <rewrite template="{$frontend[path]}/atlas/index.html"/> + </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/links"> + <content type="*/x-javascript"> + <apply path="j_spring_security_check" rule="ATLAS/atlas/outbound/extrapath"/> + <apply path="index.html" rule="ATLAS/atlas/outbound/index"/> + </content> + <content type="application/javascript"> + <apply path="j_spring_security_check" rule="ATLAS/atlas/outbound/extrapath"/> + <apply path="index.html" rule="ATLAS/atlas/outbound/index"/> + </content> + <content type="*/html"> + </content> + </filter> + + <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> http://git-wip-us.apache.org/repos/asf/knox/blob/191b9140/gateway-service-definitions/src/main/resources/services/atlas/0.1.2.0/service.xml ---------------------------------------------------------------------- diff --git a/gateway-service-definitions/src/main/resources/services/atlas/0.1.2.0/service.xml b/gateway-service-definitions/src/main/resources/services/atlas/0.1.2.0/service.xml new file mode 100644 index 0000000..bd3ab8e --- /dev/null +++ b/gateway-service-definitions/src/main/resources/services/atlas/0.1.2.0/service.xml @@ -0,0 +1,44 @@ +<!-- + 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="0.1.2.0"> + +<routes> + + <route path="/atlas"> + <rewrite apply="ATLAS/atlas/inbound/root" to="request.url"/> + <rewrite apply="ATLAS/atlas/outbound/links" to="response.body"/> + <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/links" to="response.body"/> + <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/links" to="response.body"/> + <rewrite apply="ATLAS/atlas/outbound/headers" to="response.headers"/> + </route> + + </routes> + + <dispatch classname="org.apache.knox.gateway.dispatch.DefaultDispatch" ha-classname="org.apache.knox.gateway.ha.dispatch.AtlasHaDispatch" /> + +</service> http://git-wip-us.apache.org/repos/asf/knox/blob/191b9140/gateway-service-definitions/src/main/resources/services/ranger/0.1.0.0/rewrite.xml ---------------------------------------------------------------------- diff --git a/gateway-service-definitions/src/main/resources/services/ranger/0.1.0.0/rewrite.xml b/gateway-service-definitions/src/main/resources/services/ranger/0.1.0.0/rewrite.xml new file mode 100644 index 0000000..772c271 --- /dev/null +++ b/gateway-service-definitions/src/main/resources/services/ranger/0.1.0.0/rewrite.xml @@ -0,0 +1,21 @@ +<!-- + 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="RANGER/ranger/inbound" pattern="*://*:*/**/ranger/service/public/{path=**}?{**}"> + <rewrite template="{$serviceUrl[RANGER]}/service/public/{path=**}?{**}"/> + </rule> +</rules> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/knox/blob/191b9140/gateway-service-definitions/src/main/resources/services/ranger/0.1.0.0/service.xml ---------------------------------------------------------------------- diff --git a/gateway-service-definitions/src/main/resources/services/ranger/0.1.0.0/service.xml b/gateway-service-definitions/src/main/resources/services/ranger/0.1.0.0/service.xml new file mode 100644 index 0000000..fc95bd5 --- /dev/null +++ b/gateway-service-definitions/src/main/resources/services/ranger/0.1.0.0/service.xml @@ -0,0 +1,23 @@ +<!-- + 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="RANGER" name="ranger" version="0.1.0.0"> + <routes> + <route path="/ranger/service/public/**"/> + </routes> + <dispatch classname="org.apache.knox.gateway.dispatch.DefaultDispatch"/> +</service> +