1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-02 00:22:50 -05:00
Files
bitwarden/src/Core/Repositories/IUserRepository.cs
Jake Fink b716a925f8 [PM-3797 Part 1] Layout new key rotation methods (#3425)
* layout new key rotation methods
- add endpoint with request model
- add command with data model
- add repository method

* layout new key rotation methods
- add endpoint with request model
- add command with data model
- add repository method

* formatting

* rename account recovery to reset password

* fix tests

* remove extra endpoint

* rename account recovery to reset password

* fix tests and formatting

* register db calls in command, removing list from user repo

* formatting
2023-11-09 14:56:08 -05:00

29 lines
1.3 KiB
C#

using Bit.Core.Auth.UserFeatures.UserKey;
using Bit.Core.Entities;
using Bit.Core.Models.Data;
namespace Bit.Core.Repositories;
public interface IUserRepository : IRepository<User, Guid>
{
Task<User> GetByEmailAsync(string email);
Task<User> GetBySsoUserAsync(string externalId, Guid? organizationId);
Task<UserKdfInformation> GetKdfInformationByEmailAsync(string email);
Task<ICollection<User>> SearchAsync(string email, int skip, int take);
Task<ICollection<User>> GetManyByPremiumAsync(bool premium);
Task<string> GetPublicKeyAsync(Guid id);
Task<DateTime> GetAccountRevisionDateAsync(Guid id);
Task UpdateStorageAsync(Guid id);
Task UpdateRenewalReminderDateAsync(Guid id, DateTime renewalReminderDate);
Task<IEnumerable<User>> GetManyAsync(IEnumerable<Guid> ids);
/// <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);
}