Repository: knox Updated Branches: refs/heads/master 1d5eae8ee -> 86a8ed1bf
KNOX-1274 - Update location headers to make sure SSO redirects are proper (Marco Gaido 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/86a8ed1b Tree: http://git-wip-us.apache.org/repos/asf/knox/tree/86a8ed1b Diff: http://git-wip-us.apache.org/repos/asf/knox/diff/86a8ed1b Branch: refs/heads/master Commit: 86a8ed1bf08af2123a44c33d3f7f8ab4b05147e3 Parents: 1d5eae8 Author: Sandeep More <m...@apache.org> Authored: Fri May 11 11:17:24 2018 -0400 Committer: Sandeep More <m...@apache.org> Committed: Fri May 11 11:17:24 2018 -0400 ---------------------------------------------------------------------- .../services/sparkhistoryui/1.4.0/rewrite.xml | 13 ++++++++++++- .../services/sparkhistoryui/1.4.0/service.xml | 2 ++ 2 files changed, 14 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/knox/blob/86a8ed1b/gateway-service-definitions/src/main/resources/services/sparkhistoryui/1.4.0/rewrite.xml ---------------------------------------------------------------------- diff --git a/gateway-service-definitions/src/main/resources/services/sparkhistoryui/1.4.0/rewrite.xml b/gateway-service-definitions/src/main/resources/services/sparkhistoryui/1.4.0/rewrite.xml index 484f267..b5df3c9 100644 --- a/gateway-service-definitions/src/main/resources/services/sparkhistoryui/1.4.0/rewrite.xml +++ b/gateway-service-definitions/src/main/resources/services/sparkhistoryui/1.4.0/rewrite.xml @@ -160,4 +160,15 @@ <apply path="static" rule="SPARKHISTORYUI/sparkhistory/outbound/historypage/static"/> </content> </filter> -</rules> \ No newline at end of file + + <!-- 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/86a8ed1b/gateway-service-definitions/src/main/resources/services/sparkhistoryui/1.4.0/service.xml ---------------------------------------------------------------------- diff --git a/gateway-service-definitions/src/main/resources/services/sparkhistoryui/1.4.0/service.xml b/gateway-service-definitions/src/main/resources/services/sparkhistoryui/1.4.0/service.xml index f6ae415..aa370a1 100644 --- a/gateway-service-definitions/src/main/resources/services/sparkhistoryui/1.4.0/service.xml +++ b/gateway-service-definitions/src/main/resources/services/sparkhistoryui/1.4.0/service.xml @@ -19,9 +19,11 @@ <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/static/historypage.js">