Class JdbcTrustedDeviceRepository
java.lang.Object
com.irurueta.authserver.authorization.infrastructure.persistence.mfa.JdbcTrustedDeviceRepository
- All Implemented Interfaces:
TrustedDeviceRepository
@Repository
public class JdbcTrustedDeviceRepository
extends Object
implements TrustedDeviceRepository
TrustedDeviceRepository over the trusted_devices table. It joins the transaction of its caller.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final StringColumns selected for every query.private static final StringQuery returning the unexpired devices of a user, newest first.private static final StringQuery returning an unexpired device of a user by the hash of its token.private static final StringStatement storing a device.private final org.springframework.jdbc.core.simple.JdbcClientJDBC client used to run the statements.private final TrustedDeviceRowMapperMaps a row to a device. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintdeleteByUser(UUID userId) intdeleteExpired(Instant now) findByUser(UUID userId, Instant now) findUsable(UUID userId, String hashedToken, Instant now) booleanvoidstore(TrustedDevice device)
-
Field Details
-
COLUMNS
Columns selected for every query.- See Also:
-
INSERT_DEVICE
Statement storing a device.- See Also:
-
FIND_USABLE
Query returning an unexpired device of a user by the hash of its token.- See Also:
-
FIND_BY_USER
Query returning the unexpired devices of a user, newest first.- See Also:
-
jdbcClient
private final org.springframework.jdbc.core.simple.JdbcClient jdbcClientJDBC client used to run the statements. -
trustedDeviceRowMapper
Maps a row to a device.
-
-
Constructor Details
-
JdbcTrustedDeviceRepository
public JdbcTrustedDeviceRepository()
-
-
Method Details
-
store
- Specified by:
storein interfaceTrustedDeviceRepository
-
findUsable
- Specified by:
findUsablein interfaceTrustedDeviceRepository
-
findByUser
- Specified by:
findByUserin interfaceTrustedDeviceRepository
-
revoke
- Specified by:
revokein interfaceTrustedDeviceRepository
-
deleteByUser
- Specified by:
deleteByUserin interfaceTrustedDeviceRepository
-
deleteExpired
- Specified by:
deleteExpiredin interfaceTrustedDeviceRepository
-