Repository: knox Updated Branches: refs/heads/master 2aa46453d -> f8219575b
KNOX-1358 - Create new version definition for SHS (Marco Gaido via lmccay) Project: http://git-wip-us.apache.org/repos/asf/knox/repo Commit: http://git-wip-us.apache.org/repos/asf/knox/commit/f8219575 Tree: http://git-wip-us.apache.org/repos/asf/knox/tree/f8219575 Diff: http://git-wip-us.apache.org/repos/asf/knox/diff/f8219575 Branch: refs/heads/master Commit: f8219575bb6a8adad5f16083592413c461e1e134 Parents: 2aa4645 Author: Larry McCay <[email protected]> Authored: Wed Jun 20 22:59:04 2018 -0700 Committer: Larry McCay <[email protected]> Committed: Wed Jun 20 22:59:04 2018 -0700 ---------------------------------------------------------------------- .../services/sparkhistoryui/2.3.0/rewrite.xml | 92 ++++++++++++++++++++ .../services/sparkhistoryui/2.3.0/service.xml | 42 +++++++++ 2 files changed, 134 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/knox/blob/f8219575/gateway-service-definitions/src/main/resources/services/sparkhistoryui/2.3.0/rewrite.xml ---------------------------------------------------------------------- diff --git a/gateway-service-definitions/src/main/resources/services/sparkhistoryui/2.3.0/rewrite.xml b/gateway-service-definitions/src/main/resources/services/sparkhistoryui/2.3.0/rewrite.xml new file mode 100644 index 0000000..4b7acaa --- /dev/null +++ b/gateway-service-definitions/src/main/resources/services/sparkhistoryui/2.3.0/rewrite.xml @@ -0,0 +1,92 @@ +<?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="SPARKHISTORYUI/sparkhistory/inbound/root" pattern="*://*:*/**/sparkhistory/"> + <rewrite template="{$serviceUrl[SPARKHISTORYUI]}/"/> + </rule> + <rule dir="IN" name="SPARKHISTORYUI/sparkhistory/inbound/path" pattern="*://*:*/**/sparkhistory/{**}"> + <rewrite template="{$serviceUrl[SPARKHISTORYUI]}/{**}"/> + </rule> + <rule dir="IN" name="SPARKHISTORYUI/sparkhistory/inbound/simpleQuery" pattern="*://*:*/**/sparkhistory/?{**}"> + <rewrite template="{$serviceUrl[SPARKHISTORYUI]}/?{**}"/> + </rule> + <rule dir="IN" name="SPARKHISTORYUI/sparkhistory/inbound/query" pattern="*://*:*/**/sparkhistory/{**}?{**}"> + <rewrite template="{$serviceUrl[SPARKHISTORYUI]}/{**}?{**}"/> + </rule> + <rule dir="IN" name="SPARKHISTORYUI/sparkhistory/inbound/history" pattern="*://*:*/**/sparkhistory/history/{**}/?{**}"> + <rewrite template="{$serviceUrl[SPARKHISTORYUI]}/history/{**}/?{**}"/> + </rule> + <rule dir="IN" name="SPARKHISTORYUI/sparkhistory/inbound/apps" pattern="*://*:*/**/sparkhistory/?{page}?{showIncomplete}"> + <rewrite template="{$serviceUrl[SPARKHISTORYUI]}/?{page}?{showIncomplete}"/> + </rule> + + <rule dir="OUT" name="SPARKHISTORYUI/sparkhistory/outbound/history" pattern="/history/{**}"> + <rewrite template="{$frontend[url]}/sparkhistory/history/{**}"/> + </rule> + <rule dir="OUT" name="SPARKHISTORYUI/sparkhistory/outbound/history/job" pattern="/history/{**}?{**}"> + <rewrite template="{$frontend[url]}/sparkhistory/history/{**}?{**}"/> + </rule> + + <rule dir="OUT" name="SPARKHISTORYUI/sparkhistory/outbound/apps" pattern="/?{page}?{showIncomplete}"> + <rewrite template="{$frontend[url]}/sparkhistory/?{page}?{showIncomplete}"/> + </rule> + + <rule dir="OUT" name="SPARKHISTORYUI/sparkhistory/outbound/headers/location"> + <match pattern="*://*:*/history/{**}/?{**}"/> + <rewrite template="{$frontend[url]}/sparkhistory/history/{**}/?{**}"/> + </rule> + <rule flow="OR" dir="OUT" name="SPARKHISTORYUI/sparkhistory/outbound/headers/jobs/location"> + <match pattern="*://*:*/history/{**}/jobs"> + <rewrite template="{$frontend[url]}/sparkhistory/history/{**}/jobs"/> + </match> + <match pattern="*://*:*/history/{**}/jobs/"> + <rewrite template="{$frontend[url]}/sparkhistory/history/{**}/jobs/"/> + </match> + </rule> + <rule dir="IN" name="SPARKHISTORYUI/sparkhistory/outbound/rqheaders/xfc"> + <match pattern="{**}"/> + <rewrite template="/{**}/sparkhistory" /> + </rule> + + <filter name="SPARKHISTORYUI/sparkhistory/outbound/headers"> + <content type="application/x-http-headers"> + <apply path="Location" rule="SPARKHISTORYUI/sparkhistory/outbound/headers/location"/> + </content> + </filter> + <filter name="SPARKHISTORYUI/sparkhistory/outbound/headers/jobs"> + <content type="application/x-http-headers"> + <apply path="Location" rule="SPARKHISTORYUI/sparkhistory/outbound/headers/jobs/location"/> + </content> + </filter> + <filter name="SPARKHISTORYUI/sparkhistory/outbound/rqheaders"> + <content type="application/x-http-headers"> + <apply path="X-Forwarded-Context" rule="SPARKHISTORYUI/sparkhistory/outbound/rqheaders/xfc"/> + </content> + </filter> + + <!-- re-write rule for location when SHS redirects to Knox SSO login page --> + <rule dir="OUT" name="SPARKHISTORYUI/sparkhistory/outbound/headers/location/sso"> + <match pattern="{scheme}://{host}:{port}/{gateway}/{knoxsso}/{api}/{v}/websso?originalUrl={**}"/> + <rewrite template="{scheme}://{host}:{port}/{gateway}/{knoxsso}/{api}/{v}/websso?originalUrl={$postfix[url,/sparkhistory/]}"/> + </rule> + <filter name="SPARKHISTORYUI/sparkhistory/outbound/headers/sso/filter"> + <content type="application/x-http-headers"> + <apply path="Location" rule="SPARKHISTORYUI/sparkhistory/outbound/headers/location/sso"/> + </content> + </filter> +</rules> http://git-wip-us.apache.org/repos/asf/knox/blob/f8219575/gateway-service-definitions/src/main/resources/services/sparkhistoryui/2.3.0/service.xml ---------------------------------------------------------------------- diff --git a/gateway-service-definitions/src/main/resources/services/sparkhistoryui/2.3.0/service.xml b/gateway-service-definitions/src/main/resources/services/sparkhistoryui/2.3.0/service.xml new file mode 100644 index 0000000..2468b6c --- /dev/null +++ b/gateway-service-definitions/src/main/resources/services/sparkhistoryui/2.3.0/service.xml @@ -0,0 +1,42 @@ +<?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="SPARKHISTORYUI" name="sparkhistory" version="1.4.0"> + <routes> + <route path="/sparkhistory/"> + <rewrite apply="SPARKHISTORYUI/sparkhistory/outbound/rqheaders" to="request.headers"/> + <rewrite apply="SPARKHISTORYUI/sparkhistory/outbound/headers/sso/filter" to="response.headers"/> + </route> + <route path="/sparkhistory/**"> + <rewrite apply="SPARKHISTORYUI/sparkhistory/outbound/rqheaders" to="request.headers"/> + <rewrite apply="SPARKHISTORYUI/sparkhistory/outbound/headers/sso/filter" to="response.headers"/> + </route> + <route path="/sparkhistory/**?**"/> + <route path="/sparkhistory/history/**?**"> + <rewrite apply="SPARKHISTORYUI/sparkhistory/outbound/headers" to="response.headers"/> + <rewrite apply="SPARKHISTORYUI/sparkhistory/outbound/rqheaders" to="request.headers"/> + </route> + <route path="/sparkhistory/history/**/?**"> + <rewrite apply="SPARKHISTORYUI/sparkhistory/outbound/headers/jobs" to="response.headers"/> + <rewrite apply="SPARKHISTORYUI/sparkhistory/outbound/rqheaders" to="request.headers"/> + </route> + <route path="/sparkhistory/history/**/jobs/**?**"> + <rewrite apply="SPARKHISTORYUI/sparkhistory/outbound/headers/jobs" to="response.headers"/> + <rewrite apply="SPARKHISTORYUI/sparkhistory/outbound/rqheaders" to="request.headers"/> + </route> + </routes> +</service>
