@wireapp/core 38.0.1 → 38.1.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.
|
@@ -25,6 +25,17 @@ export declare class MLSService {
|
|
|
25
25
|
getEpoch(groupId: string | Uint8Array): Promise<number>;
|
|
26
26
|
newProposal(proposalType: ProposalType, args: ProposalArgs | AddProposalArgs | RemoveProposalArgs): Promise<import("@wireapp/core-crypto").ProposalBundle>;
|
|
27
27
|
joinByExternalCommit(getGroupInfo: () => Promise<Uint8Array>): Promise<PostMlsMessageResponse | null>;
|
|
28
|
+
/**
|
|
29
|
+
* Will join or register an mls subconversation for conference calls.
|
|
30
|
+
* Will return the secret key derived from the subconversation
|
|
31
|
+
*
|
|
32
|
+
* @param conversationId Id of the parent conversation in which the call should happen
|
|
33
|
+
*/
|
|
34
|
+
joinConferenceSubconversation(conversationId: QualifiedId): Promise<{
|
|
35
|
+
epoch: number;
|
|
36
|
+
secretKey: string;
|
|
37
|
+
keyLength: number;
|
|
38
|
+
}>;
|
|
28
39
|
newExternalProposal(externalProposalType: ExternalProposalType, args: ExternalProposalArgs | ExternalRemoveProposalArgs): Promise<Uint8Array>;
|
|
29
40
|
processWelcomeMessage(welcomeMessage: Uint8Array): Promise<ConversationId>;
|
|
30
41
|
decryptMessage(conversationId: ConversationId, payload: Uint8Array): Promise<DecryptedMessage>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MLSService.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/MLSService/MLSService.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,sBAAsB,
|
|
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,OAA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GAAG,OAAO,CAAC,OAAO,CAAC;IAIpE,2BAA2B,IAAI,OAAO,CAAC,MAAM,CAAC;IAI9C,iBAAiB,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAI9E;;;;OAIG;YACW,gBAAgB;IAgB9B,OAAO,CAAC,sCAAsC;IAI9C;;;OAGG;IACI,uBAAuB,CAAC,OAAO,EAAE,MAAM;IAK9C;;;OAGG;IACI,0BAA0B,CAAC,OAAO,EAAE,MAAM;IAUjD;;;OAGG;IACI,0BAA0B;IASjC;;;OAGG;IACI,8BAA8B;YAQvB,eAAe;IAmB7B;;;;;OAKG;YACW,mBAAmB;YAMnB,oBAAoB;IAOrB,gBAAgB,CAAC,cAAc,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAI/D,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,kBAAkB,EAAE,YAAY,CAAC,GAAG,kBAAkB;IAI5F;;;;;OAKG;IACU,4BAA4B,CAAC,uBAAuB,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC;IAUhG;;;;;;;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;CAgB3C"}
|
|
@@ -33,6 +33,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
33
33
|
};
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
35
|
exports.MLSService = exports.optionalToUint8Array = void 0;
|
|
36
|
+
const conversation_1 = require("@wireapp/api-client/lib/conversation");
|
|
36
37
|
const axios_1 = __importDefault(require("axios"));
|
|
37
38
|
const bazinga64_1 = require("bazinga64");
|
|
38
39
|
const logdown_1 = __importDefault(require("logdown"));
|
|
@@ -170,6 +171,29 @@ class MLSService {
|
|
|
170
171
|
regenerateCommitBundle: async () => (await generateCommit()).commitBundle,
|
|
171
172
|
});
|
|
172
173
|
}
|
|
174
|
+
/**
|
|
175
|
+
* Will join or register an mls subconversation for conference calls.
|
|
176
|
+
* Will return the secret key derived from the subconversation
|
|
177
|
+
*
|
|
178
|
+
* @param conversationId Id of the parent conversation in which the call should happen
|
|
179
|
+
*/
|
|
180
|
+
async joinConferenceSubconversation(conversationId) {
|
|
181
|
+
const subconversation = await this.apiClient.api.conversation.getSubconversation(conversationId, conversation_1.SUBCONVERSATION_ID.CONFERENCE);
|
|
182
|
+
if (subconversation.epoch === 0) {
|
|
183
|
+
await this.registerConversation(subconversation.group_id, []);
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
await this.joinByExternalCommit(() => this.apiClient.api.conversation.getSubconversationGroupInfo(conversationId, conversation_1.SUBCONVERSATION_ID.CONFERENCE));
|
|
187
|
+
}
|
|
188
|
+
const keyLength = 256;
|
|
189
|
+
const groupIdBytes = bazinga64_1.Decoder.fromBase64(subconversation.group_id).asBytes;
|
|
190
|
+
const secretKey = await this.coreCryptoClient.exportSecretKey(groupIdBytes, keyLength);
|
|
191
|
+
return {
|
|
192
|
+
epoch: subconversation.epoch,
|
|
193
|
+
secretKey: new TextDecoder().decode(secretKey),
|
|
194
|
+
keyLength,
|
|
195
|
+
};
|
|
196
|
+
}
|
|
173
197
|
async newExternalProposal(externalProposalType, args) {
|
|
174
198
|
return this.coreCryptoClient.newExternalProposal(externalProposalType, args);
|
|
175
199
|
}
|
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.13.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",
|
|
@@ -59,6 +59,6 @@
|
|
|
59
59
|
"test:coverage": "jest --coverage",
|
|
60
60
|
"watch": "tsc --watch"
|
|
61
61
|
},
|
|
62
|
-
"version": "38.0
|
|
63
|
-
"gitHead": "
|
|
62
|
+
"version": "38.1.0",
|
|
63
|
+
"gitHead": "a4890e9331e2e331d5736f0aef2a36eb7c0b5423"
|
|
64
64
|
}
|