2015-12-08 22:57:38 -05:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Threading.Tasks;
|
2016-05-19 19:10:24 -04:00
|
|
|
|
using Microsoft.AspNetCore.Identity;
|
2017-03-08 21:45:08 -05:00
|
|
|
|
using Bit.Core.Models.Table;
|
2017-01-14 10:02:37 -05:00
|
|
|
|
using System.Security.Claims;
|
2017-06-07 14:14:34 -04:00
|
|
|
|
using Bit.Core.Enums;
|
|
|
|
|
|
using Bit.Core.Models;
|
2015-12-08 22:57:38 -05:00
|
|
|
|
|
|
|
|
|
|
namespace Bit.Core.Services
|
|
|
|
|
|
{
|
|
|
|
|
|
public interface IUserService
|
|
|
|
|
|
{
|
2017-01-14 10:02:37 -05:00
|
|
|
|
Guid? GetProperUserId(ClaimsPrincipal principal);
|
2017-01-11 21:46:36 -05:00
|
|
|
|
Task<User> GetUserByIdAsync(string userId);
|
2016-05-21 17:16:22 -04:00
|
|
|
|
Task<User> GetUserByIdAsync(Guid userId);
|
2017-01-24 22:46:54 -05:00
|
|
|
|
Task<User> GetUserByPrincipalAsync(ClaimsPrincipal principal);
|
2017-01-14 10:02:37 -05:00
|
|
|
|
Task<DateTime> GetAccountRevisionDateByIdAsync(Guid userId);
|
2015-12-08 22:57:38 -05:00
|
|
|
|
Task SaveUserAsync(User user);
|
2016-02-20 23:25:44 -05:00
|
|
|
|
Task<IdentityResult> RegisterUserAsync(User user, string masterPassword);
|
2015-12-08 22:57:38 -05:00
|
|
|
|
Task SendMasterPasswordHintAsync(string email);
|
|
|
|
|
|
Task InitiateEmailChangeAsync(User user, string newEmail);
|
2017-05-31 09:54:32 -04:00
|
|
|
|
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);
|
2015-12-08 22:57:38 -05:00
|
|
|
|
Task<IdentityResult> RefreshSecurityStampAsync(User user, string masterPasswordHash);
|
2017-06-07 14:14:34 -04:00
|
|
|
|
Task SetupTwoFactorAsync(User user, TwoFactorProviderType provider);
|
|
|
|
|
|
Task UpdateTwoFactorProviderAsync(User user, TwoFactorProviderType type);
|
2016-11-14 23:32:15 -05:00
|
|
|
|
Task<bool> RecoverTwoFactorAsync(string email, string masterPassword, string recoveryCode);
|
2017-05-31 09:54:32 -04:00
|
|
|
|
Task<string> GenerateUserTokenAsync(User user, string tokenProvider, string purpose);
|
2015-12-27 00:14:56 -05:00
|
|
|
|
Task<IdentityResult> DeleteAsync(User user);
|
2015-12-08 22:57:38 -05:00
|
|
|
|
}
|
|
|
|
|
|
}
|