diff --git a/DotBased.AspNet.Authority/AuthorityProviderExtensions.cs b/DotBased.AspNet.Authority/AuthorityProviderExtensions.cs index 71f7730..c67c51a 100644 --- a/DotBased.AspNet.Authority/AuthorityProviderExtensions.cs +++ b/DotBased.AspNet.Authority/AuthorityProviderExtensions.cs @@ -1,12 +1,16 @@ using DotBased.AspNet.Authority.Interfaces; +using DotBased.AspNet.Authority.Models.Options; using Microsoft.Extensions.DependencyInjection; namespace DotBased.AspNet.Authority; public static class AuthorityProviderExtensions { - public static AuthorityBuilder AddAuthorityProvider(this IServiceCollection services) where TModel : class + public static AuthorityBuilder AddAuthorityProvider(this IServiceCollection services, Action optionsAction) where TModel : class { + services.AddOptions(); + // Configure required classes, services, etc. + services.Configure(optionsAction); return new AuthorityBuilder(services); } diff --git a/DotBased.AspNet.Authority/DotBased.AspNet.Authority.csproj b/DotBased.AspNet.Authority/DotBased.AspNet.Authority.csproj index b99e760..f056f35 100644 --- a/DotBased.AspNet.Authority/DotBased.AspNet.Authority.csproj +++ b/DotBased.AspNet.Authority/DotBased.AspNet.Authority.csproj @@ -21,4 +21,8 @@ + + + + diff --git a/DotBased.AspNet.Authority/Models/Authority/AuthorityAttribute.cs b/DotBased.AspNet.Authority/Models/Authority/AuthorityAttribute.cs index 1057db7..5bc4d6e 100644 --- a/DotBased.AspNet.Authority/Models/Authority/AuthorityAttribute.cs +++ b/DotBased.AspNet.Authority/Models/Authority/AuthorityAttribute.cs @@ -2,7 +2,7 @@ namespace DotBased.AspNet.Authority.Models.Authority; public class AuthorityAttribute { - public AuthorityAttribute(string attributeKey, string bound) : this() + public AuthorityAttribute(string attributeKey, string bound) { AttributeKey = attributeKey; BoundId = bound; @@ -10,7 +10,8 @@ public class AuthorityAttribute public AuthorityAttribute() { - + AttributeKey = string.Empty; + BoundId = string.Empty; } public string AttributeKey { get; set; } // ClaimType/Authority.attribute.enabled diff --git a/DotBased.AspNet.Authority/Models/Options/SignInOptions.cs b/DotBased.AspNet.Authority/Models/Options/SignInOptions.cs index f25e2be..8c142db 100644 --- a/DotBased.AspNet.Authority/Models/Options/SignInOptions.cs +++ b/DotBased.AspNet.Authority/Models/Options/SignInOptions.cs @@ -2,7 +2,7 @@ namespace DotBased.AspNet.Authority.Models.Options; public class SignInOptions { - public bool RequireValidatedEmail { get; set; } - public bool RequireValidatedPhoneNumber { get; set; } + public bool RequireVerifiedEmail { get; set; } + public bool RequireVerifiedPhoneNumber { get; set; } public bool RequireConfirmedAccount { get; set; } } \ No newline at end of file diff --git a/DotBased.AspNet.Authority/Services/AuthorityService.cs b/DotBased.AspNet.Authority/Services/AuthorityManager.cs similarity index 77% rename from DotBased.AspNet.Authority/Services/AuthorityService.cs rename to DotBased.AspNet.Authority/Services/AuthorityManager.cs index 2c61b55..3cb5eb7 100644 --- a/DotBased.AspNet.Authority/Services/AuthorityService.cs +++ b/DotBased.AspNet.Authority/Services/AuthorityManager.cs @@ -1,6 +1,6 @@ namespace DotBased.AspNet.Authority.Services; -public class AuthorityService +public class AuthorityManager { public long GenerateVersion() => DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(); } \ No newline at end of file diff --git a/DotBased.AspNet.Authority/Validators/IPasswordValidator.cs b/DotBased.AspNet.Authority/Validators/IPasswordValidator.cs new file mode 100644 index 0000000..2fe5b5c --- /dev/null +++ b/DotBased.AspNet.Authority/Validators/IPasswordValidator.cs @@ -0,0 +1,6 @@ +namespace DotBased.AspNet.Authority.Validators; + +public interface IPasswordValidator +{ + +} \ No newline at end of file diff --git a/DotBased.AspNet.Authority/Validators/IUserValidator.cs b/DotBased.AspNet.Authority/Validators/IUserValidator.cs new file mode 100644 index 0000000..cb7e245 --- /dev/null +++ b/DotBased.AspNet.Authority/Validators/IUserValidator.cs @@ -0,0 +1,6 @@ +namespace DotBased.AspNet.Authority.Validators; + +public interface IUserValidator +{ + +} \ No newline at end of file diff --git a/DotBased.AspNet.Authority/Validators/PasswordValidator.cs b/DotBased.AspNet.Authority/Validators/PasswordValidator.cs new file mode 100644 index 0000000..33ce063 --- /dev/null +++ b/DotBased.AspNet.Authority/Validators/PasswordValidator.cs @@ -0,0 +1,6 @@ +namespace DotBased.AspNet.Authority.Validators; + +public class PasswordValidator +{ + +} \ No newline at end of file diff --git a/DotBased.AspNet.Authority/Validators/UserValidator.cs b/DotBased.AspNet.Authority/Validators/UserValidator.cs new file mode 100644 index 0000000..1175fc8 --- /dev/null +++ b/DotBased.AspNet.Authority/Validators/UserValidator.cs @@ -0,0 +1,6 @@ +namespace DotBased.AspNet.Authority.Validators; + +public class UserValidator +{ + +} \ No newline at end of file diff --git a/DotBased.AspNet.Authority/Verifiers/IEmailVerifier.cs b/DotBased.AspNet.Authority/Verifiers/IEmailVerifier.cs new file mode 100644 index 0000000..63172f0 --- /dev/null +++ b/DotBased.AspNet.Authority/Verifiers/IEmailVerifier.cs @@ -0,0 +1,6 @@ +namespace DotBased.AspNet.Authority.Verifiers; + +public interface IEmailVerifier +{ + +} \ No newline at end of file diff --git a/DotBased.AspNet.Authority/Verifiers/IPhoneNumberVerifier.cs b/DotBased.AspNet.Authority/Verifiers/IPhoneNumberVerifier.cs new file mode 100644 index 0000000..92e25bd --- /dev/null +++ b/DotBased.AspNet.Authority/Verifiers/IPhoneNumberVerifier.cs @@ -0,0 +1,6 @@ +namespace DotBased.AspNet.Authority.Verifiers; + +public interface IPhoneNumberVerifier +{ + +} \ No newline at end of file diff --git a/DotBased.AspNet.Authority/Verifiers/IUserVerifier.cs b/DotBased.AspNet.Authority/Verifiers/IUserVerifier.cs new file mode 100644 index 0000000..c41347f --- /dev/null +++ b/DotBased.AspNet.Authority/Verifiers/IUserVerifier.cs @@ -0,0 +1,6 @@ +namespace DotBased.AspNet.Authority.Verifiers; + +public class IUserVerifier +{ + +} \ No newline at end of file