2020-03-16 14:02:08 +01:00
using Microsoft.Extensions.Configuration ;
2020-03-19 19:06:05 +01:00
using Umbraco.Core ;
2020-03-16 14:02:08 +01:00
using Umbraco.Core.Configuration ;
namespace Umbraco.Configuration.Models
{
internal class MemberPasswordConfigurationSettings : IMemberPasswordConfiguration
{
2020-03-19 19:06:05 +01:00
private const string Prefix = Constants . Configuration . ConfigSecurityPrefix + "MemberPassword:" ;
2020-03-16 14:02:08 +01:00
private readonly IConfiguration _configuration ;
2020-03-18 11:29:29 +01:00
2020-03-16 14:02:08 +01:00
public MemberPasswordConfigurationSettings ( IConfiguration configuration )
{
_configuration = configuration ;
}
2020-03-18 11:29:29 +01:00
public int RequiredLength = >
2020-03-19 19:06:05 +01:00
_configuration . GetValue ( Prefix + "RequiredLength" , 10 ) ;
2020-03-18 11:29:29 +01:00
public bool RequireNonLetterOrDigit = >
2020-03-19 19:06:05 +01:00
_configuration . GetValue ( Prefix + "RequireNonLetterOrDigit" , false ) ;
2020-03-18 11:29:29 +01:00
public bool RequireDigit = >
2020-03-19 19:06:05 +01:00
_configuration . GetValue ( Prefix + "RequireDigit" , false ) ;
2020-03-18 11:29:29 +01:00
public bool RequireLowercase = >
2020-03-19 19:06:05 +01:00
_configuration . GetValue ( Prefix + "RequireLowercase" , false ) ;
2020-03-18 11:29:29 +01:00
public bool RequireUppercase = >
2020-03-19 19:06:05 +01:00
_configuration . GetValue ( Prefix + "RequireUppercase" , false ) ;
2020-03-18 11:29:29 +01:00
public string HashAlgorithmType = >
2020-05-27 13:48:26 +10:00
_configuration . GetValue ( Prefix + "HashAlgorithmType" , Constants . Security . AspNetUmbraco8PasswordHashAlgorithmName ) ; // TODO: Need to change to current format when we do members
2020-03-18 11:29:29 +01:00
public int MaxFailedAccessAttemptsBeforeLockout = >
2020-03-19 19:06:05 +01:00
_configuration . GetValue ( Prefix + "MaxFailedAccessAttemptsBeforeLockout" , 5 ) ;
2020-03-16 14:02:08 +01:00
}
}