java.lang.Object
com.irurueta.authserver.authorization.infrastructure.persistence.totp.JdbcRecoveryCodeRepository
All Implemented Interfaces:
RecoveryCodeRepository

@Repository public class JdbcRecoveryCodeRepository extends Object implements RecoveryCodeRepository
RecoveryCodeRepository over the recovery_codes table. It opens no transaction: replacing the codes of a user runs in the caller's.
  • Field Details

    • DELETE_BY_USER

      private static final String DELETE_BY_USER
      Statement deleting every code of a user.
      See Also:
    • INSERT

      private static final String INSERT
      Statement storing a code.
      See Also:
    • FIND_UNUSED

      private static final String FIND_UNUSED
      Query returning the codes of a user that have not been spent.
      See Also:
    • MARK_USED

      private static final String MARK_USED
      Statement that spends a code only when it is unused, atomically.
      See Also:
    • jdbcClient

      private final org.springframework.jdbc.core.simple.JdbcClient jdbcClient
      JDBC client used to run the statements.
    • recoveryCodeRowMapper

      private final RecoveryCodeRowMapper recoveryCodeRowMapper
      Maps a row to a code.
  • Constructor Details

    • JdbcRecoveryCodeRepository

      public JdbcRecoveryCodeRepository()
  • Method Details