1
0
mirror of https://github.com/bitwarden/browser synced 2026-01-31 08:43:54 +00:00

Build with the ability to create attachments without keys

This commit is contained in:
Shane
2025-12-02 15:42:25 -08:00
parent 6f9b25e98e
commit 6f09e4c593
3 changed files with 7 additions and 4 deletions

View File

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

View File

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

View File

@@ -29,7 +29,8 @@ export class CipherFileUploadService implements CipherFileUploadServiceAbstracti
dataEncKey: [SymmetricCryptoKey, EncString],
): Promise<CipherResponse> {
const request: AttachmentRequest = {
key: dataEncKey[1].encryptedString,
// key: dataEncKey[1].encryptedString,
key: undefined as any,
fileName: encFileName.encryptedString,
fileSize: encData.buffer.byteLength,
adminRequest: admin,