This commit is contained in:
2025-04-30 09:51:36 +08:00
parent 561881c9aa
commit 09afa239a6
848 changed files with 385870 additions and 205 deletions

View File

@@ -0,0 +1,7 @@
namespace Yes.Infrastructure.Authorizations.Identity.Authroizations
{
public interface IJwtProvider : IScoped
{
Task<ClaimsPrincipal> ReadToken(string token);
}
}

View File

@@ -0,0 +1,18 @@
namespace Yes.Infrastructure.Authorizations.Identity.Context
{
public interface IIdentityContext : IScoped
{
int Id { get; }
string Name { get; }
IdentityRoleEnum Role { get; }
bool IsAuthenticated();
IEnumerable<Claim> GetClaimsIdentity();
}
}

View File

@@ -0,0 +1,13 @@
namespace Yes.Infrastructure.Authorizations.Identity.Context
{
public class IdentityInfo
{
public int Id { get; set; }
public string Name { get; set; } = string.Empty;
public IdentityRoleEnum Role { get; set; }
}
}

View File

@@ -0,0 +1,13 @@
namespace Yes.Infrastructure.Authorizations.Identity
{
public interface ICookieHelper : IScoped
{
void SetCookie(string key, string value);
void SetCookie(string key, string value, int expiresTime);
string GetCookie(string key);
void DeleteCookie(string key);
}
}

View File

@@ -0,0 +1,8 @@
namespace Yes.Infrastructure.Authorizations.Identity
{
public enum IdentityRoleEnum
{
User = 1,
Admin = 2,
}
}