1
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
namespace Yes.Infrastructure.Authorizations.Identity.Authroizations
|
||||
{
|
||||
public interface IJwtProvider : IScoped
|
||||
{
|
||||
Task<ClaimsPrincipal> ReadToken(string token);
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
13
Yes.Infrastructure/Authorizations/Identity/ICookieHelper.cs
Normal file
13
Yes.Infrastructure/Authorizations/Identity/ICookieHelper.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace Yes.Infrastructure.Authorizations.Identity
|
||||
{
|
||||
public enum IdentityRoleEnum
|
||||
{
|
||||
User = 1,
|
||||
Admin = 2,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user