DVCredentialGuard class

Sign-in and sign-up with the credential defences in front of an AuthProvider.

Constructors

DVCredentialGuard({required AuthProvider provider, DVVelocityLimiter? velocity, DVBreachedPasswords? breachedPasswords, DVBotProtection? botProtection, bool breachCheckFailsClosed = false, Duration refusalFloor = const Duration(milliseconds: 400), DateTime clock()?, Future<void> delay(Duration duration)?})

Properties

botProtection → DVBotProtection?
final
breachCheckFailsClosed → bool
Whether sign-up and password change are refused while the breach corpus cannot be asked. Off by default, and logged when it happens: the check is hygiene on top of hashing, and a sign-up form that depends on someone else's uptime is the dependency the spec declines for captchas.
final
breachedPasswords → DVBreachedPasswords?
final
hashCode → int
The hash code for this object.
no setterinherited
provider → AuthProvider
final
refusalFloor → Duration
The least time a refused sign-in takes, however quickly the provider answered, so an unknown account is not refused faster than a wrong password.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
velocity → DVVelocityLimiter
final

Methods

checkNewPassword(String password) → Future<void>
Throws DVBreachedPasswordRefusal for a password in the breach corpus. Call it on every password change as well as sign-up.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
signIn(String email, String password, {required String source}) → Future<AuthUser?>
Signs in, or throws credentialsRefused or a DVVelocityRefusal.
signUp(String email, String password, {String? name, required String source, String? challengeToken}) → Future<AuthUser?>
Signs up after the source limit, the challenge and the breach check pass.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

credentialsRefused → const AuthException
The one refusal a bad sign-in gets, whether or not the account exists.