Class InMemoryRecoveryCodeRepository
java.lang.Object
com.codename1.backend.security.mfa.InMemoryRecoveryCodeRepository
- All Implemented Interfaces:
RecoveryCodeRepository
Recovery codes kept in this process: gone when it stops. For development
and tests; see
JdbcRecoveryCodeRepository otherwise.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanUses one code up.intHow many codesusernamehas left.findHashes(String username) A snapshot of the user's salted password hashes, for checking a presented code.voidReplaces every code ofusernamewith these hashes.
-
Constructor Details
-
InMemoryRecoveryCodeRepository
public InMemoryRecoveryCodeRepository()
-
-
Method Details
-
replace
Description copied from interface:RecoveryCodeRepositoryReplaces every code ofusernamewith these hashes.- Specified by:
replacein interfaceRecoveryCodeRepository
-
findHashes
Description copied from interface:RecoveryCodeRepositoryA snapshot of the user's salted password hashes, for checking a presented code. An unknown user has an empty list. Consumption still goes throughRecoveryCodeRepository.consume(String, String).- Specified by:
findHashesin interfaceRecoveryCodeRepository
-
consume
Description copied from interface:RecoveryCodeRepositoryUses one code up.
The test and the removal are one step: a code is good once, however many requests present it at the same moment.
- Specified by:
consumein interfaceRecoveryCodeRepository- Returns:
- whether this call removed it
-
count
Description copied from interface:RecoveryCodeRepositoryHow many codesusernamehas left.- Specified by:
countin interfaceRecoveryCodeRepository
-