From e741b7f66f59ddc4dbca4e5d8d7853c6acd69e03 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Thu, 7 May 2020 11:54:30 +0200 Subject: [PATCH] Bump shiro to 1.7.1 This patch bumps the shiro dependency, release notes are here: https://shiro.apache.org/news.html#1.4.0-RC2-released https://shiro.apache.org/news.html#1.4.1-released https://shiro.apache.org/news.html#1.4.2-released https://shiro.apache.org/news.html#1.5.0-released https://shiro.apache.org/news.html#1.5.1-released https://shiro.apache.org/news.html#1.5.2-released https://shiro.apache.org/news.html#1.5.3-released https://shiro.apache.org/news.html#1.6.0-released https://shiro.apache.org/news.html#1.7.0-released https://shiro.apache.org/news.html#1.7.1-released We end up repackaging shiro to deal with class loading issues coming it faces. Those will be cleaned up in version shiro-2, which when we ill just revert back to using their packaging. JIRA: AAA-188 Change-Id: Ic1d5c4243776c5cd72778c248ba5824a4acc4a91 Signed-off-by: Robert Varga --- aaa-password-service/impl/pom.xml | 4 +- aaa-shiro/impl/pom.xml | 10 +- .../ShiroWebEnvironmentLoaderListener.java | 15 +- aaa-shiro/pom.xml | 2 + aaa-shiro/repackaged-shiro-jar/pom.xml | 100 +++++++++++ aaa-shiro/repackaged-shiro/pom.xml | 160 ++++++++++++++++++ artifacts/pom.xml | 12 ++ dependency-check/pom.xml | 4 + features/features-aaa/pom.xml | 7 + features/odl-aaa-password-service/pom.xml | 10 +- features/odl-aaa-shiro/pom.xml | 18 -- .../src/main/feature/feature.xml | 1 - features/odl-apache-shiro/pom.xml | 58 +++++++ .../src/main/feature/feature.xml | 13 ++ .../src/main/history/dependencies.xml | 11 ++ features/pom.xml | 1 + parent/pom.xml | 10 -- 17 files changed, 381 insertions(+), 55 deletions(-) create mode 100644 aaa-shiro/repackaged-shiro-jar/pom.xml create mode 100644 aaa-shiro/repackaged-shiro/pom.xml create mode 100644 features/odl-apache-shiro/pom.xml create mode 100644 features/odl-apache-shiro/src/main/feature/feature.xml create mode 100644 features/odl-apache-shiro/src/main/history/dependencies.xml diff --git a/aaa-password-service/impl/pom.xml b/aaa-password-service/impl/pom.xml index 9f570440c..d9037d9ad 100644 --- a/aaa-password-service/impl/pom.xml +++ b/aaa-password-service/impl/pom.xml @@ -28,8 +28,8 @@ and is available at http://www.eclipse.org/legal/epl-v10.html aaa-password-service-api - org.apache.shiro - shiro-core + org.opendaylight.aaa + repackaged-shiro org.osgi diff --git a/aaa-shiro/impl/pom.xml b/aaa-shiro/impl/pom.xml index 2c39ee308..f7e506a35 100644 --- a/aaa-shiro/impl/pom.xml +++ b/aaa-shiro/impl/pom.xml @@ -40,14 +40,8 @@ and is available at http://www.eclipse.org/legal/epl-v10.html aaa-cert - org.apache.shiro - shiro-web - - - - commons-collections - commons-collections - 3.2.2 + org.opendaylight.aaa + repackaged-shiro diff --git a/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/web/env/ShiroWebEnvironmentLoaderListener.java b/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/web/env/ShiroWebEnvironmentLoaderListener.java index a17e13f5f..7d9b12d83 100644 --- a/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/web/env/ShiroWebEnvironmentLoaderListener.java +++ b/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/web/env/ShiroWebEnvironmentLoaderListener.java @@ -8,9 +8,7 @@ package org.opendaylight.aaa.shiro.web.env; import javax.servlet.ServletContext; -import org.apache.shiro.util.LifecycleUtils; import org.apache.shiro.web.env.EnvironmentLoaderListener; -import org.apache.shiro.web.env.MutableWebEnvironment; import org.apache.shiro.web.env.WebEnvironment; import org.opendaylight.aaa.api.AuthenticationService; import org.opendaylight.aaa.api.TokenStore; @@ -54,15 +52,8 @@ public class ShiroWebEnvironmentLoaderListener extends EnvironmentLoaderListener } @Override - protected WebEnvironment createEnvironment(final ServletContext sc) { - MutableWebEnvironment environment = new AAAIniWebEnvironment(shiroConfiguration, dataBroker, - certificateManager, authenticationService, tokenAuthenticators, tokenStore, passwordHashService); - - // in newer Shiro version, there is a determineWebEnvironment() which should be - // used instead of createEnvironment() but for 1.3.x we just copy/paste from parent and do: - environment.setServletContext(sc); - customizeEnvironment(environment); - LifecycleUtils.init(environment); - return environment; + protected WebEnvironment determineWebEnvironment(final ServletContext servletContext) { + return new AAAIniWebEnvironment(shiroConfiguration, dataBroker, certificateManager, authenticationService, + tokenAuthenticators, tokenStore, passwordHashService); } } diff --git a/aaa-shiro/pom.xml b/aaa-shiro/pom.xml index a9e4a5651..307179211 100644 --- a/aaa-shiro/pom.xml +++ b/aaa-shiro/pom.xml @@ -29,6 +29,8 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL api impl + repackaged-shiro + repackaged-shiro-jar diff --git a/aaa-shiro/repackaged-shiro-jar/pom.xml b/aaa-shiro/repackaged-shiro-jar/pom.xml new file mode 100644 index 000000000..8ed168ac9 --- /dev/null +++ b/aaa-shiro/repackaged-shiro-jar/pom.xml @@ -0,0 +1,100 @@ + + + + + 4.0.0 + + + org.opendaylight.odlparent + odlparent + 8.0.0 + + + + org.opendaylight.aaa + repackaged-shiro-jar + jar + 0.14.0-SNAPSHOT + ${project.artifactId} + + + + true + + + + + org.apache.shiro + shiro-core + 1.7.1 + + + org.apache.shiro + shiro-web + 1.7.1 + + + + + + + maven-dependency-plugin + + + unpack-license + + + true + + + + + + maven-shade-plugin + + + package + + shade + + + false + true + true + true + + + org.apache.shiro:shiro-core + org.apache.shiro:shiro-web + + + + + org.apache.shiro:shiro-core + + META-INF/DEPENDENCIES + META-INF/MANIFEST.MF + META-INF/LICENSE + META-INF/NOTICE + + + + org.apache.shiro:shiro-web + + META-INF/MANIFEST.MF + + + + + + + + + + diff --git a/aaa-shiro/repackaged-shiro/pom.xml b/aaa-shiro/repackaged-shiro/pom.xml new file mode 100644 index 000000000..17d2764ef --- /dev/null +++ b/aaa-shiro/repackaged-shiro/pom.xml @@ -0,0 +1,160 @@ + + + + + 4.0.0 + + + org.opendaylight.aaa + aaa-parent + 0.14.0-SNAPSHOT + ../../parent + + + repackaged-shiro + bundle + ${project.artifactId} + + + + true + true + + + true + + + + + org.opendaylight.aaa + repackaged-shiro-jar + ${project.version} + provided + + + javax.servlet + javax.servlet-api + provided + + + commons-beanutils + commons-beanutils + + + org.owasp.encoder + encoder + 1.2.3 + + + + + + + maven-dependency-plugin + + + unpack-license + + + true + + + + unpack + compile + + unpack + + + + + org.opendaylight.aaa + repackaged-shiro-jar + ${project.version} + + + false + true + ${project.build.directory}/classes + + + + unpack-sources + prepare-package + + unpack-dependencies + + + sources + shiro-jar + ${project.build.directory}/shaded-sources + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + shaded-sources + prepare-package + + add-source + + + ${project.build.directory}/shaded-sources + + + + shared-resources + prepare-package + + add-resource + + + + + ${project.build.directory}/classes/META-INF + META-INF + + DEPENDENCIES + LICENSE + NOTICE + shiro.tld + + + + + + + + + org.apache.felix + maven-bundle-plugin + true + + + + {maven-resources}, + META-INF/git.properties=-${project.build.directory}/classes/META-INF/git.properties, + META-INF/services=-${project.build.directory}/classes/META-INF/services + + + javax.servlet.jsp;resolution:=optional, + javax.servlet.jsp.tagext;resolution:=optional, + org.apache.commons.configuration2.interpol;resolution:=optional, + * + + + + + + + diff --git a/artifacts/pom.xml b/artifacts/pom.xml index 73aff0011..4132deeb3 100644 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -105,6 +105,11 @@ aaa-shiro ${project.version} + + ${project.groupId} + repackaged-shiro + ${project.version} + ${project.groupId}.web @@ -197,6 +202,13 @@ features xml + + ${project.groupId} + odl-apache-shiro + ${project.version} + features + xml + diff --git a/dependency-check/pom.xml b/dependency-check/pom.xml index be0aee33a..f57d02e69 100644 --- a/dependency-check/pom.xml +++ b/dependency-check/pom.xml @@ -132,6 +132,10 @@ features xml + + ${project.groupId} + repackaged-shiro + ${project.groupId}.web servlet-api diff --git a/features/features-aaa/pom.xml b/features/features-aaa/pom.xml index 83e095ef5..4bfadf837 100644 --- a/features/features-aaa/pom.xml +++ b/features/features-aaa/pom.xml @@ -58,5 +58,12 @@ xml features + + ${project.groupId} + odl-apache-shiro + ${project.version} + xml + features + diff --git a/features/odl-aaa-password-service/pom.xml b/features/odl-aaa-password-service/pom.xml index 2c8358417..8d6edfd12 100644 --- a/features/odl-aaa-password-service/pom.xml +++ b/features/odl-aaa-password-service/pom.xml @@ -51,6 +51,12 @@ aaa-password-service-config xml + + org.opendaylight.aaa + odl-apache-shiro + xml + features + org.opendaylight.mdsal odl-mdsal-binding-base @@ -65,10 +71,6 @@ xml features - - commons-beanutils - commons-beanutils - diff --git a/features/odl-aaa-shiro/pom.xml b/features/odl-aaa-shiro/pom.xml index 31a99e9c9..0c0a35606 100644 --- a/features/odl-aaa-shiro/pom.xml +++ b/features/odl-aaa-shiro/pom.xml @@ -98,18 +98,6 @@ xml features - - org.apache.shiro - shiro-web - - - org.apache.shiro - shiro-core - - - commons-codec - commons-codec - org.opendaylight.aaa aaa-shiro @@ -130,12 +118,6 @@ xml features - - org.opendaylight.odlparent - odl-apache-commons-codec - xml - features - diff --git a/features/odl-aaa-shiro/src/main/feature/feature.xml b/features/odl-aaa-shiro/src/main/feature/feature.xml index eb2401ee3..59ec7f062 100644 --- a/features/odl-aaa-shiro/src/main/feature/feature.xml +++ b/features/odl-aaa-shiro/src/main/feature/feature.xml @@ -25,7 +25,6 @@ odl-karaf-feat-jdbc odl-karaf-feat-jetty - odl-apache-commons-codec odl-jolokia diff --git a/features/odl-apache-shiro/pom.xml b/features/odl-apache-shiro/pom.xml new file mode 100644 index 000000000..5d2a3694e --- /dev/null +++ b/features/odl-apache-shiro/pom.xml @@ -0,0 +1,58 @@ + + + + 4.0.0 + + + org.opendaylight.odlparent + single-feature-parent + 8.1.2 + + + + org.opendaylight.aaa + odl-apache-shiro + 0.14.0-SNAPSHOT + feature + + OpenDaylight :: Apache Shiro + Apache Shiro (repackaged) + + + true + true + + + + + + ${project.groupId} + aaa-artifacts + ${project.version} + pom + import + + + + + + + org.opendaylight.odlparent + odl-servlet-api + xml + features + + + org.opendaylight.aaa + repackaged-shiro + + + diff --git a/features/odl-apache-shiro/src/main/feature/feature.xml b/features/odl-apache-shiro/src/main/feature/feature.xml new file mode 100644 index 000000000..b4a92d465 --- /dev/null +++ b/features/odl-apache-shiro/src/main/feature/feature.xml @@ -0,0 +1,13 @@ + + + + + odl-servlet-api + + diff --git a/features/odl-apache-shiro/src/main/history/dependencies.xml b/features/odl-apache-shiro/src/main/history/dependencies.xml new file mode 100644 index 000000000..8fdacdfa4 --- /dev/null +++ b/features/odl-apache-shiro/src/main/history/dependencies.xml @@ -0,0 +1,11 @@ + + + + odl-servlet-api + mvn:commons-beanutils/commons-beanutils/1.9.4 + mvn:commons-collections/commons-collections/3.2.2 + mvn:commons-logging/commons-logging/1.2 + mvn:org.opendaylight.aaa/repackaged-shiro/${project.version} + mvn:org.owasp.encoder/encoder/1.2.3 + + diff --git a/features/pom.xml b/features/pom.xml index c36699716..66c6065d8 100644 --- a/features/pom.xml +++ b/features/pom.xml @@ -35,6 +35,7 @@ odl-aaa-password-service odl-aaa-shiro odl-aaa-web + odl-apache-shiro diff --git a/parent/pom.xml b/parent/pom.xml index 38cfe4501..82bb6dabf 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -44,16 +44,6 @@ javax.json 1.0.4 - - org.apache.shiro - shiro-web - 1.3.2 - - - org.apache.shiro - shiro-core - 1.3.2 - -- 2.36.6