EmailIdpUtils constructor
EmailIdpUtils({
- required EmailIdpConfig config,
- AuthUsers authUsers = const AuthUsers(),
Creates a new instance of EmailIdpUtils.
Implementation
EmailIdpUtils({
required final EmailIdpConfig config,
final AuthUsers authUsers = const AuthUsers(),
}) : hashUtil = Argon2HashUtil(
hashPepper: config.secretHashPepper,
fallbackHashPeppers: config.fallbackSecretHashPeppers,
hashSaltLength: config.secretHashSaltLength,
// 19MiB memory cost as recommended by OWASP: https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html#argon2id
parameters: Argon2HashParameters(memory: 19456),
),
account = EmailIdpAccountUtils() {
accountCreation = EmailIdpAccountCreationUtil(
config: EmailIdpAccountCreationUtilsConfig.fromEmailIdpConfig(config),
passwordHashUtils: hashUtil,
authUsers: authUsers,
);
passwordReset = EmailIdpPasswordResetUtil(
config: EmailIdpPasswordResetUtilsConfig.fromEmailIdpConfig(config),
passwordHashUtils: hashUtil,
);
authentication = EmailIdpAuthenticationUtil(
hashUtil: hashUtil,
failedLoginRateLimit: config.failedLoginRateLimit,
);
}