From: Ryan Goulding Date: Thu, 3 Sep 2015 16:00:29 +0000 (-0400) Subject: Bug 4719 Shiro integration into restconf X-Git-Tag: release/beryllium~62^2 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=b23eeab2818243f02d15e48f2e7adc564cee3b53;p=netconf.git Bug 4719 Shiro integration into restconf Switches from TokenAuthFilter, a ContainerRequestFilter, to AAAFilter, a javax.servlet.Filter. This allows use of Shiro Realms including LDAP. In order to run restconf without AAA, you can can still utilize the odl-restconf-noauth feature. AAAFilter is disabled by default, and only enabled when the odl-shiro-act bundle is activated. Change-Id: I628967886c8b999761a71a632dc34294b45292df Signed-off-by: Ryan Goulding --- diff --git a/features/netconf/pom.xml b/features/netconf/pom.xml index 9d24f37e54..3edc9a4b54 100644 --- a/features/netconf/pom.xml +++ b/features/netconf/pom.xml @@ -74,6 +74,13 @@ + + org.opendaylight.aaa + features-aaa-shiro + ${aaa.version} + features + xml + org.opendaylight.controller features-protocol-framework diff --git a/features/restconf/pom.xml b/features/restconf/pom.xml index fa4c63882c..2d76209493 100644 --- a/features/restconf/pom.xml +++ b/features/restconf/pom.xml @@ -25,12 +25,11 @@ 1.3.0-SNAPSHOT 1.6.0-SNAPSHOT 1.17 - 2.0.0-SNAPSHOT 0.8.0-SNAPSHOT 1.3.0-SNAPSHOT - 0.8.0-SNAPSHOT 2.15 + 0.8.0-SNAPSHOT features.xml etc/opendaylight/karaf @@ -62,12 +61,11 @@ org.opendaylight.aaa - features-aaa + features-aaa-shiro ${aaa.version} features xml - org.opendaylight.controller sal-remote diff --git a/features/restconf/src/main/features/features.xml b/features/restconf/src/main/features/features.xml index 10060895fe..2ede2bc45a 100644 --- a/features/restconf/src/main/features/features.xml +++ b/features/restconf/src/main/features/features.xml @@ -13,17 +13,19 @@ mvn:org.opendaylight.controller/features-mdsal/{{VERSION}}/xml/features mvn:org.opendaylight.yangtools/features-yangtools/{{VERSION}}/xml/features - mvn:org.opendaylight.aaa/features-aaa/{{VERSION}}/xml/features + mvn:org.opendaylight.aaa/features-aaa-shiro/{{VERSION}}/xml/features odl-restconf odl-mdsal-apidocs - odl-aaa-authn + + mvn:org.opendaylight.aaa/aaa-shiro-act/{{VERSION}} odl-restconf-noauth + odl-aaa-shiro odl-mdsal-broker war @@ -128,6 +132,16 @@ + + org.apache.maven.plugins + maven-surefire-plugin + + + + com.sun.jersey + + + org.apache.felix maven-bundle-plugin @@ -142,11 +156,13 @@ org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.rest.connector.rev140724.*, - com.sun.jersey.spi.container.servlet, org.eclipse.jetty.servlets, - - javax.*;version="0.0", *, + com.sun.jersey.spi.container.servlet, + org.eclipse.jetty.servlets, + org.opendaylight.aaa.shiro.filters, + org.opendaylight.aaa.shiro.realm, + org.opendaylight.aaa.shiro.web.env, + org.apache.shiro.web.env stax-utils /restconf diff --git a/opendaylight/restconf/sal-rest-connector/src/main/resources/WEB-INF/web.xml b/opendaylight/restconf/sal-rest-connector/src/main/resources/WEB-INF/web.xml index 66cadd0cbc..4935729525 100644 --- a/opendaylight/restconf/sal-rest-connector/src/main/resources/WEB-INF/web.xml +++ b/opendaylight/restconf/sal-rest-connector/src/main/resources/WEB-INF/web.xml @@ -10,14 +10,28 @@ javax.ws.rs.Application org.opendaylight.netconf.sal.rest.impl.RestconfApplication - - - com.sun.jersey.spi.container.ContainerRequestFilters - org.opendaylight.aaa.sts.TokenAuthFilter - 1 + + shiroEnvironmentClass + org.opendaylight.aaa.shiro.web.env.KarafIniWebEnvironment + + + + org.apache.shiro.web.env.EnvironmentLoaderListener + + + + ShiroFilter + org.opendaylight.aaa.shiro.filters.AAAFilter + + + + ShiroFilter + /* + + JAXRSRestconf /*