@wireapp/core 38.1.0 → 38.3.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"messageAdd.d.ts","sourceRoot":"","sources":["../../../../../../../src/messagingProtocols/mls/EventHandler/ConversationEvent/events/messageAdd/messageAdd.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,YAAY,EAAE,8BAA8B,EAAqB,MAAM,+BAA+B,CAAC;AAE/G,OAAO,OAAO,MAAM,SAAS,CAAC;AAI9B,OAAO,EAAC,kBAAkB,EAAC,MAAM,6BAA6B,CAAC;AAE/D,OAAO,EAAC,kBAAkB,EAAC,MAAM,6BAA6B,CAAC;AAE/D,QAAA,MAAM,oBAAoB,UAAW,YAAY,4CACE,CAAC;AAEpD,UAAU,yBAA0B,SAAQ,kBAAkB;IAC5D,KAAK,EAAE,8BAA8B,CAAC;IACtC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC;CACxB;AACD,QAAA,MAAM,mBAAmB,kCAAuC,yBAAyB,uBA4CxF,CAAC;AAEF,OAAO,EAAC,oBAAoB,EAAE,mBAAmB,EAAC,CAAC"}
1
+ {"version":3,"file":"messageAdd.d.ts","sourceRoot":"","sources":["../../../../../../../src/messagingProtocols/mls/EventHandler/ConversationEvent/events/messageAdd/messageAdd.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,YAAY,EAAE,8BAA8B,EAAqB,MAAM,+BAA+B,CAAC;AAE/G,OAAO,OAAO,MAAM,SAAS,CAAC;AAI9B,OAAO,EAAC,kBAAkB,EAAC,MAAM,6BAA6B,CAAC;AAE/D,OAAO,EAAC,kBAAkB,EAAC,MAAM,6BAA6B,CAAC;AAE/D,QAAA,MAAM,oBAAoB,UAAW,YAAY,4CACE,CAAC;AAEpD,UAAU,yBAA0B,SAAQ,kBAAkB;IAC5D,KAAK,EAAE,8BAA8B,CAAC;IACtC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC;CACxB;AACD,QAAA,MAAM,mBAAmB,kCAAuC,yBAAyB,uBA6CxF,CAAC;AAEF,OAAO,EAAC,oBAAoB,EAAE,mBAAmB,EAAC,CAAC"}
@@ -28,7 +28,7 @@ exports.isMLSMessageAddEvent = isMLSMessageAddEvent;
28
28
  const handleMLSMessageAdd = async ({ mlsService, event, logger }) => {
29
29
  var _a;
30
30
  const encryptedData = bazinga64_1.Decoder.fromBase64(event.data).asBytes;
31
- const groupId = await mlsService.getGroupIdFromConversationId((_a = event.qualified_conversation) !== null && _a !== void 0 ? _a : { id: event.conversation, domain: '' });
31
+ const groupId = await mlsService.getGroupIdFromConversationId((_a = event.qualified_conversation) !== null && _a !== void 0 ? _a : { id: event.conversation, domain: '' }, event.subconv);
32
32
  const groupIdBytes = bazinga64_1.Decoder.fromBase64(groupId).asBytes;
33
33
  const { proposals, commitDelay, message, senderClientId: encodedSenderClientId, } = await mlsService.decryptMessage(groupIdBytes, encryptedData);
34
34
  if (encodedSenderClientId) {
@@ -1,4 +1,5 @@
1
1
  import { PostMlsMessageResponse } from '@wireapp/api-client/lib/conversation';
2
+ import { Subconversation } from '@wireapp/api-client/lib/conversation/Subconversation';
2
3
  import { QualifiedId } from '@wireapp/api-client/lib/user';
3
4
  import logdown from 'logdown';
4
5
  import { APIClient } from '@wireapp/api-client';
@@ -32,7 +33,7 @@ export declare class MLSService {
32
33
  * @param conversationId Id of the parent conversation in which the call should happen
33
34
  */
34
35
  joinConferenceSubconversation(conversationId: QualifiedId): Promise<{
35
- epoch: number;
36
+ subconversation: Subconversation;
36
37
  secretKey: string;
37
38
  keyLength: number;
38
39
  }>;
@@ -111,7 +112,7 @@ export declare class MLSService {
111
112
  *
112
113
  * @param conversationQualifiedId
113
114
  */
114
- getGroupIdFromConversationId(conversationQualifiedId: QualifiedId): Promise<string>;
115
+ getGroupIdFromConversationId(conversationQualifiedId: QualifiedId, subconversationId?: string): Promise<string>;
115
116
  /**
116
117
  * If there are pending proposals, we need to either process them,
117
118
  * or save them in the database for later processing
@@ -134,5 +135,15 @@ export declare class MLSService {
134
135
  *
135
136
  */
136
137
  checkExistingPendingProposals(): Promise<void>;
138
+ /**
139
+ * Get all conversation members client ids.
140
+ *
141
+ * @param groupId groupId of the conversation
142
+ */
143
+ getClientIds(groupId: string): Promise<{
144
+ userId: string;
145
+ clientId: string;
146
+ domain: string;
147
+ }[]>;
137
148
  }
138
149
  //# sourceMappingURL=MLSService.d.ts.map
@@ -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,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAGzD,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAE9C,OAAO,EACL,eAAe,EAGf,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,0BAA0B,EAC1B,OAAO,EACP,YAAY,EACZ,YAAY,EACZ,kBAAkB,EACnB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAC,gBAAgB,EAAsB,MAAM,oBAAoB,CAAC;AAIzE,OAAO,EAAC,cAAc,EAAC,MAAM,uBAAuB,CAAC;AAKrD,OAAO,EAAC,kBAAkB,EAAC,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAC,kBAAkB,EAAqB,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAC,4BAA4B,EAAE,4BAA4B,EAAE,YAAY,EAAC,MAAM,UAAU,CAAC;AAIlG,eAAO,MAAM,oBAAoB,UAAW,UAAU,GAAG,EAAE,KAAG,UAE7D,CAAC;AAOF,qBAAa,UAAU;IAMnB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,gBAAgB;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AE,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"}
@@ -41,6 +41,7 @@ const commons_1 = require("@wireapp/commons");
41
41
  const commitBundleUtil_1 = require("./commitBundleUtil");
42
42
  const keyMaterialUpdatesStore_1 = require("./stores/keyMaterialUpdatesStore");
43
43
  const pendingProposalsStore_1 = require("./stores/pendingProposalsStore");
44
+ const subconversationGroupIdMapper_1 = require("./subconversationGroupIdMapper");
44
45
  const messageSender_1 = require("../../../conversation/message/messageSender");
45
46
  const fullyQualifiedClientIdUtils_1 = require("../../../util/fullyQualifiedClientIdUtils");
46
47
  const RecurringTaskScheduler_1 = require("../../../util/RecurringTaskScheduler");
@@ -185,11 +186,13 @@ class MLSService {
185
186
  else {
186
187
  await this.joinByExternalCommit(() => this.apiClient.api.conversation.getSubconversationGroupInfo(conversationId, conversation_1.SUBCONVERSATION_ID.CONFERENCE));
187
188
  }
189
+ // We store the mapping between the subconversation and the parent conversation
190
+ (0, subconversationGroupIdMapper_1.storeSubconversationGroupId)(conversationId, subconversation.subconv_id, subconversation.group_id);
188
191
  const keyLength = 256;
189
192
  const groupIdBytes = bazinga64_1.Decoder.fromBase64(subconversation.group_id).asBytes;
190
193
  const secretKey = await this.coreCryptoClient.exportSecretKey(groupIdBytes, keyLength);
191
194
  return {
192
- epoch: subconversation.epoch,
195
+ subconversation,
193
196
  secretKey: new TextDecoder().decode(secretKey),
194
197
  keyLength,
195
198
  };
@@ -381,10 +384,12 @@ class MLSService {
381
384
  *
382
385
  * @param conversationQualifiedId
383
386
  */
384
- async getGroupIdFromConversationId(conversationQualifiedId) {
387
+ async getGroupIdFromConversationId(conversationQualifiedId, subconversationId) {
385
388
  var _a;
386
389
  const { id: conversationId, domain: conversationDomain } = conversationQualifiedId;
387
- const groupId = await ((_a = this.groupIdFromConversationId) === null || _a === void 0 ? void 0 : _a.call(this, conversationQualifiedId));
390
+ const groupId = subconversationId
391
+ ? (0, subconversationGroupIdMapper_1.getGroupId)(conversationQualifiedId, subconversationId)
392
+ : await ((_a = this.groupIdFromConversationId) === null || _a === void 0 ? void 0 : _a.call(this, conversationQualifiedId));
388
393
  if (!groupId) {
389
394
  throw new Error(`Could not find a group_id for conversation ${conversationId}@${conversationDomain}`);
390
395
  }
@@ -454,5 +459,20 @@ class MLSService {
454
459
  this.logger.error('Could not get pending proposals', error);
455
460
  }
456
461
  }
462
+ /**
463
+ * Get all conversation members client ids.
464
+ *
465
+ * @param groupId groupId of the conversation
466
+ */
467
+ async getClientIds(groupId) {
468
+ const groupIdBytes = bazinga64_1.Decoder.fromBase64(groupId).asBytes;
469
+ const decoder = new TextDecoder();
470
+ const rawClientIds = await this.coreCryptoClient.getClientIds(groupIdBytes);
471
+ const clientIds = rawClientIds.map(id => {
472
+ const { user, client, domain } = (0, fullyQualifiedClientIdUtils_1.parseFullQualifiedClientId)(decoder.decode(id));
473
+ return { userId: user, clientId: client, domain };
474
+ });
475
+ return clientIds;
476
+ }
457
477
  }
458
478
  exports.MLSService = MLSService;
@@ -0,0 +1,4 @@
1
+ import { QualifiedId } from '@wireapp/api-client/lib/user';
2
+ export declare function storeSubconversationGroupId(parentConversation: QualifiedId, subconversation: string, subgroupId: string): void;
3
+ export declare function getGroupId(parentConversation: QualifiedId, subconversation: string): string | undefined;
4
+ //# sourceMappingURL=subconversationGroupIdMapper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subconversationGroupIdMapper.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/MLSService/subconversationGroupIdMapper.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAQzD,wBAAgB,2BAA2B,CACzC,kBAAkB,EAAE,WAAW,EAC/B,eAAe,EAAE,MAAM,EACvB,UAAU,EAAE,MAAM,GACjB,IAAI,CAGN;AAED,wBAAgB,UAAU,CAAC,kBAAkB,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAGvG"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ /*
3
+ * Wire
4
+ * Copyright (C) 2023 Wire Swiss GmbH
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU General Public License as published by
8
+ * the Free Software Foundation, either version 3 of the License, or
9
+ * (at your option) any later version.
10
+ *
11
+ * This program is distributed in the hope that it will be useful,
12
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ * GNU General Public License for more details.
15
+ *
16
+ * You should have received a copy of the GNU General Public License
17
+ * along with this program. If not, see http://www.gnu.org/licenses/.
18
+ *
19
+ */
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ exports.getGroupId = exports.storeSubconversationGroupId = void 0;
22
+ const groupIdMap = new Map();
23
+ function generateSubconversationId(parentConversation, subconversation) {
24
+ return `${parentConversation.id}@${parentConversation.domain}:${subconversation}`;
25
+ }
26
+ function storeSubconversationGroupId(parentConversation, subconversation, subgroupId) {
27
+ const subconversationId = generateSubconversationId(parentConversation, subconversation);
28
+ groupIdMap.set(subconversationId, subgroupId);
29
+ }
30
+ exports.storeSubconversationGroupId = storeSubconversationGroupId;
31
+ function getGroupId(parentConversation, subconversation) {
32
+ const subconversationId = generateSubconversationId(parentConversation, subconversation);
33
+ return groupIdMap.get(subconversationId);
34
+ }
35
+ exports.getGroupId = getGroupId;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=subconversationGroupIdMapper.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subconversationGroupIdMapper.test.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/MLSService/subconversationGroupIdMapper.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ /*
3
+ * Wire
4
+ * Copyright (C) 2018 Wire Swiss GmbH
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU General Public License as published by
8
+ * the Free Software Foundation, either version 3 of the License, or
9
+ * (at your option) any later version.
10
+ *
11
+ * This program is distributed in the hope that it will be useful,
12
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ * GNU General Public License for more details.
15
+ *
16
+ * You should have received a copy of the GNU General Public License
17
+ * along with this program. If not, see http://www.gnu.org/licenses/.
18
+ *
19
+ */
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ const subconversationGroupIdMapper_1 = require("./subconversationGroupIdMapper");
22
+ describe('subconversationGroupIdMapper', () => {
23
+ it('returns empty groupId if conversation is not known', () => {
24
+ const groupId = (0, subconversationGroupIdMapper_1.getGroupId)({ domain: 'example.com', id: '123' }, 'subconversation');
25
+ expect(groupId).toBeUndefined();
26
+ });
27
+ it('returns the stored groupId', () => {
28
+ const conversationId = { domain: 'example.com', id: '123' };
29
+ const subconversation = 'subconversation';
30
+ const groupId = 'groupID';
31
+ (0, subconversationGroupIdMapper_1.storeSubconversationGroupId)(conversationId, subconversation, groupId);
32
+ const result = (0, subconversationGroupIdMapper_1.getGroupId)({ domain: 'example.com', id: '123' }, 'subconversation');
33
+ expect(result).toBe(groupId);
34
+ });
35
+ });
package/package.json CHANGED
@@ -11,14 +11,14 @@
11
11
  "./lib/cryptography/AssetCryptography/crypto.node": "./lib/cryptography/AssetCryptography/crypto.browser.js"
12
12
  },
13
13
  "dependencies": {
14
- "@wireapp/api-client": "^22.13.0",
14
+ "@wireapp/api-client": "^22.14.0",
15
15
  "@wireapp/commons": "^5.0.4",
16
16
  "@wireapp/core-crypto": "0.6.0-rc.3",
17
17
  "@wireapp/promise-queue": "^2.1.1",
18
18
  "@wireapp/protocol-messaging": "1.43.0",
19
19
  "@wireapp/store-engine": "5.0.3",
20
20
  "@wireapp/store-engine-dexie": "^2.0.3",
21
- "axios": "1.2.1",
21
+ "axios": "1.2.2",
22
22
  "bazinga64": "6.0.3",
23
23
  "hash.js": "1.1.7",
24
24
  "http-status-codes": "2.2.0",
@@ -35,7 +35,7 @@
35
35
  "@types/long": "^5.0.0",
36
36
  "@types/rimraf": "^3.0.2",
37
37
  "@types/tough-cookie": "4.0.2",
38
- "commander": "9.4.1",
38
+ "commander": "9.5.0",
39
39
  "cross-env": "7.0.3",
40
40
  "dotenv-defaults": "5.0.2",
41
41
  "fake-indexeddb": "^4.0.0",
@@ -59,6 +59,6 @@
59
59
  "test:coverage": "jest --coverage",
60
60
  "watch": "tsc --watch"
61
61
  },
62
- "version": "38.1.0",
63
- "gitHead": "a4890e9331e2e331d5736f0aef2a36eb7c0b5423"
62
+ "version": "38.3.0",
63
+ "gitHead": "63fb77412045175f7be273e532db50c62853b88d"
64
64
  }