Repository: knox Updated Branches: refs/heads/master b9a30a3e8 -> 7458fa670
KNOX-710 - Support Zeppelin UI through Knox Project: http://git-wip-us.apache.org/repos/asf/knox/repo Commit: http://git-wip-us.apache.org/repos/asf/knox/commit/7458fa67 Tree: http://git-wip-us.apache.org/repos/asf/knox/tree/7458fa67 Diff: http://git-wip-us.apache.org/repos/asf/knox/diff/7458fa67 Branch: refs/heads/master Commit: 7458fa67095ccefaf4f8ac80512c67c90d4266cb Parents: b9a30a3 Author: Larry McCay <lmc...@hortonworks.com> Authored: Tue Jan 10 13:55:07 2017 -0500 Committer: Larry McCay <lmc...@hortonworks.com> Committed: Tue Jan 10 13:55:07 2017 -0500 ---------------------------------------------------------------------- .../services/zeppelinui/0.6.0/rewrite.xml | 91 ++++++++++++++++++++ .../services/zeppelinui/0.6.0/service.xml | 66 ++++++++++++++ .../services/zeppelinws/0.6.0/rewrite.xml | 27 ++++++ .../services/zeppelinws/0.6.0/service.xml | 34 ++++++++ 4 files changed, 218 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/knox/blob/7458fa67/gateway-service-definitions/src/main/resources/services/zeppelinui/0.6.0/rewrite.xml ---------------------------------------------------------------------- diff --git a/gateway-service-definitions/src/main/resources/services/zeppelinui/0.6.0/rewrite.xml b/gateway-service-definitions/src/main/resources/services/zeppelinui/0.6.0/rewrite.xml new file mode 100644 index 0000000..595b4e1 --- /dev/null +++ b/gateway-service-definitions/src/main/resources/services/zeppelinui/0.6.0/rewrite.xml @@ -0,0 +1,91 @@ +<?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="ZEPPELINUI/zeppelin/inbound/root" pattern="*://*:*/**/zeppelin/"> + <rewrite template="{$serviceUrl[ZEPPELINUI]}/"/> + </rule> + + + <rule dir="IN" name="ZEPPELINUI/zeppelin/inbound/notebook" pattern="*://*:*/**/zeppelin/{**}/notebook/{**}"> + <rewrite template="{$serviceUrl[ZEPPELINUI]}/{**}/notebook/{**}"/> + </rule> + + <rule dir="IN" name="ZEPPELINUI/zeppelin/inbound/interpreter" pattern="*://*:*/**/zeppelin/{**}/interpreter/{**}"> + <rewrite template="{$serviceUrl[ZEPPELINUI]}/{**}/interpreter/{**}"/> + </rule> + + <rule dir="IN" name="ZEPPELINUI/zeppelin/inbound/credential" pattern="*://*:*/**/zeppelin/{**}/credential/{**}"> + <rewrite template="{$serviceUrl[ZEPPELINUI]}/{**}/credential/{**}"/> + </rule> + + <rule dir="IN" name="ZEPPELINUI/zeppelin/inbound/configuration" pattern="*://*:*/**/zeppelin/{**}/configuration/{**}"> + <rewrite template="{$serviceUrl[ZEPPELINUI]}/{**}/configuration/{**}"/> + </rule> + + <rule dir="IN" name="ZEPPELINUI/zeppelin/inbound/api" pattern="*://*:*/**/zeppelin/api/{**}"> + <rewrite template="{$serviceUrl[ZEPPELINUI]}/api/{**}"/> + </rule> + + <rule dir="IN" name="ZEPPELINUI/zeppelin/inbound/components" pattern="*://*:*/**/zeppelin/components/{**}"> + <rewrite template="{$serviceUrl[ZEPPELINUI]}/components/{**}"/> + </rule> + + <rule dir="IN" name="ZEPPELINUI/zeppelin/inbound/app" pattern="*://*:*/**/zeppelin/app/{**}"> + <rewrite template="{$serviceUrl[ZEPPELINUI]}/app/{**}"/> + </rule> + + <rule dir="IN" name="ZEPPELINUI/zeppelin/inbound/app/notebook" pattern="*://*:*/**/zeppelin/app/notebook/{**}"> + <rewrite template="{$serviceUrl[ZEPPELINUI]}/app/notebook/{**}"/> + </rule> + + <!-- Resources --> + + <rule dir="IN" name="ZEPPELINUI/zeppelin/inbound/styles" pattern="*://*:*/**/zeppelin/styles/{**}"> + <rewrite template="{$serviceUrl[ZEPPELINUI]}/styles/{**}"/> + </rule> + + <rule dir="IN" name="ZEPPELINUI/zeppelin/inbound/scripts" pattern="*://*:*/**/zeppelin/scripts/{**}"> + <rewrite template="{$serviceUrl[ZEPPELINUI]}/scripts/{**}"/> + </rule> + + <rule dir="IN" name="ZEPPELINUI/zeppelin/inbound/assets" pattern="*://*:*/**/zeppelin/assets/{**}"> + <rewrite template="{$serviceUrl[ZEPPELINUI]}/assets/{**}"/> + </rule> + + <rule dir="IN" name="ZEPPELINUI/zeppelin/inbound/fonts" pattern="*://*:*/**/zeppelin/fonts/{**}"> + <rewrite template="{$serviceUrl[ZEPPELINUI]}/fonts/{**}"/> + </rule> + + + <rule dir="OUT" name="ZEPPELINUI/zeppelin/outbound/css" pattern="styles/{**}"> + <rewrite template="{$frontend[path]}/zeppelin/styles/{**}"/> + </rule> + + <rule dir="OUT" name="ZEPPELINUI/zeppelin/outbound/assets/styles" pattern="assets/styles/{**}"> + <rewrite template="{$frontend[path]}/zeppelin/assets/styles/{**}"/> + </rule> + + <rule dir="OUT" name="ZEPPELINUI/zeppelin/outbound/assets" pattern="assets/{**}"> + <rewrite template="{$frontend[path]}/zeppelin/assets/{**}"/> + </rule> + + <rule dir="OUT" name="ZEPPELINUI/zeppelin/outbound/javascript" pattern="scripts/{**}"> + <rewrite template="{$frontend[path]}/zeppelin/scripts/{**}"/> + </rule> + +</rules> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/knox/blob/7458fa67/gateway-service-definitions/src/main/resources/services/zeppelinui/0.6.0/service.xml ---------------------------------------------------------------------- diff --git a/gateway-service-definitions/src/main/resources/services/zeppelinui/0.6.0/service.xml b/gateway-service-definitions/src/main/resources/services/zeppelinui/0.6.0/service.xml new file mode 100644 index 0000000..0946076 --- /dev/null +++ b/gateway-service-definitions/src/main/resources/services/zeppelinui/0.6.0/service.xml @@ -0,0 +1,66 @@ +<?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="ZEPPELINUI" name="zeppelinui" version="0.6.0"> + <policies> + <policy role="webappsec"/> + <policy role="authentication" name="Anonymous"/> + <policy role="rewrite"/> + <policy role="authorization"/> + </policies> + <routes> + <route path="/zeppelin/"> + <rewrite apply="ZEPPELINUI/zeppelin/inbound/root" to="request.url"/> + </route> + + + <route path="/zeppelin/api/**"> + <rewrite apply="ZEPPELINUI/zeppelin/inbound/api" to="request.url"/> + </route> + + <route path="/zeppelin/components/**"> + <rewrite apply="ZEPPELINUI/zeppelin/inbound/components" to="request.url"/> + </route> + + <route path="/zeppelin/app/**"> + <rewrite apply="ZEPPELINUI/zeppelin/inbound/app" to="request.url"/> + </route> + + <route path="/zeppelin/app/notebook/**"> + <rewrite apply="ZEPPELINUI/zeppelin/inbound/app/notebook" to="request.url"/> + </route> + + <!-- Resources --> + <route path="/zeppelin/styles/**"> + <rewrite apply="ZEPPELINUI/zeppelin/inbound/styles" to="request.url"/> + </route> + + <route path="/zeppelin/scripts/**"> + <rewrite apply="ZEPPELINUI/zeppelin/inbound/scripts" to="request.url"/> + </route> + + <route path="/zeppelin/assets/**"> + <rewrite apply="ZEPPELINUI/zeppelin/inbound/assets" to="request.url"/> + </route> + + <route path="/zeppelin/fonts/**"> + <rewrite apply="ZEPPELINUI/zeppelin/inbound/fonts" to="request.url"/> + </route> + + </routes> + <dispatch classname="org.apache.hadoop.gateway.dispatch.PassAllHeadersDispatch"/> +</service> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/knox/blob/7458fa67/gateway-service-definitions/src/main/resources/services/zeppelinws/0.6.0/rewrite.xml ---------------------------------------------------------------------- diff --git a/gateway-service-definitions/src/main/resources/services/zeppelinws/0.6.0/rewrite.xml b/gateway-service-definitions/src/main/resources/services/zeppelinws/0.6.0/rewrite.xml new file mode 100644 index 0000000..5572e9d --- /dev/null +++ b/gateway-service-definitions/src/main/resources/services/zeppelinws/0.6.0/rewrite.xml @@ -0,0 +1,27 @@ +<?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="ZEPPELINWS/zeppelin/ws/inbound" pattern="*://*:*/**/ws"> + <rewrite template="{$serviceUrl[ZEPPELINWS]}/ws"/> + </rule> + + <rule dir="IN" name="ZEPPELINWS/zeppelin/inbound" pattern="*://*:*/**/ws{**}"> + <rewrite template="{$serviceUrl[ZEPPELINWS]}/ws{**}"/> + </rule> +</rules> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/knox/blob/7458fa67/gateway-service-definitions/src/main/resources/services/zeppelinws/0.6.0/service.xml ---------------------------------------------------------------------- diff --git a/gateway-service-definitions/src/main/resources/services/zeppelinws/0.6.0/service.xml b/gateway-service-definitions/src/main/resources/services/zeppelinws/0.6.0/service.xml new file mode 100644 index 0000000..76fb6d3 --- /dev/null +++ b/gateway-service-definitions/src/main/resources/services/zeppelinws/0.6.0/service.xml @@ -0,0 +1,34 @@ +<?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="ZEPPELINWS" name="zeppelinws" version="0.6.0"> + <policies> + <policy role="webappsec"/> + <policy role="authentication" name="Anonymous"/> + <policy role="rewrite"/> + <policy role="authorization"/> + </policies> + <routes> + <route path="/zeppelin/ws"> + <rewrite apply="ZEPPELINWS/zeppelin/ws/inbound" to="request.url"/> + </route> + + <route path="/zeppelin/ws**"> + <rewrite apply="ZEPPELINWS/zeppelin/inbound" to="request.url"/> + </route> + </routes> +</service> \ No newline at end of file