mirror of
https://github.com/bitwarden/browser
synced 2025-12-20 10:13:31 +00:00
[PM-24745] Decrypt ciphers using decryptManyWithFailures from SDK (#16190)
* Add SDK call to decryptManyWithFailures instead of decryptMany * Move logic back to decryptCiphersWithSdk * Fix return type of decryptCiphersWithSdk * Add unit tests for decryptCiphers() * Add unit tests for decryptManyWithFailures * Filter out undefined objects from failedCiphers * Update name for failed-decryption ciphers * Fix type checking errors in tests * Fix tests with new changes from main * Migrate decryptMany call to use decryptManyWithFailures * Remove deprecated decryptMany function, along with all calls ot the function
This commit is contained in:
@@ -69,14 +69,19 @@ export abstract class CipherEncryptionService {
|
||||
*/
|
||||
abstract decryptManyLegacy(ciphers: Cipher[], userId: UserId): Promise<CipherView[]>;
|
||||
/**
|
||||
* Decrypts many ciphers using the SDK for the given userId.
|
||||
* Decrypts many ciphers using the SDK for the given userId, and returns a list of
|
||||
* failures.
|
||||
*
|
||||
* @param ciphers The encrypted cipher objects
|
||||
* @param userId The user ID whose key will be used for decryption
|
||||
*
|
||||
* @returns A promise that resolves to an array of decrypted cipher list views
|
||||
* @returns A promise that resolves to a tuple containing an array of decrypted
|
||||
* cipher list views, and an array of ciphers that failed to decrypt.
|
||||
*/
|
||||
abstract decryptMany(ciphers: Cipher[], userId: UserId): Promise<CipherListView[]>;
|
||||
abstract decryptManyWithFailures(
|
||||
ciphers: Cipher[],
|
||||
userId: UserId,
|
||||
): Promise<[CipherListView[], Cipher[]]>;
|
||||
/**
|
||||
* Decrypts an attachment's content from a response object.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user