[ADD] Added base options

This commit is contained in:
max
2024-12-23 00:59:13 +01:00
parent 44e64793b7
commit 797323789e
12 changed files with 69 additions and 16 deletions

View File

@@ -0,0 +1,10 @@
namespace DotBased.AspNet.Authority.Models.Options;
public class AuthorityOptions
{
public LockdownOptions Lockdown { get; set; } = new();
public LockoutOptions Lockout { get; set; } = new();
public PasswordOptions Password { get; set; } = new();
public ProviderOptions Provider { get; set; } = new();
public UserOptions User { get; set; } = new();
}

View File

@@ -0,0 +1,6 @@
namespace DotBased.AspNet.Authority.Models.Options;
public class LockdownOptions
{
public bool EnableLockout { get; set; }
}

View File

@@ -0,0 +1,8 @@
namespace DotBased.AspNet.Authority.Models.Options;
public class LockoutOptions
{
public bool EnableLockout { get; set; } = true;
public int FailedAttempts { get; set; } = 3;
public TimeSpan LockoutTimeout { get; set; } = TimeSpan.FromMinutes(30);
}

View File

@@ -0,0 +1,14 @@
namespace DotBased.AspNet.Authority.Models.Options;
public class PasswordOptions
{
public int RequiredLength { get; set; } = 10;
public int MinimalUniqueChars { get; set; } = 1;
public bool RequireLowercase { get; set; }
public bool RequireUppercase { get; set; }
public bool RequireDigit { get; set; }
public bool RequireNonAlphanumeric { get; set; }
public List<string> PasswordBlackList { get; set; } = ["password", "1234"];
public StringComparer PasswordBlackListComparer { get; set; } = StringComparer.OrdinalIgnoreCase;
}

View File

@@ -0,0 +1,6 @@
namespace DotBased.AspNet.Authority.Models.Options;
public class ProviderOptions
{
}

View File

@@ -0,0 +1,8 @@
namespace DotBased.AspNet.Authority.Models.Options;
public class SignInOptions
{
public bool RequireValidatedEmail { get; set; }
public bool RequireValidatedPhoneNumber { get; set; }
public bool RequireConfirmedAccount { get; set; }
}

View File

@@ -0,0 +1,11 @@
namespace DotBased.AspNet.Authority.Models.Options;
public class UserOptions
{
public bool EnableRegister { get; set; }
public bool RequireUniqueEmail { get; set; }
public string AllowedCharacters { get; set; } = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._@";
public List<string> UserNameBlackList { get; set; } = ["admin", "administrator", "dev", "developer"];
public StringComparer UserNameBlackListComparer { get; set; } = StringComparer.OrdinalIgnoreCase;
}