Class JdbcTotpCredentialRepository
java.lang.Object
com.irurueta.authserver.authorization.infrastructure.persistence.totp.JdbcTotpCredentialRepository
- All Implemented Interfaces:
TotpCredentialRepository
@Repository
public class JdbcTotpCredentialRepository
extends Object
implements TotpCredentialRepository
TotpCredentialRepository over the totp_credentials table.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final StringStatement that records a step only when it is newer than the stored one, atomically.private static final StringStatement confirming the credential of a user.private static final StringStatement deleting the credential of a user.private static final StringQuery returning the credential of a user.private final org.springframework.jdbc.core.simple.JdbcClientJDBC client used to run the statements.private final TotpCredentialRowMapperMaps a row to a credential.private static final StringStatement inserting a credential, or replacing the one of the same user. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanadvanceLastUsedStep(UUID userId, long step) voidvoiddeleteByUser(UUID userId) findByUser(UUID userId) voidsave(TotpCredential credential)
-
Field Details
-
FIND_BY_USER
Query returning the credential of a user.- See Also:
-
UPSERT
Statement inserting a credential, or replacing the one of the same user.- See Also:
-
CONFIRM
Statement confirming the credential of a user.- See Also:
-
ADVANCE_LAST_USED_STEP
Statement that records a step only when it is newer than the stored one, atomically.- See Also:
-
DELETE_BY_USER
Statement deleting the credential of a user.- See Also:
-
jdbcClient
private final org.springframework.jdbc.core.simple.JdbcClient jdbcClientJDBC client used to run the statements. -
totpCredentialRowMapper
Maps a row to a credential.
-
-
Constructor Details
-
JdbcTotpCredentialRepository
public JdbcTotpCredentialRepository()
-
-
Method Details
-
findByUser
- Specified by:
findByUserin interfaceTotpCredentialRepository
-
save
- Specified by:
savein interfaceTotpCredentialRepository
-
confirm
- Specified by:
confirmin interfaceTotpCredentialRepository
-
advanceLastUsedStep
- Specified by:
advanceLastUsedStepin interfaceTotpCredentialRepository
-
deleteByUser
- Specified by:
deleteByUserin interfaceTotpCredentialRepository
-