Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/modules/email/email-encryption.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,8 @@ export function projectForCaller(
return {
encryptedPreview: envelope.encryptedPreview,
wrappedKeys: envelope.wrappedKeys,
...(envelope.attachmentWrappedKeys && {
attachmentWrappedKeys: envelope.attachmentWrappedKeys,
}),
};
}
14 changes: 14 additions & 0 deletions src/modules/email/email.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ export class EncryptionBlockDto {
description: 'De-identified wrapped keys, one per recipient',
})
wrappedKeys!: EncryptedWrappedKeyDto[];

@ApiProperty({
type: [EncryptedWrappedKeyDto],
description: 'De-identified attachment wrapped keys, one per recipient',
})
attachmentWrappedKeys!: EncryptedWrappedKeyDto[];
}

export class AttachmentRefDto {
Expand Down Expand Up @@ -218,6 +224,14 @@ export class EncryptedSummaryDto {
'De-identified wrapped keys; the client trial-decrypts to read',
})
wrappedKeys!: EncryptedWrappedKeyDto[];

@ApiPropertyOptional({
type: [EncryptedWrappedKeyDto],
description:
'De-identified wrapped keys for the symmetric key that encrypts the ' +
"email's attachments. Present only when the email has encrypted attachments.",
})
attachmentWrappedKeys?: EncryptedWrappedKeyDto[];
}

export class EmailSummaryResponseDto {
Expand Down
2 changes: 2 additions & 0 deletions src/modules/email/email.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export interface Mailbox {
export interface EncryptedSummaryFields {
encryptedPreview: string;
wrappedKeys: EncryptedWrappedKey[];
attachmentWrappedKeys?: EncryptedWrappedKey[];
}

export interface EmailSummary {
Expand Down Expand Up @@ -77,6 +78,7 @@ export interface EncryptionBlock {
encryptedPreview: string;
encryptedText: string;
wrappedKeys: EncryptedWrappedKey[];
attachmentWrappedKeys?: EncryptedWrappedKey[];
}

export interface SendEmailDto {
Expand Down
Loading