Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dal/cockroachdb-dal/cockroachdb-cache/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>cockroachdb-dal</artifactId>
<groupId>com.nexblocks.authguard</groupId>
<version>0.22.0</version>
<version>0.23.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion dal/cockroachdb-dal/cockroachdb-persistence/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>cockroachdb-dal</artifactId>
<groupId>com.nexblocks.authguard</groupId>
<version>0.22.0</version>
<version>0.23.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion dal/cockroachdb-dal/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>dal-extensions-parent</artifactId>
<groupId>com.nexblocks.authguard</groupId>
<version>0.22.0</version>
<version>0.23.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion dal/hibernate-dal/hibernate-cache/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>hibernate-dal</artifactId>
<groupId>com.nexblocks.authguard</groupId>
<version>0.22.0</version>
<version>0.23.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@
import com.google.inject.Inject;
import com.nexblocks.authguard.dal.cache.SessionsRepository;
import com.nexblocks.authguard.dal.hibernate.common.AbstractHibernateRepository;
import com.nexblocks.authguard.dal.hibernate.common.CommonFields;
import com.nexblocks.authguard.dal.hibernate.common.QueryExecutor;
import com.nexblocks.authguard.dal.model.SessionDO;

import java.util.List;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;

public class HibernateSessionsRepository extends AbstractHibernateRepository<SessionDO>
implements SessionsRepository {
private static final String GET_BY_TOKEN = "sessions.getByToken";
private static final String GET_BY_ACCOUNT_ID = "getByAccountId";
private static final String TOKEN_FIELD = "token";

@Inject
Expand All @@ -36,4 +39,12 @@ public CompletableFuture<Optional<SessionDO>> deleteByToken(final String session
return CompletableFuture.completedFuture(Optional.empty());
});
}

@Override
public CompletableFuture<List<SessionDO>> findByAccountId(final long accountId, final String domain) {
return queryExecutor.getAList(session -> session.createNamedQuery(GET_BY_ACCOUNT_ID, SessionDO.class)
.setParameter(CommonFields.DOMAIN, domain)
.setParameter(CommonFields.ACCOUNT_ID, accountId));

}
}
2 changes: 1 addition & 1 deletion dal/hibernate-dal/hibernate-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>hibernate-dal</artifactId>
<groupId>com.nexblocks.authguard</groupId>
<version>0.22.0</version>
<version>0.23.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion dal/hibernate-dal/hibernate-persistence/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>hibernate-dal</artifactId>
<groupId>com.nexblocks.authguard</groupId>
<version>0.22.0</version>
<version>0.23.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion dal/hibernate-dal/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>dal-extensions-parent</artifactId>
<groupId>com.nexblocks.authguard</groupId>
<version>0.22.0</version>
<version>0.23.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion dal/memory-dal/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>dal-extensions-parent</artifactId>
<groupId>com.nexblocks.authguard</groupId>
<version>0.22.0</version>
<version>0.23.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
import com.nexblocks.authguard.dal.model.SessionDO;

import javax.inject.Singleton;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;

@Singleton
public class MockSessionsRepository extends AbstractRepository<SessionDO>
Expand All @@ -26,4 +29,13 @@ public CompletableFuture<Optional<SessionDO>> deleteByToken(final String session
return opt;
});
}

@Override
public CompletableFuture<List<SessionDO>> findByAccountId(final long accountId, final String domain) {
return CompletableFuture.supplyAsync(() -> getRepo().values()
.stream()
.filter(session -> Objects.equals(accountId, session.getAccountId())
&& Objects.equals(domain, session.getDomain()))
.collect(Collectors.toList()));
}
}
2 changes: 1 addition & 1 deletion dal/mongo-dal/mongo-cache/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>mongo-dal</artifactId>
<groupId>com.nexblocks.authguard</groupId>
<version>0.22.0</version>
<version>0.23.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.nexblocks.authguard.dal.mongo.common.setup.MongoClientWrapper;
import com.nexblocks.authguard.dal.mongo.config.Defaults;

import java.util.List;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;

