@wireapp/core 43.8.0 → 43.9.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"E2EIStorage.d.ts","sourceRoot":"","sources":["../../../../../src/messagingProtocols/mls/E2EIdentityService/Storage/E2EIStorage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"E2EIStorage.d.ts","sourceRoot":"","sources":["../../../../../src/messagingProtocols/mls/E2EIdentityService/Storage/E2EIStorage.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAC,QAAQ,EAAkB,WAAW,EAAqB,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAuEzG,eAAO,MAAM,WAAW;;yBA5DK,MAAM;yBAEN,QAAQ;0BADP,SAAS;4BAEP,WAAW;;;2BAwBhB,WAAW;;wBATL,QAAQ;yBAkBP,SAAS;;;;;;;;;;;CA8C1C,CAAC"}
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
*/
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
exports.E2EIStorage = void 0;
|
|
22
|
+
const bazinga64_1 = require("bazinga64");
|
|
22
23
|
const E2EIStorage_schema_1 = require("./E2EIStorage.schema");
|
|
23
24
|
const LocalStorageStore_1 = require("../../../../util/LocalStorageStore");
|
|
24
25
|
const HandleKey = 'Handle';
|
|
@@ -26,10 +27,10 @@ const AuthDataKey = 'AuthData';
|
|
|
26
27
|
const OderDataKey = 'OrderData';
|
|
27
28
|
const InitialDataKey = 'InitialData';
|
|
28
29
|
const storage = (0, LocalStorageStore_1.LocalStorageStore)('E2EIStorage');
|
|
29
|
-
const storeHandle = (handle) => storage.add(HandleKey,
|
|
30
|
-
const storeOrderData = (data) => storage.add(OderDataKey,
|
|
31
|
-
const storeAuthData = (data) => storage.add(AuthDataKey,
|
|
32
|
-
const storeInitialData = (data) => storage.add(InitialDataKey,
|
|
30
|
+
const storeHandle = (handle) => storage.add(HandleKey, bazinga64_1.Encoder.toBase64(handle).asString);
|
|
31
|
+
const storeOrderData = (data) => storage.add(OderDataKey, bazinga64_1.Encoder.toBase64(JSON.stringify(data)).asString);
|
|
32
|
+
const storeAuthData = (data) => storage.add(AuthDataKey, bazinga64_1.Encoder.toBase64(JSON.stringify(data)).asString);
|
|
33
|
+
const storeInitialData = (data) => storage.add(InitialDataKey, bazinga64_1.Encoder.toBase64(JSON.stringify(data)).asString);
|
|
33
34
|
const hasHandle = () => storage.has(HandleKey);
|
|
34
35
|
const hasInitialData = () => storage.has(InitialDataKey);
|
|
35
36
|
const getAndVerifyHandle = () => {
|
|
@@ -37,15 +38,14 @@ const getAndVerifyHandle = () => {
|
|
|
37
38
|
if (!handle) {
|
|
38
39
|
throw new Error('ACME: No handle found');
|
|
39
40
|
}
|
|
40
|
-
|
|
41
|
-
return atob;
|
|
41
|
+
return bazinga64_1.Decoder.fromBase64(handle).asString;
|
|
42
42
|
};
|
|
43
43
|
const getAndVerifyAuthData = () => {
|
|
44
44
|
const data = storage.get(AuthDataKey);
|
|
45
45
|
if (!data) {
|
|
46
46
|
throw new Error('ACME: AuthData not found');
|
|
47
47
|
}
|
|
48
|
-
const decodedData =
|
|
48
|
+
const decodedData = bazinga64_1.Decoder.fromBase64(data).asString;
|
|
49
49
|
return E2EIStorage_schema_1.AuthDataSchema.parse(JSON.parse(decodedData));
|
|
50
50
|
};
|
|
51
51
|
const getInitialData = () => {
|
|
@@ -53,16 +53,16 @@ const getInitialData = () => {
|
|
|
53
53
|
if (!data) {
|
|
54
54
|
throw new Error('ACME: InitialData not found');
|
|
55
55
|
}
|
|
56
|
-
const
|
|
57
|
-
return E2EIStorage_schema_1.InitialDataSchema.parse(JSON.parse(
|
|
56
|
+
const decodedData = bazinga64_1.Decoder.fromBase64(data).asString;
|
|
57
|
+
return E2EIStorage_schema_1.InitialDataSchema.parse(JSON.parse(decodedData));
|
|
58
58
|
};
|
|
59
59
|
const getAndVerifyOrderData = () => {
|
|
60
60
|
const data = storage.get(OderDataKey);
|
|
61
61
|
if (!data) {
|
|
62
62
|
throw new Error('ACME: OrderData not found');
|
|
63
63
|
}
|
|
64
|
-
const
|
|
65
|
-
return JSON.parse(
|
|
64
|
+
const decodedData = bazinga64_1.Decoder.fromBase64(data).asString;
|
|
65
|
+
return JSON.parse(decodedData);
|
|
66
66
|
};
|
|
67
67
|
const removeInitialData = () => {
|
|
68
68
|
storage.remove(InitialDataKey);
|
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@wireapp/api-client": "^26.10.1",
|
|
15
15
|
"@wireapp/commons": "^5.2.4",
|
|
16
|
-
"@wireapp/core-crypto": "1.0.0-rc.
|
|
16
|
+
"@wireapp/core-crypto": "1.0.0-rc.32",
|
|
17
17
|
"@wireapp/cryptobox": "12.8.0",
|
|
18
18
|
"@wireapp/promise-queue": "^2.2.9",
|
|
19
19
|
"@wireapp/protocol-messaging": "1.44.0",
|
|
@@ -61,6 +61,6 @@
|
|
|
61
61
|
"test:coverage": "jest --coverage",
|
|
62
62
|
"watch": "tsc --watch"
|
|
63
63
|
},
|
|
64
|
-
"version": "43.
|
|
65
|
-
"gitHead": "
|
|
64
|
+
"version": "43.9.1",
|
|
65
|
+
"gitHead": "ee87c7e3bebf8304004e852960137548c256267d"
|
|
66
66
|
}
|