mirror of
https://github.com/bitwarden/server
synced 2025-12-14 07:13:39 +00:00
33 lines
1.6 KiB
C#
33 lines
1.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.AspNetCore.Identity;
|
|
using Bit.Core.Models.Table;
|
|
using System.Security.Claims;
|
|
|
|
namespace Bit.Core.Services
|
|
{
|
|
public interface IUserService
|
|
{
|
|
Guid? GetProperUserId(ClaimsPrincipal principal);
|
|
Task<User> GetUserByIdAsync(string userId);
|
|
Task<User> GetUserByIdAsync(Guid userId);
|
|
Task<User> GetUserByPrincipalAsync(ClaimsPrincipal principal);
|
|
Task<DateTime> GetAccountRevisionDateByIdAsync(Guid userId);
|
|
Task SaveUserAsync(User user);
|
|
Task<IdentityResult> RegisterUserAsync(User user, string masterPassword);
|
|
Task SendMasterPasswordHintAsync(string email);
|
|
Task InitiateEmailChangeAsync(User user, string newEmail);
|
|
Task<IdentityResult> ChangeEmailAsync(User user, string masterPassword, string newEmail, string newMasterPassword,
|
|
string token, string key);
|
|
Task<IdentityResult> ChangePasswordAsync(User user, string masterPassword, string newMasterPassword, string key);
|
|
Task<IdentityResult> UpdateKeyAsync(User user, string masterPassword, string key, string privateKey,
|
|
IEnumerable<Cipher> ciphers, IEnumerable<Folder> folders);
|
|
Task<IdentityResult> RefreshSecurityStampAsync(User user, string masterPasswordHash);
|
|
Task GetTwoFactorAsync(User user, Enums.TwoFactorProviderType provider);
|
|
Task<bool> RecoverTwoFactorAsync(string email, string masterPassword, string recoveryCode);
|
|
Task<string> GenerateUserTokenAsync(User user, string tokenProvider, string purpose);
|
|
Task<IdentityResult> DeleteAsync(User user);
|
|
}
|
|
}
|