1
0
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:
Shane Melton
2025-07-28 10:36:34 -07:00
committed by GitHub
parent edeb0f4597
commit b48d7d4b97
7 changed files with 110 additions and 7 deletions

View File

@@ -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);
}),
);