From ed5ed0f895111140d2d7da0cae8165201cc040b3 Mon Sep 17 00:00:00 2001 From: "tadei.bilan" Date: Thu, 8 Jul 2021 13:51:08 +0300 Subject: [PATCH] Split out datastore implementation from aaa-shiro Split H2 database from aaa-shiro into separate module. Also split opendaylight.aaa.shiro.tokenauthrealm.auth to aaa-tokenauthrealm to avoid cyclic dependencies between aaa-idm-store-h2 and aaa-shiro modules. JIRA: AAA-208 Change-Id: Ie90e7d7379e598bbf1b62436a27dae8a8b8c7372 Signed-off-by: tadei.bilan Signed-off-by: Robert Varga --- aaa-cli-jar/pom.xml | 4 +- aaa-idm-store-h2/pom.xml | 75 +++++++++++++++++++ .../aaa/datastore/h2/AbstractStore.java | 0 .../aaa/datastore/h2/ConnectionProvider.java | 0 .../aaa/datastore/h2/DomainStore.java | 0 .../aaa/datastore/h2/GrantStore.java | 0 .../aaa/datastore/h2/H2Store.java | 0 .../aaa/datastore/h2/H2TokenStore.java | 0 .../aaa/datastore/h2/IdmLightConfig.java | 0 .../h2/IdmLightSimpleConnectionProvider.java | 0 .../aaa/datastore/h2/OSGiH2Store.java | 0 .../aaa/datastore/h2/RoleStore.java | 0 .../aaa/datastore/h2/StoreException.java | 0 .../aaa/datastore/h2/UserStore.java | 0 .../aaa/datastore/h2/DomainStoreTest.java | 0 .../aaa/datastore/h2/GrantStoreTest.java | 0 .../aaa/datastore/h2/H2StoreTest.java | 0 .../aaa/datastore/h2/H2TokenStoreTest.java | 4 +- .../aaa/datastore/h2/IdmLightConfigTest.java | 0 .../aaa/datastore/h2/RoleStoreTest.java | 0 .../aaa/datastore/h2/UserStoreTest.java | 0 aaa-shiro/impl/pom.xml | 17 +++-- .../opendaylight/aaa/AAAShiroProvider.java | 4 +- .../aaa/shiro/idm/IdmLightProxy.java | 2 +- .../aaa/shiro/realm/TokenAuthRealm.java | 2 +- .../realm/util/http/header/HeaderUtils.java | 2 +- .../shiro/web/env/AAAIniWebEnvironment.java | 2 +- .../ShiroWebEnvironmentLoaderListener.java | 2 +- .../aaa/shiro/web/env/ThreadLocals.java | 2 +- .../aaa/shiro/realm/TokenAuthRealmTest.java | 4 +- aaa-tokenauthrealm/pom.xml | 46 ++++++++++++ .../auth/AuthenticationBuilder.java | 2 +- .../auth/AuthenticationManager.java | 2 +- .../tokenauthrealm/auth/ClaimBuilder.java | 2 +- .../tokenauthrealm/auth/HttpBasicAuth.java | 2 +- .../auth/PasswordCredentialBuilder.java | 2 +- .../auth/TokenAuthenticators.java | 2 +- .../auth/AuthenticationBuilderTest.java | 2 +- .../auth/AuthenticationManagerTest.java | 2 +- .../tokenauthrealm/auth/ClaimBuilderTest.java | 2 +- .../auth/HttpBasicAuthTest.java | 2 +- .../auth/PasswordCredentialTest.java | 2 +- artifacts/pom.xml | 11 +++ pom.xml | 2 + 44 files changed, 168 insertions(+), 33 deletions(-) create mode 100644 aaa-idm-store-h2/pom.xml rename {aaa-shiro/impl => aaa-idm-store-h2}/src/main/java/org/opendaylight/aaa/datastore/h2/AbstractStore.java (100%) rename {aaa-shiro/impl => aaa-idm-store-h2}/src/main/java/org/opendaylight/aaa/datastore/h2/ConnectionProvider.java (100%) rename {aaa-shiro/impl => aaa-idm-store-h2}/src/main/java/org/opendaylight/aaa/datastore/h2/DomainStore.java (100%) rename {aaa-shiro/impl => aaa-idm-store-h2}/src/main/java/org/opendaylight/aaa/datastore/h2/GrantStore.java (100%) rename {aaa-shiro/impl => aaa-idm-store-h2}/src/main/java/org/opendaylight/aaa/datastore/h2/H2Store.java (100%) rename {aaa-shiro/impl => aaa-idm-store-h2}/src/main/java/org/opendaylight/aaa/datastore/h2/H2TokenStore.java (100%) rename {aaa-shiro/impl => aaa-idm-store-h2}/src/main/java/org/opendaylight/aaa/datastore/h2/IdmLightConfig.java (100%) rename {aaa-shiro/impl => aaa-idm-store-h2}/src/main/java/org/opendaylight/aaa/datastore/h2/IdmLightSimpleConnectionProvider.java (100%) rename {aaa-shiro/impl => aaa-idm-store-h2}/src/main/java/org/opendaylight/aaa/datastore/h2/OSGiH2Store.java (100%) rename {aaa-shiro/impl => aaa-idm-store-h2}/src/main/java/org/opendaylight/aaa/datastore/h2/RoleStore.java (100%) rename {aaa-shiro/impl => aaa-idm-store-h2}/src/main/java/org/opendaylight/aaa/datastore/h2/StoreException.java (100%) rename {aaa-shiro/impl => aaa-idm-store-h2}/src/main/java/org/opendaylight/aaa/datastore/h2/UserStore.java (100%) rename {aaa-shiro/impl => aaa-idm-store-h2}/src/test/java/org/opendaylight/aaa/datastore/h2/DomainStoreTest.java (100%) rename {aaa-shiro/impl => aaa-idm-store-h2}/src/test/java/org/opendaylight/aaa/datastore/h2/GrantStoreTest.java (100%) rename {aaa-shiro/impl => aaa-idm-store-h2}/src/test/java/org/opendaylight/aaa/datastore/h2/H2StoreTest.java (100%) rename {aaa-shiro/impl => aaa-idm-store-h2}/src/test/java/org/opendaylight/aaa/datastore/h2/H2TokenStoreTest.java (89%) rename {aaa-shiro/impl => aaa-idm-store-h2}/src/test/java/org/opendaylight/aaa/datastore/h2/IdmLightConfigTest.java (100%) rename {aaa-shiro/impl => aaa-idm-store-h2}/src/test/java/org/opendaylight/aaa/datastore/h2/RoleStoreTest.java (100%) rename {aaa-shiro/impl => aaa-idm-store-h2}/src/test/java/org/opendaylight/aaa/datastore/h2/UserStoreTest.java (100%) create mode 100644 aaa-tokenauthrealm/pom.xml rename {aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro => aaa-tokenauthrealm/src/main/java/org/opendaylight/aaa}/tokenauthrealm/auth/AuthenticationBuilder.java (98%) rename {aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro => aaa-tokenauthrealm/src/main/java/org/opendaylight/aaa}/tokenauthrealm/auth/AuthenticationManager.java (98%) rename {aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro => aaa-tokenauthrealm/src/main/java/org/opendaylight/aaa}/tokenauthrealm/auth/ClaimBuilder.java (98%) rename {aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro => aaa-tokenauthrealm/src/main/java/org/opendaylight/aaa}/tokenauthrealm/auth/HttpBasicAuth.java (98%) rename {aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro => aaa-tokenauthrealm/src/main/java/org/opendaylight/aaa}/tokenauthrealm/auth/PasswordCredentialBuilder.java (97%) rename {aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro => aaa-tokenauthrealm/src/main/java/org/opendaylight/aaa}/tokenauthrealm/auth/TokenAuthenticators.java (93%) rename {aaa-shiro/impl/src/test/java/org/opendaylight/aaa/shiro => aaa-tokenauthrealm/src/test/java/org/opendaylight/aaa}/tokenauthrealm/auth/AuthenticationBuilderTest.java (98%) rename {aaa-shiro/impl/src/test/java/org/opendaylight/aaa/shiro => aaa-tokenauthrealm/src/test/java/org/opendaylight/aaa}/tokenauthrealm/auth/AuthenticationManagerTest.java (98%) rename {aaa-shiro/impl/src/test/java/org/opendaylight/aaa/shiro => aaa-tokenauthrealm/src/test/java/org/opendaylight/aaa}/tokenauthrealm/auth/ClaimBuilderTest.java (99%) rename {aaa-shiro/impl/src/test/java/org/opendaylight/aaa/shiro => aaa-tokenauthrealm/src/test/java/org/opendaylight/aaa}/tokenauthrealm/auth/HttpBasicAuthTest.java (98%) rename {aaa-shiro/impl/src/test/java/org/opendaylight/aaa/shiro => aaa-tokenauthrealm/src/test/java/org/opendaylight/aaa}/tokenauthrealm/auth/PasswordCredentialTest.java (95%) diff --git a/aaa-cli-jar/pom.xml b/aaa-cli-jar/pom.xml index 54335d82c..f97bf79f7 100644 --- a/aaa-cli-jar/pom.xml +++ b/aaa-cli-jar/pom.xml @@ -32,10 +32,10 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL org.opendaylight.aaa - aaa-shiro + aaa-idm-store-h2 - + * * diff --git a/aaa-idm-store-h2/pom.xml b/aaa-idm-store-h2/pom.xml new file mode 100644 index 000000000..7220e875a --- /dev/null +++ b/aaa-idm-store-h2/pom.xml @@ -0,0 +1,75 @@ + + + + 4.0.0 + + + org.opendaylight.aaa + aaa-parent + 0.14.2-SNAPSHOT + ../parent + + + aaa-idm-store-h2 + ODL :: aaa :: ${project.artifactId} + bundle + + + + + org.opendaylight.aaa + aaa-authn-api + + + org.opendaylight.aaa + aaa-tokenauthrealm + + + org.opendaylight.aaa + aaa-password-service-api + + + org.opendaylight.aaa + aaa-password-service-impl + + + + + org.osgi + osgi.cmpn + + + + + org.apache.commons + commons-text + + + net.sf.ehcache + ehcache + + + org.immutables + value + annotations + + + com.h2database + h2 + + + + + com.google.truth + truth + + + diff --git a/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/datastore/h2/AbstractStore.java b/aaa-idm-store-h2/src/main/java/org/opendaylight/aaa/datastore/h2/AbstractStore.java similarity index 100% rename from aaa-shiro/impl/src/main/java/org/opendaylight/aaa/datastore/h2/AbstractStore.java rename to aaa-idm-store-h2/src/main/java/org/opendaylight/aaa/datastore/h2/AbstractStore.java diff --git a/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/datastore/h2/ConnectionProvider.java b/aaa-idm-store-h2/src/main/java/org/opendaylight/aaa/datastore/h2/ConnectionProvider.java similarity index 100% rename from aaa-shiro/impl/src/main/java/org/opendaylight/aaa/datastore/h2/ConnectionProvider.java rename to aaa-idm-store-h2/src/main/java/org/opendaylight/aaa/datastore/h2/ConnectionProvider.java diff --git a/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/datastore/h2/DomainStore.java b/aaa-idm-store-h2/src/main/java/org/opendaylight/aaa/datastore/h2/DomainStore.java similarity index 100% rename from aaa-shiro/impl/src/main/java/org/opendaylight/aaa/datastore/h2/DomainStore.java rename to aaa-idm-store-h2/src/main/java/org/opendaylight/aaa/datastore/h2/DomainStore.java diff --git a/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/datastore/h2/GrantStore.java b/aaa-idm-store-h2/src/main/java/org/opendaylight/aaa/datastore/h2/GrantStore.java similarity index 100% rename from aaa-shiro/impl/src/main/java/org/opendaylight/aaa/datastore/h2/GrantStore.java rename to aaa-idm-store-h2/src/main/java/org/opendaylight/aaa/datastore/h2/GrantStore.java diff --git a/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/datastore/h2/H2Store.java b/aaa-idm-store-h2/src/main/java/org/opendaylight/aaa/datastore/h2/H2Store.java similarity index 100% rename from aaa-shiro/impl/src/main/java/org/opendaylight/aaa/datastore/h2/H2Store.java rename to aaa-idm-store-h2/src/main/java/org/opendaylight/aaa/datastore/h2/H2Store.java diff --git a/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/datastore/h2/H2TokenStore.java b/aaa-idm-store-h2/src/main/java/org/opendaylight/aaa/datastore/h2/H2TokenStore.java similarity index 100% rename from aaa-shiro/impl/src/main/java/org/opendaylight/aaa/datastore/h2/H2TokenStore.java rename to aaa-idm-store-h2/src/main/java/org/opendaylight/aaa/datastore/h2/H2TokenStore.java diff --git a/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/datastore/h2/IdmLightConfig.java b/aaa-idm-store-h2/src/main/java/org/opendaylight/aaa/datastore/h2/IdmLightConfig.java similarity index 100% rename from aaa-shiro/impl/src/main/java/org/opendaylight/aaa/datastore/h2/IdmLightConfig.java rename to aaa-idm-store-h2/src/main/java/org/opendaylight/aaa/datastore/h2/IdmLightConfig.java diff --git a/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/datastore/h2/IdmLightSimpleConnectionProvider.java b/aaa-idm-store-h2/src/main/java/org/opendaylight/aaa/datastore/h2/IdmLightSimpleConnectionProvider.java similarity index 100% rename from aaa-shiro/impl/src/main/java/org/opendaylight/aaa/datastore/h2/IdmLightSimpleConnectionProvider.java rename to aaa-idm-store-h2/src/main/java/org/opendaylight/aaa/datastore/h2/IdmLightSimpleConnectionProvider.java diff --git a/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/datastore/h2/OSGiH2Store.java b/aaa-idm-store-h2/src/main/java/org/opendaylight/aaa/datastore/h2/OSGiH2Store.java similarity index 100% rename from aaa-shiro/impl/src/main/java/org/opendaylight/aaa/datastore/h2/OSGiH2Store.java rename to aaa-idm-store-h2/src/main/java/org/opendaylight/aaa/datastore/h2/OSGiH2Store.java diff --git a/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/datastore/h2/RoleStore.java b/aaa-idm-store-h2/src/main/java/org/opendaylight/aaa/datastore/h2/RoleStore.java similarity index 100% rename from aaa-shiro/impl/src/main/java/org/opendaylight/aaa/datastore/h2/RoleStore.java rename to aaa-idm-store-h2/src/main/java/org/opendaylight/aaa/datastore/h2/RoleStore.java diff --git a/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/datastore/h2/StoreException.java b/aaa-idm-store-h2/src/main/java/org/opendaylight/aaa/datastore/h2/StoreException.java similarity index 100% rename from aaa-shiro/impl/src/main/java/org/opendaylight/aaa/datastore/h2/StoreException.java rename to aaa-idm-store-h2/src/main/java/org/opendaylight/aaa/datastore/h2/StoreException.java diff --git a/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/datastore/h2/UserStore.java b/aaa-idm-store-h2/src/main/java/org/opendaylight/aaa/datastore/h2/UserStore.java similarity index 100% rename from aaa-shiro/impl/src/main/java/org/opendaylight/aaa/datastore/h2/UserStore.java rename to aaa-idm-store-h2/src/main/java/org/opendaylight/aaa/datastore/h2/UserStore.java diff --git a/aaa-shiro/impl/src/test/java/org/opendaylight/aaa/datastore/h2/DomainStoreTest.java b/aaa-idm-store-h2/src/test/java/org/opendaylight/aaa/datastore/h2/DomainStoreTest.java similarity index 100% rename from aaa-shiro/impl/src/test/java/org/opendaylight/aaa/datastore/h2/DomainStoreTest.java rename to aaa-idm-store-h2/src/test/java/org/opendaylight/aaa/datastore/h2/DomainStoreTest.java diff --git a/aaa-shiro/impl/src/test/java/org/opendaylight/aaa/datastore/h2/GrantStoreTest.java b/aaa-idm-store-h2/src/test/java/org/opendaylight/aaa/datastore/h2/GrantStoreTest.java similarity index 100% rename from aaa-shiro/impl/src/test/java/org/opendaylight/aaa/datastore/h2/GrantStoreTest.java rename to aaa-idm-store-h2/src/test/java/org/opendaylight/aaa/datastore/h2/GrantStoreTest.java diff --git a/aaa-shiro/impl/src/test/java/org/opendaylight/aaa/datastore/h2/H2StoreTest.java b/aaa-idm-store-h2/src/test/java/org/opendaylight/aaa/datastore/h2/H2StoreTest.java similarity index 100% rename from aaa-shiro/impl/src/test/java/org/opendaylight/aaa/datastore/h2/H2StoreTest.java rename to aaa-idm-store-h2/src/test/java/org/opendaylight/aaa/datastore/h2/H2StoreTest.java diff --git a/aaa-shiro/impl/src/test/java/org/opendaylight/aaa/datastore/h2/H2TokenStoreTest.java b/aaa-idm-store-h2/src/test/java/org/opendaylight/aaa/datastore/h2/H2TokenStoreTest.java similarity index 89% rename from aaa-shiro/impl/src/test/java/org/opendaylight/aaa/datastore/h2/H2TokenStoreTest.java rename to aaa-idm-store-h2/src/test/java/org/opendaylight/aaa/datastore/h2/H2TokenStoreTest.java index 1858526e3..25ee707f2 100644 --- a/aaa-shiro/impl/src/test/java/org/opendaylight/aaa/datastore/h2/H2TokenStoreTest.java +++ b/aaa-idm-store-h2/src/test/java/org/opendaylight/aaa/datastore/h2/H2TokenStoreTest.java @@ -14,8 +14,8 @@ import static org.junit.Assert.assertNull; import org.junit.After; import org.junit.Test; import org.opendaylight.aaa.api.Authentication; -import org.opendaylight.aaa.shiro.tokenauthrealm.auth.AuthenticationBuilder; -import org.opendaylight.aaa.shiro.tokenauthrealm.auth.ClaimBuilder; +import org.opendaylight.aaa.tokenauthrealm.auth.AuthenticationBuilder; +import org.opendaylight.aaa.tokenauthrealm.auth.ClaimBuilder; /** * Unit Test for H2TokenStore. diff --git a/aaa-shiro/impl/src/test/java/org/opendaylight/aaa/datastore/h2/IdmLightConfigTest.java b/aaa-idm-store-h2/src/test/java/org/opendaylight/aaa/datastore/h2/IdmLightConfigTest.java similarity index 100% rename from aaa-shiro/impl/src/test/java/org/opendaylight/aaa/datastore/h2/IdmLightConfigTest.java rename to aaa-idm-store-h2/src/test/java/org/opendaylight/aaa/datastore/h2/IdmLightConfigTest.java diff --git a/aaa-shiro/impl/src/test/java/org/opendaylight/aaa/datastore/h2/RoleStoreTest.java b/aaa-idm-store-h2/src/test/java/org/opendaylight/aaa/datastore/h2/RoleStoreTest.java similarity index 100% rename from aaa-shiro/impl/src/test/java/org/opendaylight/aaa/datastore/h2/RoleStoreTest.java rename to aaa-idm-store-h2/src/test/java/org/opendaylight/aaa/datastore/h2/RoleStoreTest.java diff --git a/aaa-shiro/impl/src/test/java/org/opendaylight/aaa/datastore/h2/UserStoreTest.java b/aaa-idm-store-h2/src/test/java/org/opendaylight/aaa/datastore/h2/UserStoreTest.java similarity index 100% rename from aaa-shiro/impl/src/test/java/org/opendaylight/aaa/datastore/h2/UserStoreTest.java rename to aaa-idm-store-h2/src/test/java/org/opendaylight/aaa/datastore/h2/UserStoreTest.java diff --git a/aaa-shiro/impl/pom.xml b/aaa-shiro/impl/pom.xml index cb9177498..e6ebc3fae 100644 --- a/aaa-shiro/impl/pom.xml +++ b/aaa-shiro/impl/pom.xml @@ -32,6 +32,14 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.aaa aaa-shiro-api + + org.opendaylight.aaa + aaa-tokenauthrealm + + + org.opendaylight.aaa + aaa-idm-store-h2 + @@ -87,10 +95,6 @@ and is available at http://www.eclipse.org/legal/epl-v10.html net.sf.ehcache ehcache - - com.h2database - h2 - org.immutables value @@ -177,15 +181,12 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.aaa, org.opendaylight.aaa.shiro, org.opendaylight.aaa.shiro.idm, - org.opendaylight.aaa.shiro.tokenauthrealm, - org.opendaylight.aaa.shiro.tokenauthrealm.auth, org.opendaylight.aaa.shiro, org.opendaylight.aaa.shiro.filters, org.opendaylight.aaa.shiro.realm, org.opendaylight.aaa.provider, - org.opendaylight.aaa.shiro.web.env, - org.opendaylight.aaa.datastore.h2.*, + org.opendaylight.aaa.shiro.web.env !javax.annotation, diff --git a/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/AAAShiroProvider.java b/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/AAAShiroProvider.java index 6728c57b4..ce34fa827 100644 --- a/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/AAAShiroProvider.java +++ b/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/AAAShiroProvider.java @@ -20,8 +20,8 @@ import org.opendaylight.aaa.api.TokenStore; import org.opendaylight.aaa.api.password.service.PasswordHashService; import org.opendaylight.aaa.cert.api.ICertificateManager; import org.opendaylight.aaa.datastore.h2.H2TokenStore; -import org.opendaylight.aaa.shiro.tokenauthrealm.auth.HttpBasicAuth; -import org.opendaylight.aaa.shiro.tokenauthrealm.auth.TokenAuthenticators; +import org.opendaylight.aaa.tokenauthrealm.auth.HttpBasicAuth; +import org.opendaylight.aaa.tokenauthrealm.auth.TokenAuthenticators; import org.opendaylight.mdsal.binding.api.DataBroker; import org.opendaylight.yang.gen.v1.urn.opendaylight.aaa.app.config.rev170619.DatastoreConfig; import org.opendaylight.yang.gen.v1.urn.opendaylight.aaa.app.config.rev170619.ShiroConfiguration; diff --git a/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/idm/IdmLightProxy.java b/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/idm/IdmLightProxy.java index a997893be..f77fc6a38 100644 --- a/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/idm/IdmLightProxy.java +++ b/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/idm/IdmLightProxy.java @@ -31,7 +31,7 @@ import org.opendaylight.aaa.api.model.Role; import org.opendaylight.aaa.api.model.User; import org.opendaylight.aaa.api.model.Users; import org.opendaylight.aaa.api.password.service.PasswordHashService; -import org.opendaylight.aaa.shiro.tokenauthrealm.auth.ClaimBuilder; +import org.opendaylight.aaa.tokenauthrealm.auth.ClaimBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/realm/TokenAuthRealm.java b/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/realm/TokenAuthRealm.java index 05fe37440..f00253790 100644 --- a/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/realm/TokenAuthRealm.java +++ b/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/realm/TokenAuthRealm.java @@ -28,8 +28,8 @@ import org.opendaylight.aaa.api.shiro.principal.ODLPrincipal; import org.opendaylight.aaa.shiro.principal.ODLPrincipalImpl; import org.opendaylight.aaa.shiro.realm.util.TokenUtils; import org.opendaylight.aaa.shiro.realm.util.http.header.HeaderUtils; -import org.opendaylight.aaa.shiro.tokenauthrealm.auth.TokenAuthenticators; import org.opendaylight.aaa.shiro.web.env.ThreadLocals; +import org.opendaylight.aaa.tokenauthrealm.auth.TokenAuthenticators; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/realm/util/http/header/HeaderUtils.java b/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/realm/util/http/header/HeaderUtils.java index 6b8619c87..cbb2a8946 100644 --- a/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/realm/util/http/header/HeaderUtils.java +++ b/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/realm/util/http/header/HeaderUtils.java @@ -14,7 +14,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.shiro.codec.Base64; -import org.opendaylight.aaa.shiro.tokenauthrealm.auth.HttpBasicAuth; +import org.opendaylight.aaa.tokenauthrealm.auth.HttpBasicAuth; /** * Utilities for HTTP header manipulation. diff --git a/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/web/env/AAAIniWebEnvironment.java b/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/web/env/AAAIniWebEnvironment.java index 66cc1ebcc..07c584011 100644 --- a/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/web/env/AAAIniWebEnvironment.java +++ b/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/web/env/AAAIniWebEnvironment.java @@ -19,7 +19,7 @@ import org.opendaylight.aaa.api.AuthenticationService; import org.opendaylight.aaa.api.TokenStore; import org.opendaylight.aaa.api.password.service.PasswordHashService; import org.opendaylight.aaa.cert.api.ICertificateManager; -import org.opendaylight.aaa.shiro.tokenauthrealm.auth.TokenAuthenticators; +import org.opendaylight.aaa.tokenauthrealm.auth.TokenAuthenticators; import org.opendaylight.mdsal.binding.api.DataBroker; import org.opendaylight.yang.gen.v1.urn.opendaylight.aaa.app.config.rev170619.ShiroConfiguration; import org.opendaylight.yang.gen.v1.urn.opendaylight.aaa.app.config.rev170619.shiro.configuration.Main; 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 7d9b12d83..4c1fcb616 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 @@ -14,7 +14,7 @@ import org.opendaylight.aaa.api.AuthenticationService; import org.opendaylight.aaa.api.TokenStore; import org.opendaylight.aaa.api.password.service.PasswordHashService; import org.opendaylight.aaa.cert.api.ICertificateManager; -import org.opendaylight.aaa.shiro.tokenauthrealm.auth.TokenAuthenticators; +import org.opendaylight.aaa.tokenauthrealm.auth.TokenAuthenticators; import org.opendaylight.mdsal.binding.api.DataBroker; import org.opendaylight.yang.gen.v1.urn.opendaylight.aaa.app.config.rev170619.ShiroConfiguration; import org.slf4j.Logger; diff --git a/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/web/env/ThreadLocals.java b/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/web/env/ThreadLocals.java index 8763dc5ca..5cd3f7ea9 100644 --- a/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/web/env/ThreadLocals.java +++ b/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/web/env/ThreadLocals.java @@ -11,7 +11,7 @@ import org.opendaylight.aaa.api.AuthenticationService; import org.opendaylight.aaa.api.TokenStore; import org.opendaylight.aaa.api.password.service.PasswordHashService; import org.opendaylight.aaa.cert.api.ICertificateManager; -import org.opendaylight.aaa.shiro.tokenauthrealm.auth.TokenAuthenticators; +import org.opendaylight.aaa.tokenauthrealm.auth.TokenAuthenticators; import org.opendaylight.mdsal.binding.api.DataBroker; /** diff --git a/aaa-shiro/impl/src/test/java/org/opendaylight/aaa/shiro/realm/TokenAuthRealmTest.java b/aaa-shiro/impl/src/test/java/org/opendaylight/aaa/shiro/realm/TokenAuthRealmTest.java index 3c7d0a0a2..6070618f3 100644 --- a/aaa-shiro/impl/src/test/java/org/opendaylight/aaa/shiro/realm/TokenAuthRealmTest.java +++ b/aaa-shiro/impl/src/test/java/org/opendaylight/aaa/shiro/realm/TokenAuthRealmTest.java @@ -23,9 +23,9 @@ import org.junit.Before; import org.junit.Test; import org.opendaylight.aaa.shiro.realm.util.TokenUtils; import org.opendaylight.aaa.shiro.realm.util.http.header.HeaderUtils; -import org.opendaylight.aaa.shiro.tokenauthrealm.auth.AuthenticationManager; -import org.opendaylight.aaa.shiro.tokenauthrealm.auth.TokenAuthenticators; import org.opendaylight.aaa.shiro.web.env.ThreadLocals; +import org.opendaylight.aaa.tokenauthrealm.auth.AuthenticationManager; +import org.opendaylight.aaa.tokenauthrealm.auth.TokenAuthenticators; public class TokenAuthRealmTest { diff --git a/aaa-tokenauthrealm/pom.xml b/aaa-tokenauthrealm/pom.xml new file mode 100644 index 000000000..b79bba36d --- /dev/null +++ b/aaa-tokenauthrealm/pom.xml @@ -0,0 +1,46 @@ + + + + + org.opendaylight.aaa + aaa-parent + 0.14.2-SNAPSHOT + ../parent + + 4.0.0 + + aaa-tokenauthrealm + ODL :: aaa :: ${project.artifactId} + bundle + + + + + org.opendaylight.aaa + aaa-authn-api + + + + + com.google.guava + guava + + + org.osgi + osgi.cmpn + + + com.guicedee.services + javax.inject + true + + + diff --git a/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/tokenauthrealm/auth/AuthenticationBuilder.java b/aaa-tokenauthrealm/src/main/java/org/opendaylight/aaa/tokenauthrealm/auth/AuthenticationBuilder.java similarity index 98% rename from aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/tokenauthrealm/auth/AuthenticationBuilder.java rename to aaa-tokenauthrealm/src/main/java/org/opendaylight/aaa/tokenauthrealm/auth/AuthenticationBuilder.java index 649484e9e..dee4f1b05 100644 --- a/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/tokenauthrealm/auth/AuthenticationBuilder.java +++ b/aaa-tokenauthrealm/src/main/java/org/opendaylight/aaa/tokenauthrealm/auth/AuthenticationBuilder.java @@ -5,7 +5,7 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ -package org.opendaylight.aaa.shiro.tokenauthrealm.auth; +package org.opendaylight.aaa.tokenauthrealm.auth; import java.io.Serializable; import java.util.Objects; diff --git a/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/tokenauthrealm/auth/AuthenticationManager.java b/aaa-tokenauthrealm/src/main/java/org/opendaylight/aaa/tokenauthrealm/auth/AuthenticationManager.java similarity index 98% rename from aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/tokenauthrealm/auth/AuthenticationManager.java rename to aaa-tokenauthrealm/src/main/java/org/opendaylight/aaa/tokenauthrealm/auth/AuthenticationManager.java index d46dafc4e..2f31d3c64 100644 --- a/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/tokenauthrealm/auth/AuthenticationManager.java +++ b/aaa-tokenauthrealm/src/main/java/org/opendaylight/aaa/tokenauthrealm/auth/AuthenticationManager.java @@ -6,7 +6,7 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ -package org.opendaylight.aaa.shiro.tokenauthrealm.auth; +package org.opendaylight.aaa.tokenauthrealm.auth; import javax.inject.Singleton; import org.opendaylight.aaa.api.Authentication; diff --git a/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/tokenauthrealm/auth/ClaimBuilder.java b/aaa-tokenauthrealm/src/main/java/org/opendaylight/aaa/tokenauthrealm/auth/ClaimBuilder.java similarity index 98% rename from aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/tokenauthrealm/auth/ClaimBuilder.java rename to aaa-tokenauthrealm/src/main/java/org/opendaylight/aaa/tokenauthrealm/auth/ClaimBuilder.java index 10083cc26..37edb47c6 100644 --- a/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/tokenauthrealm/auth/ClaimBuilder.java +++ b/aaa-tokenauthrealm/src/main/java/org/opendaylight/aaa/tokenauthrealm/auth/ClaimBuilder.java @@ -5,7 +5,7 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ -package org.opendaylight.aaa.shiro.tokenauthrealm.auth; +package org.opendaylight.aaa.tokenauthrealm.auth; import com.google.common.base.Strings; import com.google.common.collect.ImmutableSet; diff --git a/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/tokenauthrealm/auth/HttpBasicAuth.java b/aaa-tokenauthrealm/src/main/java/org/opendaylight/aaa/tokenauthrealm/auth/HttpBasicAuth.java similarity index 98% rename from aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/tokenauthrealm/auth/HttpBasicAuth.java rename to aaa-tokenauthrealm/src/main/java/org/opendaylight/aaa/tokenauthrealm/auth/HttpBasicAuth.java index 370b885d4..05d49b16d 100644 --- a/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/tokenauthrealm/auth/HttpBasicAuth.java +++ b/aaa-tokenauthrealm/src/main/java/org/opendaylight/aaa/tokenauthrealm/auth/HttpBasicAuth.java @@ -6,7 +6,7 @@ * and is available at http://www.eclipse.org/legal/epl-v10.html */ -package org.opendaylight.aaa.shiro.tokenauthrealm.auth; +package org.opendaylight.aaa.tokenauthrealm.auth; import java.nio.charset.StandardCharsets; import java.util.Base64; diff --git a/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/tokenauthrealm/auth/PasswordCredentialBuilder.java b/aaa-tokenauthrealm/src/main/java/org/opendaylight/aaa/tokenauthrealm/auth/PasswordCredentialBuilder.java similarity index 97% rename from aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/tokenauthrealm/auth/PasswordCredentialBuilder.java rename to aaa-tokenauthrealm/src/main/java/org/opendaylight/aaa/tokenauthrealm/auth/PasswordCredentialBuilder.java index d35b4a10b..0d2996dc8 100644 --- a/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/tokenauthrealm/auth/PasswordCredentialBuilder.java +++ b/aaa-tokenauthrealm/src/main/java/org/opendaylight/aaa/tokenauthrealm/auth/PasswordCredentialBuilder.java @@ -5,7 +5,7 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ -package org.opendaylight.aaa.shiro.tokenauthrealm.auth; +package org.opendaylight.aaa.tokenauthrealm.auth; import java.util.Objects; import org.opendaylight.aaa.api.PasswordCredentials; diff --git a/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/tokenauthrealm/auth/TokenAuthenticators.java b/aaa-tokenauthrealm/src/main/java/org/opendaylight/aaa/tokenauthrealm/auth/TokenAuthenticators.java similarity index 93% rename from aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/tokenauthrealm/auth/TokenAuthenticators.java rename to aaa-tokenauthrealm/src/main/java/org/opendaylight/aaa/tokenauthrealm/auth/TokenAuthenticators.java index af3868ff4..6cf409ebe 100644 --- a/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/tokenauthrealm/auth/TokenAuthenticators.java +++ b/aaa-tokenauthrealm/src/main/java/org/opendaylight/aaa/tokenauthrealm/auth/TokenAuthenticators.java @@ -5,7 +5,7 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ -package org.opendaylight.aaa.shiro.tokenauthrealm.auth; +package org.opendaylight.aaa.tokenauthrealm.auth; import com.google.common.collect.ImmutableList; import java.util.Collection; diff --git a/aaa-shiro/impl/src/test/java/org/opendaylight/aaa/shiro/tokenauthrealm/auth/AuthenticationBuilderTest.java b/aaa-tokenauthrealm/src/test/java/org/opendaylight/aaa/tokenauthrealm/auth/AuthenticationBuilderTest.java similarity index 98% rename from aaa-shiro/impl/src/test/java/org/opendaylight/aaa/shiro/tokenauthrealm/auth/AuthenticationBuilderTest.java rename to aaa-tokenauthrealm/src/test/java/org/opendaylight/aaa/tokenauthrealm/auth/AuthenticationBuilderTest.java index 39e3d08b2..49dc030d7 100644 --- a/aaa-shiro/impl/src/test/java/org/opendaylight/aaa/shiro/tokenauthrealm/auth/AuthenticationBuilderTest.java +++ b/aaa-tokenauthrealm/src/test/java/org/opendaylight/aaa/tokenauthrealm/auth/AuthenticationBuilderTest.java @@ -6,7 +6,7 @@ * and is available at http://www.eclipse.org/legal/epl-v10.html */ -package org.opendaylight.aaa.shiro.tokenauthrealm.auth; +package org.opendaylight.aaa.tokenauthrealm.auth; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; diff --git a/aaa-shiro/impl/src/test/java/org/opendaylight/aaa/shiro/tokenauthrealm/auth/AuthenticationManagerTest.java b/aaa-tokenauthrealm/src/test/java/org/opendaylight/aaa/tokenauthrealm/auth/AuthenticationManagerTest.java similarity index 98% rename from aaa-shiro/impl/src/test/java/org/opendaylight/aaa/shiro/tokenauthrealm/auth/AuthenticationManagerTest.java rename to aaa-tokenauthrealm/src/test/java/org/opendaylight/aaa/tokenauthrealm/auth/AuthenticationManagerTest.java index 109f2ec3f..0496dbac9 100644 --- a/aaa-shiro/impl/src/test/java/org/opendaylight/aaa/shiro/tokenauthrealm/auth/AuthenticationManagerTest.java +++ b/aaa-tokenauthrealm/src/test/java/org/opendaylight/aaa/tokenauthrealm/auth/AuthenticationManagerTest.java @@ -5,7 +5,7 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ -package org.opendaylight.aaa.shiro.tokenauthrealm.auth; +package org.opendaylight.aaa.tokenauthrealm.auth; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; diff --git a/aaa-shiro/impl/src/test/java/org/opendaylight/aaa/shiro/tokenauthrealm/auth/ClaimBuilderTest.java b/aaa-tokenauthrealm/src/test/java/org/opendaylight/aaa/tokenauthrealm/auth/ClaimBuilderTest.java similarity index 99% rename from aaa-shiro/impl/src/test/java/org/opendaylight/aaa/shiro/tokenauthrealm/auth/ClaimBuilderTest.java rename to aaa-tokenauthrealm/src/test/java/org/opendaylight/aaa/tokenauthrealm/auth/ClaimBuilderTest.java index d000cc5c6..73635e8df 100644 --- a/aaa-shiro/impl/src/test/java/org/opendaylight/aaa/shiro/tokenauthrealm/auth/ClaimBuilderTest.java +++ b/aaa-tokenauthrealm/src/test/java/org/opendaylight/aaa/tokenauthrealm/auth/ClaimBuilderTest.java @@ -6,7 +6,7 @@ * and is available at http://www.eclipse.org/legal/epl-v10.html */ -package org.opendaylight.aaa.shiro.tokenauthrealm.auth; +package org.opendaylight.aaa.tokenauthrealm.auth; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; diff --git a/aaa-shiro/impl/src/test/java/org/opendaylight/aaa/shiro/tokenauthrealm/auth/HttpBasicAuthTest.java b/aaa-tokenauthrealm/src/test/java/org/opendaylight/aaa/tokenauthrealm/auth/HttpBasicAuthTest.java similarity index 98% rename from aaa-shiro/impl/src/test/java/org/opendaylight/aaa/shiro/tokenauthrealm/auth/HttpBasicAuthTest.java rename to aaa-tokenauthrealm/src/test/java/org/opendaylight/aaa/tokenauthrealm/auth/HttpBasicAuthTest.java index a8838480a..e330a074f 100644 --- a/aaa-shiro/impl/src/test/java/org/opendaylight/aaa/shiro/tokenauthrealm/auth/HttpBasicAuthTest.java +++ b/aaa-tokenauthrealm/src/test/java/org/opendaylight/aaa/tokenauthrealm/auth/HttpBasicAuthTest.java @@ -5,7 +5,7 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ -package org.opendaylight.aaa.shiro.tokenauthrealm.auth; +package org.opendaylight.aaa.tokenauthrealm.auth; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; diff --git a/aaa-shiro/impl/src/test/java/org/opendaylight/aaa/shiro/tokenauthrealm/auth/PasswordCredentialTest.java b/aaa-tokenauthrealm/src/test/java/org/opendaylight/aaa/tokenauthrealm/auth/PasswordCredentialTest.java similarity index 95% rename from aaa-shiro/impl/src/test/java/org/opendaylight/aaa/shiro/tokenauthrealm/auth/PasswordCredentialTest.java rename to aaa-tokenauthrealm/src/test/java/org/opendaylight/aaa/tokenauthrealm/auth/PasswordCredentialTest.java index 782d9cf4b..8842ea462 100644 --- a/aaa-shiro/impl/src/test/java/org/opendaylight/aaa/shiro/tokenauthrealm/auth/PasswordCredentialTest.java +++ b/aaa-tokenauthrealm/src/test/java/org/opendaylight/aaa/tokenauthrealm/auth/PasswordCredentialTest.java @@ -6,7 +6,7 @@ * and is available at http://www.eclipse.org/legal/epl-v10.html */ -package org.opendaylight.aaa.shiro.tokenauthrealm.auth; +package org.opendaylight.aaa.tokenauthrealm.auth; import static org.junit.Assert.assertEquals; diff --git a/artifacts/pom.xml b/artifacts/pom.xml index 672e772a6..aec8e317b 100644 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -87,6 +87,12 @@ config + + ${project.groupId} + aaa-idm-store-h2 + ${project.version} + + ${project.groupId} aaa-shiro @@ -105,6 +111,11 @@ aaa-shiro ${project.version} + + ${project.groupId} + aaa-tokenauthrealm + ${project.version} + ${project.groupId} repackaged-shiro diff --git a/pom.xml b/pom.xml index 4553b721b..5dd4fc457 100644 --- a/pom.xml +++ b/pom.xml @@ -33,11 +33,13 @@ aaa-cli aaa-cli-jar aaa-filterchain + aaa-idm-store-h2 aaa-password-service artifacts features parent aaa-shiro + aaa-tokenauthrealm dependency-check web docs -- 2.36.6