From 6f09e4c593b5b14ae4276fab872076ed059705d2 Mon Sep 17 00:00:00 2001 From: Shane Date: Tue, 2 Dec 2025 15:42:25 -0800 Subject: [PATCH] Build with the ability to create attachments without keys --- apps/cli/src/vault/models/attachment.response.ts | 2 ++ libs/common/src/vault/services/cipher.service.ts | 6 +++--- .../services/file-upload/cipher-file-upload.service.ts | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/apps/cli/src/vault/models/attachment.response.ts b/apps/cli/src/vault/models/attachment.response.ts index c4450fa8def..3a40e55804b 100644 --- a/apps/cli/src/vault/models/attachment.response.ts +++ b/apps/cli/src/vault/models/attachment.response.ts @@ -6,6 +6,7 @@ export class AttachmentResponse { size: string; sizeName: string; url: string; + key: any; constructor(o: AttachmentView) { this.id = o.id; @@ -13,5 +14,6 @@ export class AttachmentResponse { this.size = o.size; this.sizeName = o.sizeName; this.url = o.url; + this.key = o.key; } } diff --git a/libs/common/src/vault/services/cipher.service.ts b/libs/common/src/vault/services/cipher.service.ts index b2c5ac8943c..32ef8014f14 100644 --- a/libs/common/src/vault/services/cipher.service.ts +++ b/libs/common/src/vault/services/cipher.service.ts @@ -1096,15 +1096,15 @@ export class CipherService implements CipherServiceAbstraction { const encFileName = await this.encryptService.encryptString(filename, cipherEncKey); - const dataEncKey = await this.keyService.makeDataEncKey(cipherEncKey); - const encData = await this.encryptService.encryptFileData(new Uint8Array(data), dataEncKey[0]); + // const dataEncKey = await this.keyService.makeDataEncKey(cipherEncKey); + const encData = await this.encryptService.encryptFileData(new Uint8Array(data), cipherEncKey); const response = await this.cipherFileUploadService.upload( cipher, encFileName, encData, admin, - dataEncKey, + null, //dataEncKey, ); const cData = new CipherData(response, cipher.collectionIds); diff --git a/libs/common/src/vault/services/file-upload/cipher-file-upload.service.ts b/libs/common/src/vault/services/file-upload/cipher-file-upload.service.ts index 8d97a921748..a6d4c7a647b 100644 --- a/libs/common/src/vault/services/file-upload/cipher-file-upload.service.ts +++ b/libs/common/src/vault/services/file-upload/cipher-file-upload.service.ts @@ -29,7 +29,8 @@ export class CipherFileUploadService implements CipherFileUploadServiceAbstracti dataEncKey: [SymmetricCryptoKey, EncString], ): Promise { const request: AttachmentRequest = { - key: dataEncKey[1].encryptedString, + // key: dataEncKey[1].encryptedString, + key: undefined as any, fileName: encFileName.encryptedString, fileSize: encData.buffer.byteLength, adminRequest: admin,