@wireapp/core 45.0.0 → 45.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/messagingProtocols/mls/EventHandler/events/welcomeMessage/welcomeMessage.d.ts.map +1 -1
- package/lib/messagingProtocols/mls/EventHandler/events/welcomeMessage/welcomeMessage.js +2 -0
- package/lib/messagingProtocols/mls/EventHandler/events/welcomeMessage/welcomeMessage.test.js +7 -0
- package/lib/messagingProtocols/mls/MLSService/CoreCryptoMLSError.d.ts +3 -0
- package/lib/messagingProtocols/mls/MLSService/CoreCryptoMLSError.d.ts.map +1 -1
- package/lib/messagingProtocols/mls/MLSService/CoreCryptoMLSError.js +6 -0
- package/package.json +3 -3
package/lib/messagingProtocols/mls/EventHandler/events/welcomeMessage/welcomeMessage.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"welcomeMessage.d.ts","sourceRoot":"","sources":["../../../../../../src/messagingProtocols/mls/EventHandler/events/welcomeMessage/welcomeMessage.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,2BAA2B,EAAC,MAAM,+BAA+B,CAAC;AAG1E,OAAO,EAAC,mBAAmB,EAAC,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAC,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAE/C,UAAU,0BAA0B;IAClC,KAAK,EAAE,2BAA2B,CAAC;IACnC,UAAU,EAAE,UAAU,CAAC;CACxB;AAED,eAAO,MAAM,uBAAuB,2BAGjC,0BAA0B,KAAG,QAAQ,mBAAmB,
|
|
1
|
+
{"version":3,"file":"welcomeMessage.d.ts","sourceRoot":"","sources":["../../../../../../src/messagingProtocols/mls/EventHandler/events/welcomeMessage/welcomeMessage.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,2BAA2B,EAAC,MAAM,+BAA+B,CAAC;AAG1E,OAAO,EAAC,mBAAmB,EAAC,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAC,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAE/C,UAAU,0BAA0B;IAClC,KAAK,EAAE,2BAA2B,CAAC;IACnC,UAAU,EAAE,UAAU,CAAC;CACxB;AAED,eAAO,MAAM,uBAAuB,2BAGjC,0BAA0B,KAAG,QAAQ,mBAAmB,CAiB1D,CAAC"}
|
|
@@ -28,6 +28,8 @@ const handleMLSWelcomeMessage = async ({ mlsService, event, }) => {
|
|
|
28
28
|
// The groupId can then be sent back to the consumer
|
|
29
29
|
// After we were added to the group we need to schedule a periodic key material renewal
|
|
30
30
|
await mlsService.scheduleKeyMaterialRenewal(groupIdStr);
|
|
31
|
+
const newEpoch = await mlsService.getEpoch(groupIdStr);
|
|
32
|
+
mlsService.emit('newEpoch', { groupId: groupIdStr, epoch: newEpoch });
|
|
31
33
|
return {
|
|
32
34
|
event: Object.assign(Object.assign({}, event), { data: groupIdStr }),
|
|
33
35
|
};
|
package/lib/messagingProtocols/mls/EventHandler/events/welcomeMessage/welcomeMessage.test.js
CHANGED
|
@@ -37,6 +37,8 @@ const mockParams = {
|
|
|
37
37
|
mlsService: {
|
|
38
38
|
processWelcomeMessage: jest.fn().mockResolvedValue('conversationId'),
|
|
39
39
|
scheduleKeyMaterialRenewal: jest.fn(),
|
|
40
|
+
getEpoch: jest.fn(),
|
|
41
|
+
emit: jest.fn(),
|
|
40
42
|
},
|
|
41
43
|
dryRun: false,
|
|
42
44
|
};
|
|
@@ -52,5 +54,10 @@ describe('MLS welcomeMessage eventHandler', () => {
|
|
|
52
54
|
expect(eventHandlerResult).toBeDefined();
|
|
53
55
|
expect(eventHandlerResult.event).toEqual({ data: 'conversationId', type: 'conversation.mls-welcome' });
|
|
54
56
|
});
|
|
57
|
+
it('emits new epoch event after processing a welcome message', async () => {
|
|
58
|
+
jest.spyOn(mockParams.mlsService, 'getEpoch').mockResolvedValue(1);
|
|
59
|
+
await (0, welcomeMessage_1.handleMLSWelcomeMessage)(mockParams);
|
|
60
|
+
expect(mockParams.mlsService.emit).toHaveBeenCalledWith('newEpoch', { groupId: 'conversationId', epoch: 1 });
|
|
61
|
+
});
|
|
55
62
|
});
|
|
56
63
|
});
|
|
@@ -4,6 +4,9 @@ export declare const CoreCryptoMLSError: {
|
|
|
4
4
|
readonly ALREADY_DECRYPTED: "We already decrypted this message once";
|
|
5
5
|
readonly EXTERNAL_COMMIT_NOT_MERGED: "You tried to join with an external commit but did not merge it yet. We will reapply this message for you when you merge your external commit";
|
|
6
6
|
readonly FUTURE_EPOCH: "Incoming message is for a future epoch. We will buffer it until the commit for that epoch arrives";
|
|
7
|
+
readonly STALE_COMMIT: "The received commit is deemed stale and is from an older epoch.";
|
|
8
|
+
readonly STALE_PROPOSAL: "The received proposal is deemed stale and is from an older epoch.";
|
|
9
|
+
readonly DUPLICATE_MESSAGE: "We already decrypted this message once";
|
|
7
10
|
};
|
|
8
11
|
readonly CONVERSATION_ALREADY_EXISTS: "Conversation already exists";
|
|
9
12
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoreCryptoMLSError.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/MLSService/CoreCryptoMLSError.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,kBAAkB
|
|
1
|
+
{"version":3,"file":"CoreCryptoMLSError.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/MLSService/CoreCryptoMLSError.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,kBAAkB;;;;;;;;;;;CAYrB,CAAC;AAEX,eAAO,MAAM,8BAA8B,UAAW,OAAO,KAAG,OAE/D,CAAC;AAEF,eAAO,MAAM,6CAA6C,UAAW,OAAO,KAAG,OAE9E,CAAC;AAWF,eAAO,MAAM,iCAAiC,UAAW,OAAO,mBAE/D,CAAC"}
|
|
@@ -25,6 +25,9 @@ exports.CoreCryptoMLSError = {
|
|
|
25
25
|
ALREADY_DECRYPTED: 'We already decrypted this message once',
|
|
26
26
|
EXTERNAL_COMMIT_NOT_MERGED: 'You tried to join with an external commit but did not merge it yet. We will reapply this message for you when you merge your external commit',
|
|
27
27
|
FUTURE_EPOCH: 'Incoming message is for a future epoch. We will buffer it until the commit for that epoch arrives',
|
|
28
|
+
STALE_COMMIT: 'The received commit is deemed stale and is from an older epoch.',
|
|
29
|
+
STALE_PROPOSAL: 'The received proposal is deemed stale and is from an older epoch.',
|
|
30
|
+
DUPLICATE_MESSAGE: 'We already decrypted this message once',
|
|
28
31
|
},
|
|
29
32
|
CONVERSATION_ALREADY_EXISTS: 'Conversation already exists',
|
|
30
33
|
};
|
|
@@ -40,6 +43,9 @@ const mlsDecryptionErrorsToIgnore = [
|
|
|
40
43
|
exports.CoreCryptoMLSError.DECRYPTION.ALREADY_DECRYPTED,
|
|
41
44
|
exports.CoreCryptoMLSError.DECRYPTION.EXTERNAL_COMMIT_NOT_MERGED,
|
|
42
45
|
exports.CoreCryptoMLSError.DECRYPTION.FUTURE_EPOCH,
|
|
46
|
+
exports.CoreCryptoMLSError.DECRYPTION.STALE_COMMIT,
|
|
47
|
+
exports.CoreCryptoMLSError.DECRYPTION.STALE_PROPOSAL,
|
|
48
|
+
exports.CoreCryptoMLSError.DECRYPTION.DUPLICATE_MESSAGE,
|
|
43
49
|
];
|
|
44
50
|
const shouldMLSDecryptionErrorBeIgnored = (error) => {
|
|
45
51
|
return error instanceof Error && mlsDecryptionErrorsToIgnore.includes(error.message);
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"./lib/cryptography/AssetCryptography/crypto.node": "./lib/cryptography/AssetCryptography/crypto.browser.js"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@wireapp/api-client": "^26.10.
|
|
14
|
+
"@wireapp/api-client": "^26.10.11",
|
|
15
15
|
"@wireapp/commons": "^5.2.5",
|
|
16
16
|
"@wireapp/core-crypto": "1.0.0-rc.43",
|
|
17
17
|
"@wireapp/cryptobox": "12.8.0",
|
|
@@ -60,6 +60,6 @@
|
|
|
60
60
|
"test:coverage": "jest --coverage",
|
|
61
61
|
"watch": "tsc --watch"
|
|
62
62
|
},
|
|
63
|
-
"version": "45.0.
|
|
64
|
-
"gitHead": "
|
|
63
|
+
"version": "45.0.2",
|
|
64
|
+
"gitHead": "5b81e2568505dee685227229e4f440e9e8b245e9"
|
|
65
65
|
}
|