-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* fix: blink carbon copy link * fix: remove unused code * fix: ui test * fix: pr reviews
- Loading branch information
Showing
7 changed files
with
85 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,13 +69,26 @@ export const getMockFesEndpoints = (mockConfig: MockConfig, fesConfig: FesConfig | |
// body is a mime-multipart string, we're doing a few smoke checks here without parsing it | ||
if (req.method === 'POST') { | ||
expectContains(body, '-----BEGIN PGP MESSAGE-----'); | ||
expectContains(body, '"associateReplyToken":"mock-fes-reply-token"'); | ||
expectContains(body, '"to":["[email protected]"]'); | ||
expectContains(body, '"cc":[]'); | ||
expectContains(body, '"bcc":["[email protected]"]'); | ||
authenticate(req); | ||
expectContains(body, '"from":"[email protected]:8001"'); | ||
return { url: `${mockConfig}/message/FES-MOCK-MESSAGE-ID` }; | ||
const match = String(body).match(/Content-Type: application\/json\s*\n\s*(\{.*\})/); | ||
|
||
if (!match) { | ||
throw new FesHttpErr('Bad request', Status.BAD_REQUEST); | ||
} | ||
const messageData = JSON.parse(match[0]); | ||
const { associateReplyToken, to, cc, bcc } = messageData; | ||
|
||
expect(associateReplyToken).toBe('mock-fes-reply-token'); | ||
|
||
if (fesConfig.messageUploadCheck) { | ||
const { to: toCheck, cc: ccCheck, bcc: bccCheck } = fesConfig.messageUploadCheck; | ||
if (toCheck) expect(to).toBe(toCheck); | ||
if (ccCheck) expect(cc).toBe(ccCheck); | ||
if (bccCheck) expect(bcc).toBe(bccCheck); | ||
} | ||
|
||
return { | ||
url: `https://flowcrypt.com/shared-tenant-fes/message/6da5ea3c-d2d6-4714-b15e-f29c805e5c6a`, | ||
}; | ||
} | ||
throw new FesHttpErr('Not Found', Status.NOT_FOUND); | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
appium/tests/specs/mock/composeEmail/CheckPasswordProtectedMessageBccLeak.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { MailFolderScreen, NewMessageScreen, SetupKeyScreen, SplashScreen } from '../../../screenobjects/all-screens'; | ||
|
||
import { MockApi } from 'api-mocks/mock'; | ||
import { MockApiConfig } from 'api-mocks/mock-config'; | ||
import { CommonData } from '../../../data'; | ||
|
||
describe('COMPOSE EMAIL: ', () => { | ||
it('check sending password protected message bcc leakage', async () => { | ||
const recipient = CommonData.recipientWithoutPublicKey.email; | ||
const emailSubject = CommonData.recipientWithoutPublicKey.subject; | ||
const emailText = CommonData.simpleEmail.message; | ||
const emailPassword = CommonData.recipientWithoutPublicKey.password; | ||
const bcc = '[email protected]'; | ||
|
||
const mockApi = new MockApi(); | ||
|
||
mockApi.ekmConfig = MockApiConfig.defaultEnterpriseEkmConfiguration; | ||
mockApi.fesConfig = { | ||
...MockApiConfig.defaultEnterpriseFesConfiguration, | ||
messageUploadCheck: { | ||
to: [recipient], | ||
cc: [], | ||
bcc: [], | ||
}, | ||
}; | ||
mockApi.attesterConfig = { | ||
servedPubkeys: {}, | ||
}; | ||
|
||
await mockApi.withMockedApis(async () => { | ||
await SplashScreen.mockLogin(); | ||
await SetupKeyScreen.setPassPhrase(); | ||
await MailFolderScreen.checkInboxScreen(); | ||
|
||
await MailFolderScreen.clickCreateEmail(); | ||
await NewMessageScreen.composeEmail(recipient, emailSubject, emailText, undefined, bcc); | ||
await NewMessageScreen.checkFilledComposeEmailInfo({ | ||
recipients: [recipient], | ||
subject: emailSubject, | ||
message: emailText, | ||
bcc: [bcc], | ||
}); | ||
await NewMessageScreen.clickPasswordCell(); | ||
await NewMessageScreen.setMessagePassword(emailPassword); | ||
await NewMessageScreen.clickSendButton(); | ||
}); | ||
}); | ||
}); |