1
0
mirror of https://github.com/bitwarden/browser synced 2026-03-02 19:41:26 +00:00

Merge branch 'main' into PM-29919-Add-dropdown-to-select-email-verification-and-emails-field-to-Send-when-creating-or-editing-a-Send

This commit is contained in:
bmbitwarden
2026-01-12 08:13:44 -05:00
committed by GitHub
294 changed files with 13909 additions and 949 deletions

View File

@@ -525,6 +525,20 @@ describe("VaultExportService", () => {
const exportedData = actual as ExportedVaultAsString;
expectEqualFolders(UserFolders, exportedData.data);
});
it("does not export the key property in unencrypted exports", async () => {
// Create a cipher with a key property
const cipherWithKey = generateCipherView(false);
(cipherWithKey as any).key = "shouldBeDeleted";
cipherService.getAllDecrypted.mockResolvedValue([cipherWithKey]);
const actual = await exportService.getExport(userId, "json");
expect(typeof actual.data).toBe("string");
const exportedData = actual as ExportedVaultAsString;
const parsed = JSON.parse(exportedData.data);
expect(parsed.items.length).toBe(1);
expect(parsed.items[0].key).toBeUndefined();
});
});
export class FolderResponse {

View File

@@ -317,6 +317,7 @@ export class IndividualVaultExportService
const cipher = new CipherWithIdExport();
cipher.build(c);
cipher.collectionIds = null;
delete cipher.key;
jsonDoc.items.push(cipher);
});

View File

@@ -383,6 +383,7 @@ export class OrganizationVaultExportService
decCiphers.forEach((c) => {
const cipher = new CipherWithIdExport();
cipher.build(c);
delete cipher.key;
jsonDoc.items.push(cipher);
});
return JSON.stringify(jsonDoc, null, " ");

View File

@@ -44,8 +44,10 @@ export const SendItemDialogResult = Object.freeze({
} as const);
/** A result of the Send add/edit dialog. */
export type SendItemDialogResult = (typeof SendItemDialogResult)[keyof typeof SendItemDialogResult];
export type SendItemDialogResult = {
result: (typeof SendItemDialogResult)[keyof typeof SendItemDialogResult];
send?: SendView;
};
/**
* Component for adding or editing a send item.
*/
@@ -93,7 +95,7 @@ export class SendAddEditDialogComponent {
*/
async onSendCreated(send: SendView) {
// FIXME Add dialogService.open send-created dialog
this.dialogRef.close(SendItemDialogResult.Saved);
this.dialogRef.close({ result: SendItemDialogResult.Saved, send });
return;
}
@@ -101,14 +103,14 @@ export class SendAddEditDialogComponent {
* Handles the event when the send is updated.
*/
async onSendUpdated(send: SendView) {
this.dialogRef.close(SendItemDialogResult.Saved);
this.dialogRef.close({ result: SendItemDialogResult.Saved });
}
/**
* Handles the event when the send is deleted.
*/
async onSendDeleted() {
this.dialogRef.close(SendItemDialogResult.Deleted);
this.dialogRef.close({ result: SendItemDialogResult.Deleted });
this.toastService.showToast({
variant: "success",