Repository: knox Updated Branches: refs/heads/master 2190ce463 -> 2fd544593
KNOX-1649 - Provide new service definitions for Ambari to support trusted proxy Signed-off-by: Kevin Risden <kris...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/knox/repo Commit: http://git-wip-us.apache.org/repos/asf/knox/commit/2fd54459 Tree: http://git-wip-us.apache.org/repos/asf/knox/tree/2fd54459 Diff: http://git-wip-us.apache.org/repos/asf/knox/diff/2fd54459 Branch: refs/heads/master Commit: 2fd54459357188e16cca1b6d64e9064e04f20cb2 Parents: 2190ce4 Author: Kevin Risden <kris...@apache.org> Authored: Mon Dec 3 12:18:11 2018 -0500 Committer: Kevin Risden <kris...@apache.org> Committed: Mon Dec 3 12:18:43 2018 -0500 ---------------------------------------------------------------------- .../services/ambari/0.2.2.0/rewrite.xml | 39 ++++++++++++++++++++ .../services/ambari/0.2.2.0/service.xml | 27 ++++++++++++++ 2 files changed, 66 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/knox/blob/2fd54459/gateway-service-definitions/src/main/resources/services/ambari/0.2.2.0/rewrite.xml ---------------------------------------------------------------------- diff --git a/gateway-service-definitions/src/main/resources/services/ambari/0.2.2.0/rewrite.xml b/gateway-service-definitions/src/main/resources/services/ambari/0.2.2.0/rewrite.xml new file mode 100644 index 0000000..7cfc670 --- /dev/null +++ b/gateway-service-definitions/src/main/resources/services/ambari/0.2.2.0/rewrite.xml @@ -0,0 +1,39 @@ +<!-- + 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="AMBARI/ambari/inbound" pattern="*://*:*/**/ambari/api/v1/{**}?{**}"> + <rewrite template="{$serviceUrl[AMBARI]}/api/v1/{**}?{**}"/> + </rule> + <rule dir="OUT" name="AMBARI/ambari/href/outbound"> + <match pattern="*://*:*/api/{**}?{**}"/> + <rewrite template="{$frontend[url]}/ambari/api/{**}?{**}"/> + </rule> + <rule dir="OUT" name="AMBARI/ambari/context_path/outbound"> + <match pattern="/{**}"/> + <rewrite template="{$frontend[path]}/ambari/{**}"/> + </rule> + <filter name="AMBARI/ambari/api/outbound"> + <content type="text/plain" asType="application/json"> + <apply path="$.**.href" rule="AMBARI/ambari/href/outbound"/> + <apply path="$.**.context_path" rule="AMBARI/ambari/context_path/outbound"/> + </content> + </filter> + <filter name="AMBARI/ambari/api/inbound"> + <content type="application/x-www-form-urlencoded" asType="application/octet-stream"> + </content> + </filter> +</rules> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/knox/blob/2fd54459/gateway-service-definitions/src/main/resources/services/ambari/0.2.2.0/service.xml ---------------------------------------------------------------------- diff --git a/gateway-service-definitions/src/main/resources/services/ambari/0.2.2.0/service.xml b/gateway-service-definitions/src/main/resources/services/ambari/0.2.2.0/service.xml new file mode 100644 index 0000000..be90219 --- /dev/null +++ b/gateway-service-definitions/src/main/resources/services/ambari/0.2.2.0/service.xml @@ -0,0 +1,27 @@ +<!-- + 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="AMBARI" name="ambari" version="0.2.2.0"> + <routes> + <route path="/ambari/api/v1/**"> + <rewrite apply="AMBARI/ambari/api/outbound" to="response.body"/> + <rewrite apply="AMBARI/ambari/api/inbound" to="request.body"/> + </route> + <route path="/ambari/api/v1/persist/*?*"> + <rewrite apply="AMBARI/ambari/api/inbound" to="request.body"/> + </route> + </routes> +</service>