mirror of
https://github.com/bitwarden/browser
synced 2025-12-21 02:33:46 +00:00
[PM-23085] Use SDK to get rotated cipher data (#15670)
* [PM-23085] Add encryptWithKey method to CipherEncryptionService * [PM-23085] Use new encryptWithKey() SDK method in getRotatedData() based on feature flag * [PM-23085] Rename cipher encryption method to encryptCipherForRotation to better reflect intended use case * [PM-23085] Update @bitwarden/sdk-internal package version * [PM-23085] Fix failing test after method rename * [PM-23085] Fix other failing test * [PM-23085] Typo
This commit is contained in:
@@ -1512,9 +1512,16 @@ export class CipherService implements CipherServiceAbstraction {
|
||||
if (userCiphers.length === 0) {
|
||||
return encryptedCiphers;
|
||||
}
|
||||
|
||||
const useSdkEncryption = await this.configService.getFeatureFlag(
|
||||
FeatureFlag.PM22136_SdkCipherEncryption,
|
||||
);
|
||||
|
||||
encryptedCiphers = await Promise.all(
|
||||
userCiphers.map(async (cipher) => {
|
||||
const encryptedCipher = await this.encrypt(cipher, userId, newUserKey, originalUserKey);
|
||||
const encryptedCipher = useSdkEncryption
|
||||
? await this.cipherEncryptionService.encryptCipherForRotation(cipher, userId, newUserKey)
|
||||
: await this.encrypt(cipher, userId, newUserKey, originalUserKey);
|
||||
return new CipherWithIdRequest(encryptedCipher);
|
||||
}),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user