-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1688 from qdraw/feature/202409_iterationcount
Feature/202409 iterationcount
- Loading branch information
Showing
22 changed files
with
4,685 additions
and
12,991 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,101 +3,101 @@ | |
using starsky.foundation.accountmanagement.Models; | ||
using starsky.foundation.database.Models.Account; | ||
|
||
namespace starsky.foundation.accountmanagement.Interfaces | ||
{ | ||
public enum SignUpResultError | ||
{ | ||
CredentialTypeNotFound, | ||
NullString | ||
} | ||
|
||
public class SignUpResult | ||
{ | ||
public User? User { get; } | ||
public bool Success { get; private set; } | ||
public SignUpResultError? Error { get; } | ||
|
||
public SignUpResult(User? user = null, bool success = false, | ||
SignUpResultError? error = null) | ||
{ | ||
User = user; | ||
Success = success; | ||
Error = error; | ||
} | ||
} | ||
namespace starsky.foundation.accountmanagement.Interfaces; | ||
|
||
public enum ValidateResultError | ||
{ | ||
CredentialTypeNotFound, | ||
CredentialNotFound, | ||
SecretNotValid, | ||
Lockout, | ||
UserNotFound | ||
} | ||
public enum SignUpResultError | ||
{ | ||
CredentialTypeNotFound, | ||
NullString | ||
} | ||
|
||
public enum ChangeSecretResultError | ||
public class SignUpResult | ||
{ | ||
public SignUpResult(User? user = null, bool success = false, | ||
SignUpResultError? error = null) | ||
{ | ||
CredentialTypeNotFound, | ||
CredentialNotFound | ||
User = user; | ||
Success = success; | ||
Error = error; | ||
} | ||
|
||
public class ChangeSecretResult | ||
{ | ||
public bool Success { get; set; } | ||
public User? User { get; } | ||
public bool Success { get; private set; } | ||
public SignUpResultError? Error { get; } | ||
} | ||
|
||
public ChangeSecretResultError? Error { get; set; } | ||
public enum ValidateResultError | ||
{ | ||
CredentialTypeNotFound, | ||
CredentialNotFound, | ||
SecretNotValid, | ||
Lockout, | ||
UserNotFound | ||
} | ||
|
||
public ChangeSecretResult(bool success = false, ChangeSecretResultError? error = null) | ||
{ | ||
Success = success; | ||
Error = error; | ||
} | ||
} | ||
public enum ChangeSecretResultError | ||
{ | ||
CredentialTypeNotFound, | ||
CredentialNotFound | ||
} | ||
|
||
public interface IUserManager | ||
public class ChangeSecretResult | ||
{ | ||
public ChangeSecretResult(bool success = false, ChangeSecretResultError? error = null) | ||
{ | ||
Task<UserOverviewModel> AllUsersAsync(); | ||
|
||
/// <summary> | ||
/// Add a new user, including Roles and UserRoles | ||
/// </summary> | ||
/// <param name="name">Nice Name, default string.Empty</param> | ||
/// <param name="credentialTypeCode">default is: Email</param> | ||
/// <param name="identifier">an email address, e.g. [email protected]</param> | ||
/// <param name="secret">Password</param> | ||
/// <returns>result object</returns> | ||
Task<SignUpResult> SignUpAsync(string name, string credentialTypeCode, | ||
string? identifier, string? secret); | ||
|
||
void AddToRole(User user, string roleCode); | ||
void AddToRole(User user, Role role); | ||
void RemoveFromRole(User user, string roleCode); | ||
void RemoveFromRole(User user, Role role); | ||
|
||
ChangeSecretResult ChangeSecret(string credentialTypeCode, string? identifier, | ||
string secret); | ||
|
||
Task<ValidateResult> ValidateAsync(string credentialTypeCode, | ||
string? identifier, string secret); | ||
|
||
Task<bool> SignIn(HttpContext httpContext, User? user, | ||
bool isPersistent = false); | ||
|
||
void SignOut(HttpContext httpContext); | ||
int GetCurrentUserId(HttpContext httpContext); | ||
User? GetCurrentUser(HttpContext httpContext); | ||
User? GetUser(string credentialTypeCode, string identifier); | ||
Credential? GetCredentialsByUserId(int userId); | ||
|
||
Task<ValidateResult> RemoveUser(string credentialTypeCode, | ||
string identifier); | ||
Success = success; | ||
Error = error; | ||
} | ||
|
||
User? Exist(string identifier); | ||
public bool Success { get; set; } | ||
|
||
Task<User?> ExistAsync(int userTableId); | ||
Role? GetRole(string credentialTypeCode, string identifier); | ||
public ChangeSecretResultError? Error { get; set; } | ||
} | ||
|
||
Task<Role?> GetRoleAsync(int userId); | ||
bool PreflightValidate(string userName, string password, string confirmPassword); | ||
} | ||
public interface IUserManager | ||
{ | ||
Task<UserOverviewModel> AllUsersAsync(); | ||
|
||
/// <summary> | ||
/// Add a new user, including Roles and UserRoles | ||
/// </summary> | ||
/// <param name="name">Nice Name, default string.Empty</param> | ||
/// <param name="credentialTypeCode">default is: Email</param> | ||
/// <param name="identifier">an email address, e.g. [email protected]</param> | ||
/// <param name="secret">Password</param> | ||
/// <returns>result object</returns> | ||
Task<SignUpResult> SignUpAsync(string name, string credentialTypeCode, | ||
string? identifier, string? secret); | ||
|
||
void AddToRole(User user, string roleCode); | ||
void AddToRole(User user, Role role); | ||
void RemoveFromRole(User user, string roleCode); | ||
void RemoveFromRole(User user, Role role); | ||
|
||
ChangeSecretResult ChangeSecret(string credentialTypeCode, string? identifier, | ||
string secret); | ||
|
||
Task<ValidateResult> ValidateAsync(string credentialTypeCode, | ||
string? identifier, string secret); | ||
|
||
Task<bool> SignIn(HttpContext httpContext, User? user, | ||
bool isPersistent = false); | ||
|
||
void SignOut(HttpContext httpContext); | ||
int GetCurrentUserId(HttpContext httpContext); | ||
User? GetCurrentUser(HttpContext httpContext); | ||
User? GetUser(string credentialTypeCode, string identifier); | ||
Credential? GetCredentialsByUserId(int userId); | ||
|
||
Task<ValidateResult> RemoveUser(string credentialTypeCode, | ||
string identifier); | ||
|
||
User? Exist(string identifier); | ||
|
||
Task<User?> ExistAsync(int userTableId); | ||
Role? GetRole(string credentialTypeCode, string identifier); | ||
|
||
Task<Role?> GetRoleAsync(int userId); | ||
bool PreflightValidate(string userName, string password, string confirmPassword); | ||
CredentialType? GetCachedCredentialType(string credentialTypeCode); | ||
} |
Oops, something went wrong.