Files
server/src/Core/Services/IUserService.cs

36 lines
1.8 KiB
C#
Raw Normal View History

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;
using System.Security.Claims;
using Bit.Core.Enums;
using Bit.Core.Models;
2015-12-08 22:57:38 -05:00
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);
2015-12-08 22:57:38 -05:00
Task SaveUserAsync(User user);
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);
Task SetupTwoFactorAsync(User user, TwoFactorProviderType provider);
Task UpdateTwoFactorProviderAsync(User user, TwoFactorProviderType type);
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
}
}