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 <tadei.bilan@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
</dependency>
<dependency>
<groupId>org.opendaylight.aaa</groupId>
- <artifactId>aaa-shiro</artifactId>
+ <artifactId>aaa-idm-store-h2</artifactId>
<exclusions>
<exclusion>
- <!-- Completely disable transitive dependencies -->
+ <!-- Completely disable transitive dependencies -->
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2021 PANTHEON.tech, s.r.o. and others. All rights reserved.
+
+ This program and the accompanying materials are made available under the
+ terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ and is available at http://www.eclipse.org/legal/epl-v10.html
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.opendaylight.aaa</groupId>
+ <artifactId>aaa-parent</artifactId>
+ <version>0.14.2-SNAPSHOT</version>
+ <relativePath>../parent</relativePath>
+ </parent>
+
+ <artifactId>aaa-idm-store-h2</artifactId>
+ <name>ODL :: aaa :: ${project.artifactId}</name>
+ <packaging>bundle</packaging>
+
+ <dependencies>
+ <!-- Internal aaa dependencies -->
+ <dependency>
+ <groupId>org.opendaylight.aaa</groupId>
+ <artifactId>aaa-authn-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.aaa</groupId>
+ <artifactId>aaa-tokenauthrealm</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.aaa</groupId>
+ <artifactId>aaa-password-service-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.aaa</groupId>
+ <artifactId>aaa-password-service-impl</artifactId>
+ </dependency>
+
+ <!-- OSGI dependencies -->
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>osgi.cmpn</artifactId>
+ </dependency>
+
+ <!-- External dependencies -->
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-text</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.ehcache</groupId>
+ <artifactId>ehcache</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.immutables</groupId>
+ <artifactId>value</artifactId>
+ <classifier>annotations</classifier>
+ </dependency>
+ <dependency>
+ <groupId>com.h2database</groupId>
+ <artifactId>h2</artifactId>
+ </dependency>
+
+ <!-- Test dependencies -->
+ <dependency>
+ <groupId>com.google.truth</groupId>
+ <artifactId>truth</artifactId>
+ </dependency>
+ </dependencies>
+</project>
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.
<groupId>org.opendaylight.aaa</groupId>
<artifactId>aaa-shiro-api</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.opendaylight.aaa</groupId>
+ <artifactId>aaa-tokenauthrealm</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.aaa</groupId>
+ <artifactId>aaa-idm-store-h2</artifactId>
+ </dependency>
<!-- jersey client for moon authN -->
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
</dependency>
- <dependency>
- <groupId>com.h2database</groupId>
- <artifactId>h2</artifactId>
- </dependency>
<dependency>
<groupId>org.immutables</groupId>
<artifactId>value</artifactId>
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,
<!-- TODO: This is temporary until we can find a better spot for GsonProvider. -->
org.opendaylight.aaa.provider,
- org.opendaylight.aaa.shiro.web.env,
- org.opendaylight.aaa.datastore.h2.*,
+ org.opendaylight.aaa.shiro.web.env
</Export-Package>
<Import-Package>
!javax.annotation,
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;
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;
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;
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.
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;
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;
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.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 {
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2021 PANTHEON.tech, s.r.o. and others. All rights reserved.
+
+ This program and the accompanying materials are made available under the
+ terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ and is available at http://www.eclipse.org/legal/epl-v10.html
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <groupId>org.opendaylight.aaa</groupId>
+ <artifactId>aaa-parent</artifactId>
+ <version>0.14.2-SNAPSHOT</version>
+ <relativePath>../parent</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>aaa-tokenauthrealm</artifactId>
+ <name>ODL :: aaa :: ${project.artifactId}</name>
+ <packaging>bundle</packaging>
+
+ <dependencies>
+ <!-- Internal aaa dependencies -->
+ <dependency>
+ <groupId>org.opendaylight.aaa</groupId>
+ <artifactId>aaa-authn-api</artifactId>
+ </dependency>
+
+ <!-- External dependencies -->
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>osgi.cmpn</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.guicedee.services</groupId>
+ <artifactId>javax.inject</artifactId>
+ <optional>true</optional>
+ </dependency>
+ </dependencies>
+</project>
* 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;
* 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;
* 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;
* 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;
* 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;
* 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;
* 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;
* 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;
* 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;
* 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;
* 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;
<classifier>config</classifier>
</dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>aaa-idm-store-h2</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>aaa-shiro</artifactId>
<artifactId>aaa-shiro</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>aaa-tokenauthrealm</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>repackaged-shiro</artifactId>
<module>aaa-cli</module>
<module>aaa-cli-jar</module>
<module>aaa-filterchain</module>
+ <module>aaa-idm-store-h2</module>
<module>aaa-password-service</module>
<module>artifacts</module>
<module>features</module>
<module>parent</module>
<module>aaa-shiro</module>
+ <module>aaa-tokenauthrealm</module>
<module>dependency-check</module>
<module>web</module>
<module>docs</module>