1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 00:33:44 +00:00

Resolve breaking changes in the SDK (#15472)

This commit is contained in:
Oscar Hinton
2025-07-07 17:49:29 +02:00
committed by GitHub
parent a6ae7d23f7
commit 71bef25a96
9 changed files with 34 additions and 13 deletions

View File

@@ -67,6 +67,7 @@ describe("AttachmentView", () => {
sizeName: "sizeName",
fileName: "fileName",
key: "encKeyB64",
decryptedKey: null,
});
});
});

View File

@@ -59,6 +59,7 @@ export class AttachmentView implements View {
sizeName: this.sizeName,
fileName: this.fileName,
key: this.encryptedKey?.toJSON(),
decryptedKey: null,
};
}

View File

@@ -7,7 +7,7 @@ import {
CipherType as SdkCipherType,
CipherView as SdkCipherView,
CipherListView,
Attachment as SdkAttachment,
AttachmentView as SdkAttachmentView,
} from "@bitwarden/sdk-internal";
import { mockEnc } from "../../../spec";
@@ -311,7 +311,9 @@ describe("DefaultCipherEncryptionService", () => {
const expectedDecryptedContent = new Uint8Array([5, 6, 7, 8]);
jest.spyOn(cipher, "toSdkCipher").mockReturnValue({ id: "id" } as SdkCipher);
jest.spyOn(attachment, "toSdkAttachmentView").mockReturnValue({ id: "a1" } as SdkAttachment);
jest
.spyOn(attachment, "toSdkAttachmentView")
.mockReturnValue({ id: "a1" } as SdkAttachmentView);
mockSdkClient.vault().attachments().decrypt_buffer.mockReturnValue(expectedDecryptedContent);
const result = await cipherEncryptionService.decryptAttachmentContent(