2022-06-30 01:46:41 +02:00
|
|
|
|
using Bit.Core.Entities;
|
2020-12-16 20:36:47 +01:00
|
|
|
|
using Bit.Core.Enums;
|
|
|
|
|
using Bit.Core.Models.Data;
|
|
|
|
|
|
|
|
|
|
namespace Bit.Core.Services;
|
2022-08-29 22:06:55 +02:00
|
|
|
|
|
2020-12-16 20:36:47 +01:00
|
|
|
|
public interface IEmergencyAccessService
|
|
|
|
|
{
|
2021-01-20 19:50:07 +01:00
|
|
|
|
Task<EmergencyAccess> InviteAsync(User invitingUser, string email, EmergencyAccessType type, int waitTime);
|
|
|
|
|
Task ResendInviteAsync(User invitingUser, Guid emergencyAccessId);
|
2020-12-16 20:36:47 +01:00
|
|
|
|
Task<EmergencyAccess> AcceptUserAsync(Guid emergencyAccessId, User user, string token, IUserService userService);
|
|
|
|
|
Task DeleteAsync(Guid emergencyAccessId, Guid grantorId);
|
|
|
|
|
Task<EmergencyAccess> ConfirmUserAsync(Guid emergencyAccessId, string key, Guid grantorId);
|
|
|
|
|
Task<EmergencyAccessDetails> GetAsync(Guid emergencyAccessId, Guid userId);
|
2022-01-18 16:05:12 +01:00
|
|
|
|
Task SaveAsync(EmergencyAccess emergencyAccess, User savingUser);
|
2020-12-16 20:36:47 +01:00
|
|
|
|
Task InitiateAsync(Guid id, User initiatingUser);
|
|
|
|
|
Task ApproveAsync(Guid id, User approvingUser);
|
|
|
|
|
Task RejectAsync(Guid id, User rejectingUser);
|
2021-02-10 00:06:42 +01:00
|
|
|
|
Task<ICollection<Policy>> GetPoliciesAsync(Guid id, User requestingUser);
|
|
|
|
|
Task<(EmergencyAccess, User)> TakeoverAsync(Guid id, User initiatingUser);
|
2020-12-16 20:36:47 +01:00
|
|
|
|
Task PasswordAsync(Guid id, User user, string newMasterPasswordHash, string key);
|
|
|
|
|
Task SendNotificationsAsync();
|
|
|
|
|
Task HandleTimedOutRequestsAsync();
|
2021-12-14 16:05:07 +01:00
|
|
|
|
Task<EmergencyAccessViewData> ViewAsync(Guid id, User user);
|
2022-04-05 10:08:37 +02:00
|
|
|
|
Task<AttachmentResponseData> GetAttachmentDownloadAsync(Guid id, Guid cipherId, string attachmentId, User user);
|
2020-12-16 20:36:47 +01:00
|
|
|
|
}
|