InMemoryAuthTwoFactorBackend constructor

InMemoryAuthTwoFactorBackend({
  1. InMemoryAuthTwoFactorStore? factorStore,
  2. InMemoryAuthTwoFactorChallengeStore? challengeStore,
  3. InMemoryAuthTwoFactorTrustedDeviceStore? trustedDeviceStore,
  4. InMemoryAuthTwoFactorStepUpStore? stepUpStore,
  5. AuthTwoFactorFaultInjector? faultInjector,
  6. DateTime clock()?,
})

Creates a transactional in-memory two-factor backend.

Individual stores may be supplied to inspect or seed state in tests. If omitted, bounded in-memory stores are created for each capability.

Implementation

InMemoryAuthTwoFactorBackend({
  InMemoryAuthTwoFactorStore? factorStore,
  InMemoryAuthTwoFactorChallengeStore? challengeStore,
  InMemoryAuthTwoFactorTrustedDeviceStore? trustedDeviceStore,
  InMemoryAuthTwoFactorStepUpStore? stepUpStore,
  this.faultInjector,
  DateTime Function()? clock,
}) : factorStore = factorStore ?? InMemoryAuthTwoFactorStore(),
     challengeStore =
         challengeStore ?? InMemoryAuthTwoFactorChallengeStore(clock: clock),
     trustedDeviceStore =
         trustedDeviceStore ??
         InMemoryAuthTwoFactorTrustedDeviceStore(clock: clock),
     stepUpStore =
         stepUpStore ?? InMemoryAuthTwoFactorStepUpStore(clock: clock);