@wireapp/core 46.0.1 → 46.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"E2EIServiceExternal.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/E2EIdentityService/E2EIServiceExternal.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAIzD,OAAO,EAAC,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAC,UAAU,EAAE,qBAAqB,EAAE,YAAY,EAAE,YAAY,EAAiB,MAAM,sBAAsB,CAAC;AAMnH,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAC,YAAY,EAAC,MAAM,yBAAyB,CAAC;AAGrD,OAAO,EAAC,sBAAsB,EAAuB,MAAM,+BAA+B,CAAC;AAC3F,OAAO,EAAC,sBAAsB,EAAC,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAEzC,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,QAAQ,CAAC,GAAG;IACnE,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,WAAW,CAAC;CAC9B,CAAC;AAEF,KAAK,MAAM,GAAG;IACZ,UAAU,EAAE;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,CAAC;CAC9B,CAAC;
|
|
1
|
+
{"version":3,"file":"E2EIServiceExternal.d.ts","sourceRoot":"","sources":["../../../../src/messagingProtocols/mls/E2EIdentityService/E2EIServiceExternal.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAIzD,OAAO,EAAC,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;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C,qBAAqB,CAAC;IAItF,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC;IAI3B,0BAA0B,CACrC,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAE,cAAc,EAAE,CAAC,GAAG,SAAS,CAAC;IAsBxD,kBAAkB,CAC7B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,WAAW,EAAE,GACrB,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAE,cAAc,EAAE,CAAC,GAAG,SAAS,CAAC;IAyDxD,oBAAoB,CAC/B,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,GAC1C,OAAO,CAAC,cAAc,EAAE,CAAC;IAiBf,oBAAoB,IAAI,OAAO,CAAC,OAAO,CAAC;YAKvC,4BAA4B;IAO1C;;;;;OAKG;IACU,UAAU,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAM5D,OAAO,KAAK,WAAW,GAKtB;YAEa,+BAA+B;IAK7C;;;;;;;;;;;;OAYG;YACW,0BAA0B;IA2BxC,OAAO,CAAC,4BAA4B;YAStB,+BAA+B;YAQ/B,uBAAuB;YAKvB,0BAA0B;YAI1B,4BAA4B;YAO5B,WAAW;YAkBX,8BAA8B;CAM7C"}
|
|
@@ -29,33 +29,6 @@ const E2EIStorage_1 = require("./Storage/E2EIStorage");
|
|
|
29
29
|
const fullyQualifiedClientIdUtils_1 = require("../../../util/fullyQualifiedClientIdUtils");
|
|
30
30
|
const LowPrecisionTaskScheduler_1 = require("../../../util/LowPrecisionTaskScheduler");
|
|
31
31
|
const qualifiedIdUtil_1 = require("../../../util/qualifiedIdUtil");
|
|
32
|
-
//TODO: coreCrypto types are wrong here. They return a string (the key of the enum) instead of the enum value
|
|
33
|
-
function fixDeviceStatus(value) {
|
|
34
|
-
const fixedValue = core_crypto_1.DeviceStatus[value];
|
|
35
|
-
if (!fixedValue) {
|
|
36
|
-
throw new Error(`Invalid device status: ${value}`);
|
|
37
|
-
}
|
|
38
|
-
return fixedValue;
|
|
39
|
-
}
|
|
40
|
-
//TODO: coreCrypto types are wrong here. They return a string (the key of the enum) instead of the enum value
|
|
41
|
-
function fixCredentialType(value) {
|
|
42
|
-
if (typeof value === 'number') {
|
|
43
|
-
return value;
|
|
44
|
-
}
|
|
45
|
-
const fixedValue = core_crypto_1.CredentialType[value];
|
|
46
|
-
if (!fixedValue) {
|
|
47
|
-
throw new Error(`Invalid credentialType value: ${value}`);
|
|
48
|
-
}
|
|
49
|
-
return fixedValue;
|
|
50
|
-
}
|
|
51
|
-
// TODO coreCrypto types are wrong here. They return a string (the key of the enum) instead of the enum value
|
|
52
|
-
function fixConversationState(value) {
|
|
53
|
-
const fixedValue = core_crypto_1.E2eiConversationState[value];
|
|
54
|
-
if (!fixedValue) {
|
|
55
|
-
throw new Error(`Invalid conversation status: ${value}`);
|
|
56
|
-
}
|
|
57
|
-
return fixedValue;
|
|
58
|
-
}
|
|
59
32
|
// This export is meant to be accessible from the outside (e.g the Webapp / UI)
|
|
60
33
|
class E2EIServiceExternal extends commons_1.TypedEventEmitter {
|
|
61
34
|
constructor(coreCryptoClient, coreDatabase, recurringTaskScheduler, clientService, mlsService) {
|
|
@@ -77,8 +50,7 @@ class E2EIServiceExternal extends commons_1.TypedEventEmitter {
|
|
|
77
50
|
return this.enrollmentStorage.deletePendingEnrollmentData();
|
|
78
51
|
}
|
|
79
52
|
async getConversationState(conversationId) {
|
|
80
|
-
|
|
81
|
-
return fixConversationState(state);
|
|
53
|
+
return this.coreCryptoClient.e2eiConversationState(conversationId);
|
|
82
54
|
}
|
|
83
55
|
isE2EIEnabled() {
|
|
84
56
|
return this.coreCryptoClient.e2eiIsEnabled(this.mlsService.config.defaultCiphersuite);
|
|
@@ -112,7 +84,7 @@ class E2EIServiceExternal extends commons_1.TypedEventEmitter {
|
|
|
112
84
|
.map(fullyQualifiedId => (0, fullyQualifiedClientIdUtils_1.parseFullQualifiedClientId)(fullyQualifiedId));
|
|
113
85
|
const mappedUserIdentities = new Map();
|
|
114
86
|
for (const userId of userIds) {
|
|
115
|
-
const identities = (userIdentities.get(userId.id) || []).map(identity => (Object.assign(Object.assign({}, identity), {
|
|
87
|
+
const identities = (userIdentities.get(userId.id) || []).map(identity => (Object.assign(Object.assign({}, identity), { deviceId: (0, fullyQualifiedClientIdUtils_1.parseFullQualifiedClientId)(identity.clientId).client, qualifiedUserId: userId })));
|
|
116
88
|
const basicMLSDevices = allUsersMLSDevices
|
|
117
89
|
.filter(({ user }) => user === userId.id)
|
|
118
90
|
// filtering devices that have a valid identity
|
|
@@ -127,7 +99,7 @@ class E2EIServiceExternal extends commons_1.TypedEventEmitter {
|
|
|
127
99
|
async getDevicesIdentities(groupId, userClientsMap) {
|
|
128
100
|
const clientIds = Object.entries(userClientsMap).map(([clientId, userId]) => (0, Helper_1.getE2EIClientId)(clientId, userId.id, userId.domain).asBytes);
|
|
129
101
|
const deviceIdentities = await this.coreCryptoClient.getDeviceIdentities(bazinga64_1.Decoder.fromBase64(groupId).asBytes, clientIds);
|
|
130
|
-
return deviceIdentities.map(identity => (Object.assign(Object.assign({}, identity), { deviceId: (0, fullyQualifiedClientIdUtils_1.parseFullQualifiedClientId)(identity.clientId).client, credentialType:
|
|
102
|
+
return deviceIdentities.map(identity => (Object.assign(Object.assign({}, identity), { deviceId: (0, fullyQualifiedClientIdUtils_1.parseFullQualifiedClientId)(identity.clientId).client, credentialType: identity.credentialType, qualifiedUserId: userClientsMap[identity.clientId] })));
|
|
131
103
|
}
|
|
132
104
|
async isFreshMLSSelfClient() {
|
|
133
105
|
const client = await this.clientService.loadClient();
|
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@wireapp/api-client": "^27.0.0",
|
|
15
15
|
"@wireapp/commons": "^5.2.7",
|
|
16
|
-
"@wireapp/core-crypto": "1.0.0-rc.
|
|
16
|
+
"@wireapp/core-crypto": "1.0.0-rc.57",
|
|
17
17
|
"@wireapp/cryptobox": "12.8.0",
|
|
18
18
|
"@wireapp/priority-queue": "^2.1.5",
|
|
19
19
|
"@wireapp/promise-queue": "^2.3.2",
|
|
@@ -61,6 +61,6 @@
|
|
|
61
61
|
"test:coverage": "jest --coverage",
|
|
62
62
|
"watch": "tsc --watch"
|
|
63
63
|
},
|
|
64
|
-
"version": "46.0.
|
|
65
|
-
"gitHead": "
|
|
64
|
+
"version": "46.0.2",
|
|
65
|
+
"gitHead": "513482497a7453787794de78f36a064908916d95"
|
|
66
66
|
}
|