1
0
mirror of https://github.com/bitwarden/jslib synced 2025-12-20 10:13:43 +00:00

Use encrypted filename filename in Cipher attachment upload blob name (#403)

* Use EncString type to enforce encryption on filename in Cipher attachment upload

* Fix Cipher attachment test
This commit is contained in:
Matt Gibson
2021-06-08 14:02:08 -05:00
committed by GitHub
parent 2e16aef6a2
commit ea90aea013
4 changed files with 6 additions and 5 deletions

View File

@@ -638,7 +638,7 @@ export class CipherService implements CipherServiceAbstraction {
try {
const uploadDataResponse = await this.apiService.postCipherAttachment(cipher.id, request);
response = admin ? uploadDataResponse.cipherMiniResponse : uploadDataResponse.cipherResponse;
await this.fileUploadService.uploadCipherAttachment(admin, uploadDataResponse, filename, encData);
await this.fileUploadService.uploadCipherAttachment(admin, uploadDataResponse, encFileName, encData);
} catch (e) {
if (e instanceof ErrorResponse && (e as ErrorResponse).statusCode === 404 || (e as ErrorResponse).statusCode === 405) {
response = await this.legacyServerAttachmentFileUpload(admin, cipher.id, encFileName, encData, dataEncKey[1]);