Amended most configuration settings classes to public POCOs without interfaces, and loaded into services collection via loading the configuration section.
This commit is contained in:
@@ -1,36 +1,22 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Configuration;
|
||||
|
||||
namespace Umbraco.Configuration.Models
|
||||
{
|
||||
internal class UserPasswordConfigurationSettings : IUserPasswordConfiguration
|
||||
public class UserPasswordConfigurationSettings
|
||||
{
|
||||
private const string Prefix = Constants.Configuration.ConfigSecurityPrefix + "UserPassword:";
|
||||
private readonly IConfiguration _configuration;
|
||||
public int RequiredLength { get; set; } = 10;
|
||||
|
||||
public UserPasswordConfigurationSettings(IConfiguration configuration)
|
||||
{
|
||||
_configuration = configuration;
|
||||
}
|
||||
public bool RequireNonLetterOrDigit { get; set; } = false;
|
||||
|
||||
public int RequiredLength => _configuration.GetValue(Prefix + "RequiredLength", 10);
|
||||
public bool RequireDigit { get; set; } = false;
|
||||
|
||||
public bool RequireNonLetterOrDigit =>
|
||||
_configuration.GetValue(Prefix + "RequireNonLetterOrDigit", false);
|
||||
public bool RequireLowercase { get; set; } = false;
|
||||
|
||||
public bool RequireDigit => _configuration.GetValue(Prefix + "RequireDigit", false);
|
||||
public bool RequireUppercase { get; set; } = false;
|
||||
|
||||
public bool RequireLowercase =>
|
||||
_configuration.GetValue(Prefix + "RequireLowercase", false);
|
||||
public string HashAlgorithmType { get; set; } = Constants.Security.AspNetCoreV3PasswordHashAlgorithmName;
|
||||
|
||||
public bool RequireUppercase =>
|
||||
_configuration.GetValue(Prefix + "RequireUppercase", false);
|
||||
|
||||
public string HashAlgorithmType =>
|
||||
_configuration.GetValue(Prefix + "HashAlgorithmType", Constants.Security.AspNetCoreV3PasswordHashAlgorithmName);
|
||||
|
||||
public int MaxFailedAccessAttemptsBeforeLockout =>
|
||||
_configuration.GetValue(Prefix + "MaxFailedAccessAttemptsBeforeLockout", 5);
|
||||
public int MaxFailedAccessAttemptsBeforeLockout { get; set; } = 5;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user