Class JdbcSecondFactorAttemptRepository

java.lang.Object
com.irurueta.authserver.authorization.infrastructure.persistence.mfa.JdbcSecondFactorAttemptRepository
All Implemented Interfaces:
SecondFactorAttemptRepository

@Repository public class JdbcSecondFactorAttemptRepository extends Object implements SecondFactorAttemptRepository
SecondFactorAttemptRepository over the second_factor_attempts table.
  • Field Details

    • FIND_ATTEMPTS

      private static final String FIND_ATTEMPTS
      Query returning the state of a user.
      See Also:
    • ENSURE_ATTEMPTS

      private static final String ENSURE_ATTEMPTS
      Statement that creates the clean state of a user unless one exists, so there is always a row to lock.
      See Also:
    • LOCK_ATTEMPTS

      private static final String LOCK_ATTEMPTS
      Query returning the state of a user and locking its row until the end of the transaction: a concurrent verification of the same user waits here until the first one commits.
      See Also:
    • RESET_ATTEMPTS

      private static final String RESET_ATTEMPTS
      Statement that clears the counter and the lock, keeping the row so later verifications can lock it.
      See Also:
    • RECORD_FAILURE

      private static final String RECORD_FAILURE
      Single-statement upsert that counts one failure and sets the lock when the maximum is reached. A lock that has already ended restarts the counter at one. Concurrent failures serialize on the row, so none is lost.
      See Also:
    • jdbcClient

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

      private final SecondFactorLockoutRowMapper secondFactorLockoutRowMapper
      Maps a row to the state of a user.
  • Constructor Details

    • JdbcSecondFactorAttemptRepository

      public JdbcSecondFactorAttemptRepository()
  • Method Details