Repository: knox Updated Branches: refs/heads/master e844eff90 -> b152de65c
KNOX-1155 - Knox Gateway Service for ElasticSearch (Dequan Chen via lmccay) Project: http://git-wip-us.apache.org/repos/asf/knox/repo Commit: http://git-wip-us.apache.org/repos/asf/knox/commit/b152de65 Tree: http://git-wip-us.apache.org/repos/asf/knox/tree/b152de65 Diff: http://git-wip-us.apache.org/repos/asf/knox/diff/b152de65 Branch: refs/heads/master Commit: b152de65c5e81b055198ce52c959157c0604aa82 Parents: e844eff Author: Larry McCay <[email protected]> Authored: Tue Jul 3 18:39:54 2018 -0400 Committer: Larry McCay <[email protected]> Committed: Tue Jul 3 18:41:22 2018 -0400 ---------------------------------------------------------------------- .../services/elasticsearch/1.0.0/rewrite.xml | 26 +++++++++++++++++ .../services/elasticsearch/1.0.0/service.xml | 30 ++++++++++++++++++++ 2 files changed, 56 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/knox/blob/b152de65/gateway-service-definitions/src/main/resources/services/elasticsearch/1.0.0/rewrite.xml ---------------------------------------------------------------------- diff --git a/gateway-service-definitions/src/main/resources/services/elasticsearch/1.0.0/rewrite.xml b/gateway-service-definitions/src/main/resources/services/elasticsearch/1.0.0/rewrite.xml new file mode 100644 index 0000000..f99fd27 --- /dev/null +++ b/gateway-service-definitions/src/main/resources/services/elasticsearch/1.0.0/rewrite.xml @@ -0,0 +1,26 @@ +<?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="ELASTICSEARCH/elasticsearch/inbound/root" pattern="*://*:*/**/elasticsearch/"> + <rewrite template="{$serviceUrl[ELASTICSEARCH]}/"/> + </rule> + <rule dir="IN" name="ELASTICSEARCH/elasticsearch/inbound/path" pattern="*://*:*/**/elasticsearch/{path=**}?{**}"> + <rewrite template="{$serviceUrl[ELASTICSEARCH]}/{path=**}?{**}"/> + </rule> +</rules> http://git-wip-us.apache.org/repos/asf/knox/blob/b152de65/gateway-service-definitions/src/main/resources/services/elasticsearch/1.0.0/service.xml ---------------------------------------------------------------------- diff --git a/gateway-service-definitions/src/main/resources/services/elasticsearch/1.0.0/service.xml b/gateway-service-definitions/src/main/resources/services/elasticsearch/1.0.0/service.xml new file mode 100644 index 0000000..fdf5603 --- /dev/null +++ b/gateway-service-definitions/src/main/resources/services/elasticsearch/1.0.0/service.xml @@ -0,0 +1,30 @@ +<?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="ELASTICSEARCH" name="elasticsearch" version="1.0.0"> + <policies> + <policy role="webappsec"/> + <policy role="authentication" name="Anonymous"/> + <policy role="rewrite"/> + </policies> + <routes> + <route path="/elasticsearch"/> + <route path="/elasticsearch/**"/> + </routes> + <dispatch classname="org.apache.hadoop.gateway.dispatch.PassAllHeadersDispatch"/> +</service>
