1
0
mirror of https://github.com/bitwarden/server synced 2026-01-08 19:43:34 +00:00

[send.key] Update send.key when account encryption key is rotated (#1417)

* Rotate send.key with account encryption key

* Update tests

* Improve and refactor style, fix typo

* Use null instead of empty lists

* Revert "Use null instead of empty lists"

This reverts commit 775a52ca56.

* Fix style (use AddRange instead of reassignment)
This commit is contained in:
Thomas Rittson
2021-07-02 06:27:03 +10:00
committed by GitHub
parent 30ea8b728d
commit 86a12efa76
9 changed files with 162 additions and 27 deletions

View File

@@ -30,6 +30,8 @@ namespace Bit.Api.Test.Controllers
private readonly ISsoUserRepository _ssoUserRepository;
private readonly IUserRepository _userRepository;
private readonly IUserService _userService;
private readonly ISendRepository _sendRepository;
private readonly ISendService _sendService;
private readonly IProviderUserRepository _providerUserRepository;
public AccountsControllerTests()
@@ -43,6 +45,8 @@ namespace Bit.Api.Test.Controllers
_providerUserRepository = Substitute.For<IProviderUserRepository>();
_paymentService = Substitute.For<IPaymentService>();
_globalSettings = new GlobalSettings();
_sendRepository = Substitute.For<ISendRepository>();
_sendService = Substitute.For<ISendService>();
_sut = new AccountsController(
_globalSettings,
_cipherRepository,
@@ -53,7 +57,9 @@ namespace Bit.Api.Test.Controllers
_paymentService,
_ssoUserRepository,
_userRepository,
_userService
_userService,
_sendRepository,
_sendService
);
}

View File

@@ -45,6 +45,7 @@ namespace Bit.Core.Test.Services
private readonly CurrentContext _currentContext;
private readonly GlobalSettings _globalSettings;
private readonly IOrganizationService _organizationService;
private readonly ISendRepository _sendRepository;
public UserServiceTests()
{
@@ -74,6 +75,7 @@ namespace Bit.Core.Test.Services
_currentContext = new CurrentContext();
_globalSettings = new GlobalSettings();
_organizationService = Substitute.For<IOrganizationService>();
_sendRepository = Substitute.For<ISendRepository>();
_sut = new UserService(
_userRepository,
@@ -101,7 +103,8 @@ namespace Bit.Core.Test.Services
_fido2,
_currentContext,
_globalSettings,
_organizationService
_organizationService,
_sendRepository
);
}