diff --git a/src/Core/KeyManagement/UserKey/Implementations/RotateUserAccountkeysCommand.cs b/src/Core/KeyManagement/UserKey/Implementations/RotateUserAccountkeysCommand.cs index 2b29a38714..7c7209c6ab 100644 --- a/src/Core/KeyManagement/UserKey/Implementations/RotateUserAccountkeysCommand.cs +++ b/src/Core/KeyManagement/UserKey/Implementations/RotateUserAccountkeysCommand.cs @@ -12,39 +12,62 @@ using Microsoft.AspNetCore.Identity; namespace Bit.Core.KeyManagement.UserKey.Implementations; -/// -/// -/// Instantiates a new -/// -/// Master password hash validation -/// Updates user keys and re-encrypted data if needed -/// Provides a method to update re-encrypted cipher data -/// Provides a method to update re-encrypted folder data -/// Provides a method to update re-encrypted send data -/// Provides a method to update re-encrypted emergency access data -/// Provides a method to update re-encrypted organization user data -/// Provides a method to update re-encrypted device data -/// Hashes the new master password -/// Logs out user from other devices after successful rotation -/// Provides a password mismatch error if master password hash validation fails -/// Provides a method to update re-encrypted WebAuthn keys -/// Provides a method to update re-encrypted signature keys -public class RotateUserAccountKeysCommand( - IUserService _userService, - IUserRepository _userRepository, - ICipherRepository _cipherRepository, - IFolderRepository _folderRepository, - ISendRepository _sendRepository, - IEmergencyAccessRepository _emergencyAccessRepository, - IOrganizationUserRepository _organizationUserRepository, - IDeviceRepository _deviceRepository, - IPasswordHasher _passwordHasher, - IPushNotificationService _pushService, - IdentityErrorDescriber _identityErrorDescriber, - IWebAuthnCredentialRepository _credentialRepository, - IUserSignatureKeyPairRepository _userSignatureKeyPairRepository -) : IRotateUserAccountKeysCommand +public class RotateUserAccountKeysCommand : IRotateUserAccountKeysCommand { + private readonly IUserService _userService; + private readonly IUserRepository _userRepository; + private readonly ICipherRepository _cipherRepository; + private readonly IFolderRepository _folderRepository; + private readonly ISendRepository _sendRepository; + private readonly IEmergencyAccessRepository _emergencyAccessRepository; + private readonly IOrganizationUserRepository _organizationUserRepository; + private readonly IDeviceRepository _deviceRepository; + private readonly IPushNotificationService _pushService; + private readonly IdentityErrorDescriber _identityErrorDescriber; + private readonly IWebAuthnCredentialRepository _credentialRepository; + private readonly IPasswordHasher _passwordHasher; + private readonly IUserSignatureKeyPairRepository _userSignatureKeyPairRepository; + + /// + /// Instantiates a new + /// + /// Master password hash validation + /// Updates user keys and re-encrypted data if needed + /// Provides a method to update re-encrypted cipher data + /// Provides a method to update re-encrypted folder data + /// Provides a method to update re-encrypted send data + /// Provides a method to update re-encrypted emergency access data + /// Provides a method to update re-encrypted organization user data + /// Provides a method to update re-encrypted device keys + /// Hashes the new master password + /// Logs out user from other devices after successful rotation + /// Provides a password mismatch error if master password hash validation fails + /// Provides a method to update re-encrypted WebAuthn keys + /// Provides a method to update re-encrypted signature keys + public RotateUserAccountKeysCommand(IUserService userService, IUserRepository userRepository, + ICipherRepository cipherRepository, IFolderRepository folderRepository, ISendRepository sendRepository, + IEmergencyAccessRepository emergencyAccessRepository, IOrganizationUserRepository organizationUserRepository, + IDeviceRepository deviceRepository, + IPasswordHasher passwordHasher, + IPushNotificationService pushService, IdentityErrorDescriber errors, IWebAuthnCredentialRepository credentialRepository, + IUserSignatureKeyPairRepository userSignatureKeyPairRepository) + { + _userService = userService; + _userRepository = userRepository; + _cipherRepository = cipherRepository; + _folderRepository = folderRepository; + _sendRepository = sendRepository; + _emergencyAccessRepository = emergencyAccessRepository; + _organizationUserRepository = organizationUserRepository; + _deviceRepository = deviceRepository; + _pushService = pushService; + _identityErrorDescriber = errors; + _credentialRepository = credentialRepository; + _passwordHasher = passwordHasher; + _userSignatureKeyPairRepository = userSignatureKeyPairRepository; + } + + /// public async Task RotateUserAccountKeysAsync(User user, RotateUserAccountKeysData model) {