Expand All @@ -28,4 +29,10 @@ public CompletableFuture<Optional<SessionDO>> getByToken(final String token) {
public CompletableFuture<Optional<SessionDO>> deleteByToken(final String sessionToken) {
return facade.deleteByFilter(Filters.eq("sessionToken", sessionToken));
}

@Override
public CompletableFuture<List<SessionDO>> findByAccountId(final long accountId, final String domain) {
return facade.find(Filters.and(Filters.eq("accountId", accountId),
Filters.eq("domain", domain)));
}
}
2 changes: 1 addition & 1 deletion dal/mongo-dal/mongo-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>mongo-dal</artifactId>
<groupId>com.nexblocks.authguard</groupId>
<version>0.22.0</version>
<version>0.23.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion dal/mongo-dal/mongo-persistence/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>mongo-dal</artifactId>
<groupId>com.nexblocks.authguard</groupId>
<version>0.22.0</version>
<version>0.23.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion dal/mongo-dal/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>dal-extensions-parent</artifactId>
<groupId>com.nexblocks.authguard</groupId>
<version>0.22.0</version>
<version>0.23.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion dal/mysql-dal/mysql-cache/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>mysql-dal</artifactId>
<groupId>com.nexblocks.authguard</groupId>
<version>0.22.0</version>
<version>0.23.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion dal/mysql-dal/mysql-persistence/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>mysql-dal</artifactId>
<groupId>com.nexblocks.authguard</groupId>
<version>0.22.0</version>
<version>0.23.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion dal/mysql-dal/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>dal-extensions-parent</artifactId>
<groupId>com.nexblocks.authguard</groupId>
<version>0.22.0</version>
<version>0.23.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion dal/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>extensions</artifactId>
<groupId>com.nexblocks.authguard</groupId>
<version>0.22.0</version>
<version>0.23.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion dal/postgres-dal/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>dal-extensions-parent</artifactId>
<groupId>com.nexblocks.authguard</groupId>
<version>0.22.0</version>
<version>0.23.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion dal/postgres-dal/postgres-cache/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>postgres-dal</artifactId>
<groupId>com.nexblocks.authguard</groupId>
<version>0.22.0</version>
<version>0.23.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion dal/postgres-dal/postgres-persistence/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>postgres-dal</artifactId>
<groupId>com.nexblocks.authguard</groupId>
<version>0.22.0</version>
<version>0.23.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion dal/redis-cache/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>dal-extensions-parent</artifactId>
<groupId>com.nexblocks.authguard</groupId>
<version>0.22.0</version>
<version>0.23.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import java.time.Duration;
import java.time.Instant;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;

Expand Down Expand Up @@ -48,4 +49,10 @@ public CompletableFuture<Optional<SessionDO>> getByToken(final String sessionTok
public CompletableFuture<Optional<SessionDO>> deleteByToken(final String sessionToken) {
return redisRepository.delete(sessionToken);
}

@Override
public CompletableFuture<List<SessionDO>> findByAccountId(final long accountId, final String domain) {
throw new UnsupportedOperationException("Retrieving sessions by account ID isn't " +
"currently supported by Redis cache implementation");
}
}
2 changes: 1 addition & 1 deletion email/javamail-provider/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>email-extensions-parent</artifactId>
<groupId>com.nexblocks.authguard</groupId>
<version>0.22.0</version>
<version>0.23.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion email/log-email/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>email-extensions-parent</artifactId>
<groupId>com.nexblocks.authguard</groupId>
<version>0.22.0</version>
<version>0.23.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion email/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>extensions</artifactId>
<groupId>com.nexblocks.authguard</groupId>
<version>0.22.0</version>
<version>0.23.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion email/sendgrid-provider/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>email-extensions-parent</artifactId>
<groupId>com.nexblocks.authguard</groupId>
<version>0.22.0</version>
<version>0.23.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion emb/kafka-bridge/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<artifactId>emb-parent</artifactId>
<groupId>com.nexblocks.authguard</groupId>
<version>0.22.0</version>
<version>0.23.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion emb/log-emb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>emb-parent</artifactId>
<groupId>com.nexblocks.authguard</groupId>
<version>0.22.0</version>
<version>0.23.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
4 changes: 2 additions & 2 deletions emb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
<parent>
<artifactId>extensions</artifactId>
<groupId>com.nexblocks.authguard</groupId>
<version>0.22.0</version>
<version>0.23.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

<name>Extensions :: EMB</name>

<artifactId>emb-parent</artifactId>
<version>0.22.0</version>
<version>0.23.0</version>

<packaging>pom</packaging>

Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<groupId>com.nexblocks.authguard</groupId>
<artifactId>extensions</artifactId>
<packaging>pom</packaging>
<version>0.22.0</version>
<version>0.23.0</version>

<repositories>
<repository>
Expand Down Expand Up @@ -38,7 +38,7 @@

<maven-compiler.version>3.8.0</maven-compiler.version>

<authguard.version>0.22.0</authguard.version>
<authguard.version>0.23.0</authguard.version>
<guice.version>4.2.2</guice.version>
<jackson.version>2.12.6</jackson.version>
<immutables.version>2.9.0</immutables.version>
Expand Down
2 changes: 1 addition & 1 deletion sms/log-sms/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>sms-extensions-parent</artifactId>
<groupId>com.nexblocks.authguard</groupId>
<version>0.22.0</version>
<version>0.23.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion sms/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>extensions</artifactId>
<groupId>com.nexblocks.authguard</groupId>
<version>0.22.0</version>
<version>0.23.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Loading