Repository: knox Updated Branches: refs/heads/master 5db4c8c13 -> 5ecb51e3c
KNOX-1246 Update service config in Knox to support latest configurations for Ranger.(Vishal Suvagia via lmccay) Project: http://git-wip-us.apache.org/repos/asf/knox/repo Commit: http://git-wip-us.apache.org/repos/asf/knox/commit/5ecb51e3 Tree: http://git-wip-us.apache.org/repos/asf/knox/tree/5ecb51e3 Diff: http://git-wip-us.apache.org/repos/asf/knox/diff/5ecb51e3 Branch: refs/heads/master Commit: 5ecb51e3c32941d3dfe85f323003f48cc737c519 Parents: 5db4c8c Author: Larry McCay <[email protected]> Authored: Tue Apr 17 18:07:10 2018 -0400 Committer: Larry McCay <[email protected]> Committed: Tue Apr 17 18:07:10 2018 -0400 ---------------------------------------------------------------------- .../resources/services/ranger/0.5.0/service.xml | 1 + .../services/rangerui/0.5.0/service.xml | 1 + .../deploy/DeploymentFactoryFuncTest.java | 20 ++++++++++++-------- 3 files changed, 14 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/knox/blob/5ecb51e3/gateway-service-definitions/src/main/resources/services/ranger/0.5.0/service.xml ---------------------------------------------------------------------- diff --git a/gateway-service-definitions/src/main/resources/services/ranger/0.5.0/service.xml b/gateway-service-definitions/src/main/resources/services/ranger/0.5.0/service.xml index 09b3a96..eb21090 100644 --- a/gateway-service-definitions/src/main/resources/services/ranger/0.5.0/service.xml +++ b/gateway-service-definitions/src/main/resources/services/ranger/0.5.0/service.xml @@ -19,6 +19,7 @@ <policy role="webappsec"/> <policy role="authentication" name="Anonymous"/> <policy role="rewrite"/> + <policy role="identity-assertion"/> <policy role="authorization"/> </policies> <routes> http://git-wip-us.apache.org/repos/asf/knox/blob/5ecb51e3/gateway-service-definitions/src/main/resources/services/rangerui/0.5.0/service.xml ---------------------------------------------------------------------- diff --git a/gateway-service-definitions/src/main/resources/services/rangerui/0.5.0/service.xml b/gateway-service-definitions/src/main/resources/services/rangerui/0.5.0/service.xml index 2cfbc82..b97e56a 100644 --- a/gateway-service-definitions/src/main/resources/services/rangerui/0.5.0/service.xml +++ b/gateway-service-definitions/src/main/resources/services/rangerui/0.5.0/service.xml @@ -19,6 +19,7 @@ <policy role="webappsec"/> <policy role="authentication" name="Anonymous"/> <policy role="rewrite"/> + <policy role="identity-assertion"/> <policy role="authorization"/> </policies> <routes> http://git-wip-us.apache.org/repos/asf/knox/blob/5ecb51e3/gateway-test/src/test/java/org/apache/knox/gateway/deploy/DeploymentFactoryFuncTest.java ---------------------------------------------------------------------- diff --git a/gateway-test/src/test/java/org/apache/knox/gateway/deploy/DeploymentFactoryFuncTest.java b/gateway-test/src/test/java/org/apache/knox/gateway/deploy/DeploymentFactoryFuncTest.java index 08742b7..a830963 100644 --- a/gateway-test/src/test/java/org/apache/knox/gateway/deploy/DeploymentFactoryFuncTest.java +++ b/gateway-test/src/test/java/org/apache/knox/gateway/deploy/DeploymentFactoryFuncTest.java @@ -730,10 +730,12 @@ public class DeploymentFactoryFuncTest { assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[1]/class", equalTo( "org.apache.knox.gateway.filter.AnonymousAuthFilter" ) ) ); assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[2]/role", equalTo( "rewrite" ) ) ); assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[2]/class", equalTo( "org.apache.knox.gateway.filter.rewrite.api.UrlRewriteServletFilter" ) ) ); - assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[3]/role", equalTo( "authorization" ) ) ); - assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[3]/class", equalTo( "org.apache.knox.gateway.filter.AclsAuthorizationFilter" ) ) ); - assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[4]/role", equalTo( "dispatch" ) ) ); - assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[4]/class", equalTo( "org.apache.knox.gateway.dispatch.GatewayDispatchFilter" ) ) ); + assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[3]/role", equalTo( "identity-assertion" ) ) ); + assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[3]/class", equalTo( "org.apache.knox.gateway.identityasserter.filter.IdentityAsserterFilter" ) ) ); + assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[4]/role", equalTo( "authorization" ) ) ); + assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[4]/class", equalTo( "org.apache.knox.gateway.filter.AclsAuthorizationFilter" ) ) ); + assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[5]/role", equalTo( "dispatch" ) ) ); + assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[5]/class", equalTo( "org.apache.knox.gateway.dispatch.GatewayDispatchFilter" ) ) ); final Document gateway2 = XmlUtils.readXml( war.get( "%2F/WEB-INF/gateway.xml" ).getAsset().openStream() ); @@ -742,10 +744,12 @@ public class DeploymentFactoryFuncTest { assertThat( gateway2, hasXPath( "/gateway/resource[1]/filter[1]/class", equalTo( "org.apache.knox.gateway.filter.AnonymousAuthFilter" ) ) ); assertThat( gateway2, hasXPath( "/gateway/resource[1]/filter[2]/role", equalTo( "rewrite" ) ) ); assertThat( gateway2, hasXPath( "/gateway/resource[1]/filter[2]/class", equalTo( "org.apache.knox.gateway.filter.rewrite.api.UrlRewriteServletFilter" ) ) ); - assertThat( gateway2, hasXPath( "/gateway/resource[1]/filter[3]/role", equalTo( "authorization" ) ) ); - assertThat( gateway2, hasXPath( "/gateway/resource[1]/filter[3]/class", equalTo( "org.apache.knox.gateway.filter.AclsAuthorizationFilter" ) ) ); - assertThat( gateway2, hasXPath( "/gateway/resource[1]/filter[4]/role", equalTo( "dispatch" ) ) ); - assertThat( gateway2, hasXPath( "/gateway/resource[1]/filter[4]/class", equalTo( "org.apache.knox.gateway.dispatch.GatewayDispatchFilter" ) ) ); + assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[3]/role", equalTo( "identity-assertion" ) ) ); + assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[3]/class", equalTo( "org.apache.knox.gateway.identityasserter.filter.IdentityAsserterFilter" ) ) ); + assertThat( gateway2, hasXPath( "/gateway/resource[1]/filter[4]/role", equalTo( "authorization" ) ) ); + assertThat( gateway2, hasXPath( "/gateway/resource[1]/filter[4]/class", equalTo( "org.apache.knox.gateway.filter.AclsAuthorizationFilter" ) ) ); + assertThat( gateway2, hasXPath( "/gateway/resource[1]/filter[5]/role", equalTo( "dispatch" ) ) ); + assertThat( gateway2, hasXPath( "/gateway/resource[1]/filter[5]/class", equalTo( "org.apache.knox.gateway.dispatch.GatewayDispatchFilter" ) ) ); LOG_EXIT();
