mirror of
https://github.com/Sea-Haven-Industries/shoc-backend.git
synced 2026-09-30 06:03:12 +00:00
Tokens now carry a keyed hash of the account's security stamp, and every authenticated request compares it with the stored stamp (cached for 60 s, evicted in-process on change). A password reset or change, a deactivation and a deletion all rotate or remove the stamp, so tokens issued before them get 401. Tokens without the claim get 401 too.
28 lines
1.7 KiB
C#
28 lines
1.7 KiB
C#
using Data.SeaHavenIndustries;
|
|
using SeaHaven.DataServices.Dto;
|
|
|
|
namespace SeaHaven.DataServices.Interfaces
|
|
{
|
|
public interface IUserDataService
|
|
{
|
|
Task<ApplicationUser?> GetByIdAsync(string id);
|
|
Task<IEnumerable<ApplicationUser>> GetAllAsync();
|
|
Task<ApplicationUser?> GetByEmailAsync(string email);
|
|
Task<bool> ExistsAsync(string id);
|
|
|
|
Task<IReadOnlyList<UserListRowData>> GetAllForListAsync(CancellationToken cancellationToken);
|
|
Task<UserProfileData?> GetProfileAsync(string id, CancellationToken cancellationToken);
|
|
Task<bool> UpdateProfileAsync(string id, string? name, string? email, string? contact, CancellationToken cancellationToken);
|
|
Task<ApplicationUser?> GetForEditAsync(string id, CancellationToken cancellationToken);
|
|
Task<bool> IsAccountOwnerAsync(string userId, CancellationToken cancellationToken);
|
|
Task<ApplicationUser?> GetByEmailNormalizedAsync(string email, CancellationToken cancellationToken);
|
|
Task UpdateUserAsync(ApplicationUser user, CancellationToken cancellationToken);
|
|
Task DeleteUserWithCascadeAsync(ApplicationUser user, CancellationToken cancellationToken);
|
|
Task ExecuteTransactionalAsync(Func<CancellationToken, Task> callback, CancellationToken cancellationToken);
|
|
Task<string?> GetEmailByIdAsync(string userId, CancellationToken cancellationToken);
|
|
|
|
/// <summary>The security stamp of an account that exists and is not deleted; otherwise null.</summary>
|
|
Task<string?> GetActiveSecurityStampAsync(string userId, CancellationToken cancellationToken);
|
|
Task<IReadOnlyDictionary<string, string>> GetDisplayNamesByIdsAsync(IEnumerable<string> ids);
|
|
}
|
|
}
|