2023-11-09 14:56:08 -05:00
|
|
|
|
using Bit.Core.Auth.UserFeatures.UserKey;
|
|
|
|
|
|
using Bit.Core.Entities;
|
2018-08-14 15:30:04 -04:00
|
|
|
|
using Bit.Core.Models.Data;
|
2015-12-08 22:57:38 -05:00
|
|
|
|
|
|
|
|
|
|
namespace Bit.Core.Repositories;
|
2022-08-29 16:06:55 -04:00
|
|
|
|
|
2016-05-21 17:16:22 -04:00
|
|
|
|
public interface IUserRepository : IRepository<User, Guid>
|
2015-12-08 22:57:38 -05:00
|
|
|
|
{
|
|
|
|
|
|
Task<User> GetByEmailAsync(string email);
|
2023-12-18 11:16:17 -05:00
|
|
|
|
Task<IEnumerable<User>> GetManyByEmailsAsync(IEnumerable<string> emails);
|
2020-07-28 10:03:09 -04:00
|
|
|
|
Task<User> GetBySsoUserAsync(string externalId, Guid? organizationId);
|
2018-08-14 15:30:04 -04:00
|
|
|
|
Task<UserKdfInformation> GetKdfInformationByEmailAsync(string email);
|
2018-03-21 17:41:14 -04:00
|
|
|
|
Task<ICollection<User>> SearchAsync(string email, int skip, int take);
|
2017-08-22 15:27:29 -04:00
|
|
|
|
Task<ICollection<User>> GetManyByPremiumAsync(bool premium);
|
2017-03-04 21:28:41 -05:00
|
|
|
|
Task<string> GetPublicKeyAsync(Guid id);
|
2017-01-14 10:02:37 -05:00
|
|
|
|
Task<DateTime> GetAccountRevisionDateAsync(Guid id);
|
2017-07-10 22:08:52 -04:00
|
|
|
|
Task UpdateStorageAsync(Guid id);
|
2018-07-12 23:23:41 -04:00
|
|
|
|
Task UpdateRenewalReminderDateAsync(Guid id, DateTime renewalReminderDate);
|
2021-05-25 19:23:47 +02:00
|
|
|
|
Task<IEnumerable<User>> GetManyAsync(IEnumerable<Guid> ids);
|
2023-11-09 14:56:08 -05:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Sets a new user key and updates all encrypted data.
|
|
|
|
|
|
/// <para>Warning: Any user key encrypted data not included will be lost.</para>
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="user">The user to update</param>
|
|
|
|
|
|
/// <param name="updateDataActions">Registered database calls to update re-encrypted data.</param>
|
|
|
|
|
|
[Obsolete("Intended for future improvements to key rotation. Do not use.")]
|
|
|
|
|
|
Task UpdateUserKeyAndEncryptedDataAsync(User user,
|
|
|
|
|
|
IEnumerable<UpdateEncryptedDataForKeyRotation> updateDataActions);
|
2015-12-08 22:57:38 -05:00
|
|
|
|
}
|