@wireapp/core 38.7.1 → 38.8.1
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/conversation/ConversationService/ConversationService.d.ts +1 -2
- package/lib/conversation/ConversationService/ConversationService.d.ts.map +1 -1
- package/lib/conversation/ConversationService/ConversationService.js +1 -5
- package/lib/messagingProtocols/mls/MLSService/MLSService.d.ts +10 -7
- package/lib/messagingProtocols/mls/MLSService/MLSService.d.ts.map +1 -1
- package/lib/messagingProtocols/mls/MLSService/MLSService.js +29 -13
- package/package.json +5 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Conversation, DefaultConversationRoleName, MutedStatus, NewConversation, QualifiedUserClients, UserClients,
|
|
1
|
+
import { Conversation, DefaultConversationRoleName, MutedStatus, NewConversation, QualifiedUserClients, UserClients, RemoteConversations } from '@wireapp/api-client/lib/conversation';
|
|
2
2
|
import { ConversationMemberLeaveEvent } from '@wireapp/api-client/lib/event';
|
|
3
3
|
import { QualifiedId } from '@wireapp/api-client/lib/user';
|
|
4
4
|
import { XOR } from '@wireapp/commons/lib/util/TypeUtil';
|
|
@@ -51,7 +51,6 @@ export declare class ConversationService {
|
|
|
51
51
|
createProteusConversation(conversationData: NewConversation): Promise<Conversation>;
|
|
52
52
|
getConversation(conversationId: QualifiedId): Promise<Conversation>;
|
|
53
53
|
getConversations(conversationIds?: QualifiedId[]): Promise<RemoteConversations>;
|
|
54
|
-
getSubconversation(conversationId: QualifiedId, subconversationId: SUBCONVERSATION_ID): Promise<Subconversation>;
|
|
55
54
|
getAsset({ assetId, assetToken, otrKey, sha256 }: RemoteData): Promise<Uint8Array>;
|
|
56
55
|
getUnencryptedAsset(assetId: string, assetToken?: string): Promise<ArrayBuffer>;
|
|
57
56
|
addUsersToProteusConversation(params: AddUsersToProteusConversationParams): Promise<import("@wireapp/api-client/lib/event").ConversationMemberJoinEvent>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConversationService.d.ts","sourceRoot":"","sources":["../../../src/conversation/ConversationService/ConversationService.ts"],"names":[],"mappings":"AAmBA,OAAO,EAEL,YAAY,EACZ,2BAA2B,EAC3B,WAAW,EACX,eAAe,EACf,oBAAoB,EACpB,WAAW,EAGX,
|
|
1
|
+
{"version":3,"file":"ConversationService.d.ts","sourceRoot":"","sources":["../../../src/conversation/ConversationService/ConversationService.ts"],"names":[],"mappings":"AAmBA,OAAO,EAEL,YAAY,EACZ,2BAA2B,EAC3B,WAAW,EACX,eAAe,EACf,oBAAoB,EACpB,WAAW,EAGX,mBAAmB,EACpB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAC,4BAA4B,EAAC,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAC,GAAG,EAAC,MAAM,oCAAoC,CAAC;AAIvD,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAI9C,OAAO,EAAC,cAAc,EAAE,aAAa,EAAE,oBAAoB,EAAE,UAAU,EAAC,MAAM,6BAA6B,CAAC;AAE5G,OAAO,EAAC,YAAY,EAAuB,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AAEzF,OAAO,EAAC,UAAU,EAAuB,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAkC,cAAc,EAAC,MAAM,kCAAkC,CAAC;AACjG,OAAO,EACL,mCAAmC,EACnC,wBAAwB,EACzB,MAAM,sEAAsE,CAAC;AAG9E,OAAO,EAAC,UAAU,EAAC,MAAM,YAAY,CAAC;AAItC,qBAAa,mBAAmB;IAM5B,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC;IAR/B,SAAgB,YAAY,EAAE,YAAY,CAAC;IAC3C,OAAO,CAAC,QAAQ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ation.getConversationsByQualifiedIds(conversationIds);
|
|
120
120
|
}
|
|
121
|
-
async getSubconversation(conversationId, subconversationId) {
|
|
122
|
-
return this.apiClient.api.conversation.getSubconversation(conversationId, subconversationId);
|
|
123
|
-
}
|
|
124
121
|
async getAsset({ assetId, assetToken, otrKey, sha256 }) {
|
|
125
122
|
const request = this.apiClient.api.asset.getAssetV3(assetId, assetToken);
|
|
126
123
|
const encryptedBuffer = (await request.response).buffer;
|
|
@@ -289,8 +286,7 @@ class ConversationService {
|
|
|
289
286
|
});
|
|
290
287
|
}
|
|
291
288
|
async isMLSConversationEstablished(groupId) {
|
|
292
|
-
|
|
293
|
-
return this.mlsService.conversationExists(groupIdBytes);
|
|
289
|
+
return this.mlsService.conversationExists(groupId);
|
|
294
290
|
}
|
|
295
291
|
async wipeMLSConversation(groupId) {
|
|
296
292
|
return this.mlsService.wipeConversation(groupId);
|
|
@@ -11,6 +11,11 @@ import { EventHandlerResult } from '../../common.types';
|
|
|
11
11
|
import { EventHandlerParams } from '../EventHandler';
|
|
12
12
|
import { CommitPendingProposalsParams, HandlePendingProposalsParams, MLSCallbacks } from '../types';
|
|
13
13
|
export declare const optionalToUint8Array: (array: Uint8Array | []) => Uint8Array;
|
|
14
|
+
export interface SubconversationEpochInfoMember {
|
|
15
|
+
userid: string;
|
|
16
|
+
clientid: string;
|
|
17
|
+
in_subconv: boolean;
|
|
18
|
+
}
|
|
14
19
|
type Events = {
|
|
15
20
|
newEpoch: {
|
|
16
21
|
epoch: number;
|
|
@@ -33,18 +38,16 @@ export declare class MLSService extends TypedEventEmitter<Events> {
|
|
|
33
38
|
getEpoch(groupId: string | Uint8Array): Promise<number>;
|
|
34
39
|
newProposal(proposalType: ProposalType, args: ProposalArgs | AddProposalArgs | RemoveProposalArgs): Promise<import("@wireapp/core-crypto").ProposalBundle>;
|
|
35
40
|
joinByExternalCommit(getGroupInfo: () => Promise<Uint8Array>): Promise<PostMlsMessageResponse | null>;
|
|
41
|
+
getConferenceSubconversation(conversationId: QualifiedId): Promise<Subconversation>;
|
|
42
|
+
private deleteConferenceSubconversation;
|
|
36
43
|
/**
|
|
37
44
|
* Will join or register an mls subconversation for conference calls.
|
|
38
45
|
* Will return the secret key derived from the subconversation
|
|
39
46
|
*
|
|
40
47
|
* @param conversationId Id of the parent conversation in which the call should happen
|
|
41
48
|
*/
|
|
42
|
-
joinConferenceSubconversation(conversationId: QualifiedId): Promise<
|
|
43
|
-
|
|
44
|
-
secretKey: string;
|
|
45
|
-
keyLength: number;
|
|
46
|
-
}>;
|
|
47
|
-
private exportSecretKey;
|
|
49
|
+
joinConferenceSubconversation(conversationId: QualifiedId): Promise<Subconversation>;
|
|
50
|
+
exportSecretKey(groupId: string, keyLength: number): Promise<string>;
|
|
48
51
|
newExternalProposal(externalProposalType: ExternalProposalType, args: ExternalProposalArgs | ExternalRemoveProposalArgs): Promise<Uint8Array>;
|
|
49
52
|
processWelcomeMessage(welcomeMessage: Uint8Array): Promise<ConversationId>;
|
|
50
53
|
decryptMessage(conversationId: ConversationId, payload: Uint8Array): Promise<DecryptedMessage>;
|
|
@@ -73,7 +76,7 @@ export declare class MLSService extends TypedEventEmitter<Events> {
|
|
|
73
76
|
}): Promise<PostMlsMessageResponse | null | undefined>;
|
|
74
77
|
removeClientsFromConversation(conversationId: ConversationId, clientIds: Uint8Array[]): Promise<PostMlsMessageResponse | null>;
|
|
75
78
|
private commitProposals;
|
|
76
|
-
conversationExists(
|
|
79
|
+
conversationExists(groupId: string): Promise<boolean>;
|
|
77
80
|
clientValidKeypackagesCount(): Promise<number>;
|
|
78
81
|
clientKeypackages(amountRequested: number): Promise<Uint8Array[]>;
|
|
79
82
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MLSService.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/MLSService/MLSService.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,sBAAsB,EAAqB,MAAM,sCAAsC,CAAC;AAChG,OAAO,EAAC,e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AAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKhD,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,kBAAkB,EAAE,YAAY,CAAC,GAAG,kBAAkB;IAO5F;;;;;OAKG;IACU,4BAA4B,CACvC,uBAAuB,EAAE,WAAW,EACpC,iBAAiB,CAAC,EAAE,MAAM,GACzB,OAAO,CAAC,MAAM,CAAC;IAYlB;;;;;;;OAOG;IACU,sBAAsB,CAAC,EAAC,SAAS,EAAE,OAAO,EAAE,SAAS,EAAC,EAAE,4BAA4B;IAoBjG;;;;;OAKG;IACU,sBAAsB,CAAC,EAAC,OAAO,EAAE,UAAkB,EAAC,EAAE,4BAA4B;IAa/F;;;;OAIG;IACU,6BAA6B;IAiB1C;;;;OAIG;IACU,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,EAAE,CAAC;CAY1G"}
|
|
@@ -34,6 +34,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
35
|
exports.MLSService = exports.optionalToUint8Array = void 0;
|
|
36
36
|
const conversation_1 = require("@wireapp/api-client/lib/conversation");
|
|
37
|
+
const TimeUtil_1 = require("@wireapp/commons/lib/util/TimeUtil");
|
|
37
38
|
const axios_1 = __importDefault(require("axios"));
|
|
38
39
|
const bazinga64_1 = require("bazinga64");
|
|
39
40
|
const logdown_1 = __importDefault(require("logdown"));
|
|
@@ -174,6 +175,12 @@ class MLSService extends TypedEventEmitter_1.TypedEventEmitter {
|
|
|
174
175
|
regenerateCommitBundle: async () => (await generateCommit()).commitBundle,
|
|
175
176
|
});
|
|
176
177
|
}
|
|
178
|
+
async getConferenceSubconversation(conversationId) {
|
|
179
|
+
return this.apiClient.api.conversation.getSubconversation(conversationId, conversation_1.SUBCONVERSATION_ID.CONFERENCE);
|
|
180
|
+
}
|
|
181
|
+
async deleteConferenceSubconversation(conversationId, data) {
|
|
182
|
+
return this.apiClient.api.conversation.deleteSubconversation(conversationId, conversation_1.SUBCONVERSATION_ID.CONFERENCE, data);
|
|
183
|
+
}
|
|
177
184
|
/**
|
|
178
185
|
* Will join or register an mls subconversation for conference calls.
|
|
179
186
|
* Will return the secret key derived from the subconversation
|
|
@@ -181,23 +188,31 @@ class MLSService extends TypedEventEmitter_1.TypedEventEmitter {
|
|
|
181
188
|
* @param conversationId Id of the parent conversation in which the call should happen
|
|
182
189
|
*/
|
|
183
190
|
async joinConferenceSubconversation(conversationId) {
|
|
184
|
-
const subconversation = await this.
|
|
191
|
+
const subconversation = await this.getConferenceSubconversation(conversationId);
|
|
185
192
|
if (subconversation.epoch === 0) {
|
|
193
|
+
// if subconversation is not yet established, create it
|
|
186
194
|
await this.registerConversation(subconversation.group_id, []);
|
|
187
195
|
}
|
|
188
196
|
else {
|
|
189
|
-
|
|
197
|
+
const epochUpdateTime = new Date(subconversation.epoch_timestamp).getTime();
|
|
198
|
+
const epochAge = new Date().getTime() - epochUpdateTime;
|
|
199
|
+
if (epochAge > TimeUtil_1.TimeInMillis.DAY) {
|
|
200
|
+
// if subconversation does exist, but it's older than 24h, delete and re-join
|
|
201
|
+
await this.deleteConferenceSubconversation(conversationId, {
|
|
202
|
+
groupId: subconversation.group_id,
|
|
203
|
+
epoch: subconversation.epoch,
|
|
204
|
+
});
|
|
205
|
+
await this.wipeConversation(subconversation.group_id);
|
|
206
|
+
return this.joinConferenceSubconversation(conversationId);
|
|
207
|
+
}
|
|
190
208
|
await this.joinByExternalCommit(() => this.apiClient.api.conversation.getSubconversationGroupInfo(conversationId, conversation_1.SUBCONVERSATION_ID.CONFERENCE));
|
|
191
209
|
}
|
|
210
|
+
// We refetch subconversation after joining/registering
|
|
211
|
+
// This way we're sure we return the fresh list of subconversation members
|
|
212
|
+
const updatedSubconversation = await this.apiClient.api.conversation.getSubconversation(conversationId, conversation_1.SUBCONVERSATION_ID.CONFERENCE);
|
|
192
213
|
// We store the mapping between the subconversation and the parent conversation
|
|
193
|
-
(0, subconversationGroupIdMapper_1.storeSubconversationGroupId)(conversationId,
|
|
194
|
-
|
|
195
|
-
const secretKey = await this.exportSecretKey(subconversation.group_id, keyLength);
|
|
196
|
-
return {
|
|
197
|
-
subconversation,
|
|
198
|
-
secretKey,
|
|
199
|
-
keyLength,
|
|
200
|
-
};
|
|
214
|
+
(0, subconversationGroupIdMapper_1.storeSubconversationGroupId)(conversationId, updatedSubconversation.subconv_id, updatedSubconversation.group_id);
|
|
215
|
+
return updatedSubconversation;
|
|
201
216
|
}
|
|
202
217
|
async exportSecretKey(groupId, keyLength) {
|
|
203
218
|
const groupIdBytes = bazinga64_1.Decoder.fromBase64(groupId).asBytes;
|
|
@@ -276,8 +291,9 @@ class MLSService extends TypedEventEmitter_1.TypedEventEmitter {
|
|
|
276
291
|
const commitBundle = await this.coreCryptoClient.commitPendingProposals(groupId);
|
|
277
292
|
return commitBundle ? void (await this.uploadCommitBundle(groupId, commitBundle)) : undefined;
|
|
278
293
|
}
|
|
279
|
-
async conversationExists(
|
|
280
|
-
|
|
294
|
+
async conversationExists(groupId) {
|
|
295
|
+
const groupIdBytes = bazinga64_1.Decoder.fromBase64(groupId).asBytes;
|
|
296
|
+
return this.coreCryptoClient.conversationExists(groupIdBytes);
|
|
281
297
|
}
|
|
282
298
|
async clientValidKeypackagesCount() {
|
|
283
299
|
return this.coreCryptoClient.clientValidKeypackagesCount();
|
|
@@ -292,7 +308,7 @@ class MLSService extends TypedEventEmitter_1.TypedEventEmitter {
|
|
|
292
308
|
*/
|
|
293
309
|
async renewKeyMaterial(groupId) {
|
|
294
310
|
try {
|
|
295
|
-
const groupConversationExists = await this.conversationExists(
|
|
311
|
+
const groupConversationExists = await this.conversationExists(groupId);
|
|
296
312
|
if (!groupConversationExists) {
|
|
297
313
|
keyMaterialUpdatesStore_1.keyMaterialUpdatesStore.deleteLastKeyMaterialUpdateDate({ groupId });
|
|
298
314
|
return;
|
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": "^22.
|
|
14
|
+
"@wireapp/api-client": "^22.15.0",
|
|
15
15
|
"@wireapp/commons": "^5.0.4",
|
|
16
16
|
"@wireapp/core-crypto": "0.6.0-rc.3",
|
|
17
17
|
"@wireapp/cryptobox": "12.8.0",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"@wireapp/protocol-messaging": "1.44.0",
|
|
20
20
|
"@wireapp/store-engine": "5.0.3",
|
|
21
21
|
"@wireapp/store-engine-dexie": "^2.0.5",
|
|
22
|
-
"axios": "1.2.
|
|
22
|
+
"axios": "1.2.6",
|
|
23
23
|
"bazinga64": "6.0.3",
|
|
24
24
|
"hash.js": "1.1.7",
|
|
25
25
|
"http-status-codes": "2.2.0",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@types/long": "^5.0.0",
|
|
37
37
|
"@types/rimraf": "^3.0.2",
|
|
38
38
|
"@types/tough-cookie": "4.0.2",
|
|
39
|
-
"commander": "
|
|
39
|
+
"commander": "10.0.0",
|
|
40
40
|
"cross-env": "7.0.3",
|
|
41
41
|
"dotenv-defaults": "5.0.2",
|
|
42
42
|
"fake-indexeddb": "^4.0.0",
|
|
@@ -60,6 +60,6 @@
|
|
|
60
60
|
"test:coverage": "jest --coverage",
|
|
61
61
|
"watch": "tsc --watch"
|
|
62
62
|
},
|
|
63
|
-
"version": "38.
|
|
64
|
-
"gitHead": "
|
|
63
|
+
"version": "38.8.1",
|
|
64
|
+
"gitHead": "7db774faf6be1fa96f642fa167710fcb8aea70f1"
|
|
65
65
|
}
|