@webex/plugin-meetings 3.13.0-next.16 → 3.13.0-next.17
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/dist/aiEnableRequest/index.js +1 -1
- package/dist/breakouts/breakout.js +1 -1
- package/dist/breakouts/index.js +1 -1
- package/dist/common/events/typed-events-scope.js +135 -0
- package/dist/common/events/typed-events-scope.js.map +1 -0
- package/dist/common/types.js +7 -0
- package/dist/common/types.js.map +1 -0
- package/dist/config.js +1 -1
- package/dist/constants.js +5 -0
- package/dist/constants.js.map +1 -1
- package/dist/e2ee/E2eeController.js +581 -0
- package/dist/e2ee/E2eeController.js.map +1 -0
- package/dist/e2ee/E2eeManager.js +50 -31
- package/dist/e2ee/E2eeManager.js.map +1 -1
- package/dist/e2ee/E2eeSignaling.js +18 -21
- package/dist/e2ee/E2eeSignaling.js.map +1 -1
- package/dist/e2ee/MediaEncryptionService.js +2 -5
- package/dist/e2ee/MediaEncryptionService.js.map +1 -1
- package/dist/e2ee/constants.js +28 -0
- package/dist/e2ee/constants.js.map +1 -0
- package/dist/e2ee/mls.js +85 -67
- package/dist/e2ee/mls.js.map +1 -1
- package/dist/e2ee/types.js +52 -13
- package/dist/e2ee/types.js.map +1 -1
- package/dist/e2ee/wasm.d.js.map +1 -1
- package/dist/hashTree/hashTreeParser.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/interpretation/index.js +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/meeting/index.js +394 -249
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/request.js +69 -58
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/util.js +4 -2
- package/dist/meeting/util.js.map +1 -1
- package/dist/meetings/index.js +87 -61
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/util.js +10 -0
- package/dist/meetings/util.js.map +1 -1
- package/dist/metrics/constants.js +2 -1
- package/dist/metrics/constants.js.map +1 -1
- package/dist/types/common/events/typed-events-scope.d.ts +73 -0
- package/dist/types/common/types.d.ts +9 -0
- package/dist/types/constants.d.ts +5 -0
- package/dist/types/e2ee/E2eeController.d.ts +130 -0
- package/dist/types/e2ee/E2eeManager.d.ts +26 -6
- package/dist/types/e2ee/E2eeSignaling.d.ts +1 -7
- package/dist/types/e2ee/MediaEncryptionService.d.ts +1 -3
- package/dist/types/e2ee/constants.d.ts +12 -0
- package/dist/types/e2ee/mls.d.ts +16 -10
- package/dist/types/e2ee/types.d.ts +92 -35
- package/dist/types/hashTree/hashTreeParser.d.ts +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/meeting/index.d.ts +34 -0
- package/dist/types/meeting/util.d.ts +1 -1
- package/dist/types/metrics/constants.d.ts +1 -0
- package/dist/webinar/index.js +1 -1
- package/package.json +21 -21
- package/src/common/events/typed-events-scope.ts +110 -0
- package/src/common/types.ts +10 -0
- package/src/constants.ts +6 -0
- package/src/e2ee/DESIGN.md +363 -0
- package/src/e2ee/E2eeController.ts +487 -0
- package/src/e2ee/E2eeManager.ts +48 -27
- package/src/e2ee/E2eeSignaling.ts +13 -28
- package/src/e2ee/MediaEncryptionService.ts +2 -4
- package/src/e2ee/constants.ts +34 -0
- package/src/e2ee/mls.ts +62 -32
- package/src/e2ee/types.ts +99 -34
- package/src/e2ee/wasm.d.ts +18 -14
- package/src/hashTree/hashTreeParser.ts +1 -1
- package/src/index.ts +1 -0
- package/src/meeting/index.ts +155 -0
- package/src/meeting/request.ts +16 -0
- package/src/meeting/util.ts +2 -1
- package/src/meetings/index.ts +30 -5
- package/src/meetings/util.ts +8 -0
- package/src/metrics/constants.ts +1 -0
- package/test/unit/spec/common/events/typed-events-scope.ts +88 -0
- package/test/unit/spec/e2ee/E2eeController.ts +662 -0
- package/test/unit/spec/e2ee/E2eeManager.ts +53 -29
- package/test/unit/spec/e2ee/E2eeSignaling.ts +19 -10
- package/test/unit/spec/e2ee/mls.ts +84 -32
- package/test/unit/spec/meeting/index.js +662 -0
- package/test/unit/spec/meeting/request.js +35 -0
- package/test/unit/spec/meeting/utils.js +4 -0
- package/test/unit/spec/meetings/index.js +36 -1
- package/test/unit/spec/meetings/utils.js +15 -0
- package/test/utils/webex-config.js +1 -0
package/dist/e2ee/mls.js
CHANGED
|
@@ -13,6 +13,7 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
13
13
|
exports.default = void 0;
|
|
14
14
|
var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
|
|
15
15
|
var _map = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/map"));
|
|
16
|
+
var _set = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/set"));
|
|
16
17
|
var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
|
|
17
18
|
var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
|
|
18
19
|
var _isInteger = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/number/is-integer"));
|
|
@@ -26,10 +27,6 @@ function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymb
|
|
|
26
27
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; } /*!
|
|
27
28
|
* Copyright (c) 2015-2026 Cisco Systems, Inc. See LICENSE file.
|
|
28
29
|
*/
|
|
29
|
-
var DEFAULT_JOIN_TIMEOUT = 180000;
|
|
30
|
-
var DEFAULT_COALESCE_WINDOW = 500;
|
|
31
|
-
var DEFAULT_DEVICE_TYPE = 'WEB';
|
|
32
|
-
|
|
33
30
|
// WASM log levels, indexed by the numeric level the engine emits (see LogLevel in libe2ee).
|
|
34
31
|
var WASM_LOG_LEVELS = ['', 'FATAL', 'ERROR', 'WARN', 'INFO', 'DEBUG'];
|
|
35
32
|
|
|
@@ -42,21 +39,22 @@ var WASM_LOG_LEVELS = ['', 'FATAL', 'ERROR', 'WARN', 'INFO', 'DEBUG'];
|
|
|
42
39
|
var MLS = exports.default = /*#__PURE__*/function () {
|
|
43
40
|
/**
|
|
44
41
|
* @param {Object} deps
|
|
42
|
+
* @param {ModuleInstance} deps.module - The loaded WASM module used to instantiate the engine.
|
|
45
43
|
* @param {IMlsHttpClient} deps.httpClient - Transport for the engine's protocol requests.
|
|
46
|
-
* @param {Function} deps.loadModule - Loads the WASM module instance; supplied by the integration layer.
|
|
47
44
|
*/
|
|
48
45
|
function MLS(_ref) {
|
|
49
46
|
var httpClient = _ref.httpClient,
|
|
50
|
-
|
|
47
|
+
module = _ref.module;
|
|
51
48
|
(0, _classCallCheck2.default)(this, MLS);
|
|
52
|
-
(0, _defineProperty2.default)(this, "
|
|
49
|
+
(0, _defineProperty2.default)(this, "module", void 0);
|
|
53
50
|
(0, _defineProperty2.default)(this, "httpClient", void 0);
|
|
54
51
|
(0, _defineProperty2.default)(this, "emitter", new _events.default());
|
|
55
52
|
(0, _defineProperty2.default)(this, "transactions", new _map.default());
|
|
56
53
|
(0, _defineProperty2.default)(this, "e2ee", null);
|
|
54
|
+
(0, _defineProperty2.default)(this, "waitTimeouts", new _set.default());
|
|
57
55
|
(0, _defineProperty2.default)(this, "lastSecurityCode", '');
|
|
58
56
|
this.httpClient = httpClient;
|
|
59
|
-
this.
|
|
57
|
+
this.module = module;
|
|
60
58
|
}
|
|
61
59
|
|
|
62
60
|
/**
|
|
@@ -96,60 +94,43 @@ var MLS = exports.default = /*#__PURE__*/function () {
|
|
|
96
94
|
}
|
|
97
95
|
|
|
98
96
|
/**
|
|
99
|
-
*
|
|
100
|
-
*
|
|
97
|
+
* Instantiates the engine, wires its callbacks, and applies credentials, trust anchors and
|
|
98
|
+
* timeouts. Must be called before {@link join}.
|
|
101
99
|
* @param {MLSConfig} config
|
|
102
|
-
* @returns {
|
|
100
|
+
* @returns {void}
|
|
103
101
|
*/
|
|
104
102
|
}, {
|
|
105
103
|
key: "initialize",
|
|
106
|
-
value:
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
return
|
|
111
|
-
while (1) switch (_context.prev = _context.next) {
|
|
112
|
-
case 0:
|
|
113
|
-
_loggerProxy.default.logger.info('e2ee: MLS --> initialize: loading WASM and instantiating engine');
|
|
114
|
-
_context.next = 1;
|
|
115
|
-
return this.loadModule();
|
|
116
|
-
case 1:
|
|
117
|
-
module = _context.sent;
|
|
118
|
-
if (!this.e2ee) {
|
|
119
|
-
_context.next = 2;
|
|
120
|
-
break;
|
|
121
|
-
}
|
|
122
|
-
_loggerProxy.default.logger.info('e2ee: MLS --> initialize: already initialized');
|
|
123
|
-
return _context.abrupt("return");
|
|
124
|
-
case 2:
|
|
125
|
-
this.e2ee = new module.WebE2EE();
|
|
126
|
-
this.setupCallbacks();
|
|
127
|
-
this.e2ee.initialize(config.participantId, config.deviceUrl, config.deviceType || DEFAULT_DEVICE_TYPE, config.correlationId, config.displayName, config.serviceUrl);
|
|
128
|
-
if (config.credentials) {
|
|
129
|
-
_config$credentials = config.credentials, privateKey = _config$credentials.privateKey, certChain = _config$credentials.certChain;
|
|
130
|
-
this.e2ee.addX509Credential(privateKey, certChain);
|
|
131
|
-
}
|
|
132
|
-
if (config.trustAnchors) {
|
|
133
|
-
this.e2ee.setTrustAnchors(config.trustAnchors.webexCaRoots || '', config.trustAnchors.domainNameRoots || '', config.trustAnchors.userIdentityRoots || '', config.trustAnchors.domainNameRootsP7b || new Uint8Array());
|
|
134
|
-
}
|
|
135
|
-
this.e2ee.setJoinTimeout((_config$joinTimeout = config.joinTimeout) !== null && _config$joinTimeout !== void 0 ? _config$joinTimeout : DEFAULT_JOIN_TIMEOUT);
|
|
136
|
-
this.e2ee.setCoalesceWindow((_config$coalesceWindo = config.coalesceWindow) !== null && _config$coalesceWindo !== void 0 ? _config$coalesceWindo : DEFAULT_COALESCE_WINDOW);
|
|
137
|
-
_loggerProxy.default.logger.info('e2ee: MLS --> initialize: engine initialized');
|
|
138
|
-
case 3:
|
|
139
|
-
case "end":
|
|
140
|
-
return _context.stop();
|
|
141
|
-
}
|
|
142
|
-
}, _callee, this);
|
|
143
|
-
}));
|
|
144
|
-
function initialize(_x) {
|
|
145
|
-
return _initialize.apply(this, arguments);
|
|
104
|
+
value: function initialize(config) {
|
|
105
|
+
_loggerProxy.default.logger.info('e2ee: MLS --> initialize: instantiating engine');
|
|
106
|
+
if (this.e2ee) {
|
|
107
|
+
_loggerProxy.default.logger.info('e2ee: MLS --> initialize: already initialized');
|
|
108
|
+
return;
|
|
146
109
|
}
|
|
147
|
-
|
|
148
|
-
|
|
110
|
+
this.e2ee = new this.module.WebE2EE();
|
|
111
|
+
this.setupCallbacks();
|
|
112
|
+
this.e2ee.initialize(config.participantId, config.deviceUrl, config.deviceType, config.correlationId, config.displayName, config.serviceUrl);
|
|
113
|
+
if (config.credentials) {
|
|
114
|
+
var _config$credentials = config.credentials,
|
|
115
|
+
privateKey = _config$credentials.privateKey,
|
|
116
|
+
certChain = _config$credentials.certChain;
|
|
117
|
+
this.e2ee.addX509Credential(privateKey, certChain);
|
|
118
|
+
}
|
|
119
|
+
if (config.trustAnchors) {
|
|
120
|
+
this.e2ee.setTrustAnchors(config.trustAnchors.webexCaRoots || '', config.trustAnchors.domainNameRoots || '', config.trustAnchors.userIdentityRoots || '', config.trustAnchors.domainNameRootsP7b || new Uint8Array());
|
|
121
|
+
}
|
|
122
|
+
if (config.joinTimeout !== undefined) {
|
|
123
|
+
this.e2ee.setJoinTimeout(config.joinTimeout);
|
|
124
|
+
}
|
|
125
|
+
if (config.coalesceWindow !== undefined) {
|
|
126
|
+
this.e2ee.setCoalesceWindow(config.coalesceWindow);
|
|
127
|
+
}
|
|
128
|
+
_loggerProxy.default.logger.info('e2ee: MLS --> initialize: engine initialized');
|
|
129
|
+
}
|
|
130
|
+
|
|
149
131
|
/**
|
|
150
132
|
* @returns {void}
|
|
151
133
|
*/
|
|
152
|
-
)
|
|
153
134
|
}, {
|
|
154
135
|
key: "setupCallbacks",
|
|
155
136
|
value: function setupCallbacks() {
|
|
@@ -224,10 +205,12 @@ var MLS = exports.default = /*#__PURE__*/function () {
|
|
|
224
205
|
});
|
|
225
206
|
});
|
|
226
207
|
e2ee.setOnWait(function (milliseconds, handlerId) {
|
|
227
|
-
setTimeout(function () {
|
|
208
|
+
var timeout = setTimeout(function () {
|
|
228
209
|
var _this$e2ee;
|
|
210
|
+
_this.waitTimeouts.delete(timeout);
|
|
229
211
|
(_this$e2ee = _this.e2ee) === null || _this$e2ee === void 0 ? void 0 : _this$e2ee.completeWait(handlerId);
|
|
230
212
|
}, milliseconds);
|
|
213
|
+
_this.waitTimeouts.add(timeout);
|
|
231
214
|
});
|
|
232
215
|
e2ee.setOnGotKey(function (epoch) {
|
|
233
216
|
_this.emitEvent('newKey', {
|
|
@@ -235,7 +218,7 @@ var MLS = exports.default = /*#__PURE__*/function () {
|
|
|
235
218
|
baseKey: new Uint8Array(epoch.base_key),
|
|
236
219
|
index: epoch.index,
|
|
237
220
|
indexBits: epoch.index_bits,
|
|
238
|
-
canEncrypt: false
|
|
221
|
+
canEncrypt: false // the key can only be used for encryption after onUseKey is called
|
|
239
222
|
});
|
|
240
223
|
});
|
|
241
224
|
e2ee.setOnUseKey(function (epoch) {
|
|
@@ -306,24 +289,24 @@ var MLS = exports.default = /*#__PURE__*/function () {
|
|
|
306
289
|
}, {
|
|
307
290
|
key: "sendHttpRequest",
|
|
308
291
|
value: (function () {
|
|
309
|
-
var _sendHttpRequest = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
292
|
+
var _sendHttpRequest = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(url, body) {
|
|
310
293
|
var requestBody, response;
|
|
311
|
-
return _regenerator.default.wrap(function (
|
|
312
|
-
while (1) switch (
|
|
294
|
+
return _regenerator.default.wrap(function (_context) {
|
|
295
|
+
while (1) switch (_context.prev = _context.next) {
|
|
313
296
|
case 0:
|
|
314
297
|
requestBody = MLS.decodeRequestBody(url, body);
|
|
315
|
-
|
|
298
|
+
_context.next = 1;
|
|
316
299
|
return this.httpClient.request(url, requestBody);
|
|
317
300
|
case 1:
|
|
318
|
-
response =
|
|
319
|
-
return
|
|
301
|
+
response = _context.sent;
|
|
302
|
+
return _context.abrupt("return", MLS.encodeResponseBody(url, response));
|
|
320
303
|
case 2:
|
|
321
304
|
case "end":
|
|
322
|
-
return
|
|
305
|
+
return _context.stop();
|
|
323
306
|
}
|
|
324
|
-
},
|
|
307
|
+
}, _callee, this);
|
|
325
308
|
}));
|
|
326
|
-
function sendHttpRequest(
|
|
309
|
+
function sendHttpRequest(_x, _x2) {
|
|
327
310
|
return _sendHttpRequest.apply(this, arguments);
|
|
328
311
|
}
|
|
329
312
|
return sendHttpRequest;
|
|
@@ -343,7 +326,7 @@ var MLS = exports.default = /*#__PURE__*/function () {
|
|
|
343
326
|
* `e2ee_negotiation_failure` out of this call when it can't recover from the service's error code
|
|
344
327
|
* or fails to process a successful response; this surfaces in JS as an opaque value with no
|
|
345
328
|
* message. That is unrecoverable for the in-flight operation, so it is reported as
|
|
346
|
-
* `
|
|
329
|
+
* `mediaEncryptionServiceFailure` instead of escaping as an unhandled rejection.
|
|
347
330
|
* @param {number} handlerId
|
|
348
331
|
* @param {boolean} success
|
|
349
332
|
* @param {Uint8Array} body
|
|
@@ -357,7 +340,7 @@ var MLS = exports.default = /*#__PURE__*/function () {
|
|
|
357
340
|
(_this$e2ee2 = this.e2ee) === null || _this$e2ee2 === void 0 ? void 0 : _this$e2ee2.completeHttpRequest(handlerId, success, body, errorCode, message);
|
|
358
341
|
} catch (error) {
|
|
359
342
|
_loggerProxy.default.logger.error("e2ee: MLS --> engine threw while completing HTTP request (success=".concat(success, ", errorCode=").concat(errorCode, "): ").concat(error));
|
|
360
|
-
this.emitEvent('
|
|
343
|
+
this.emitEvent('mediaEncryptionServiceFailure', {
|
|
361
344
|
errorCode: errorCode,
|
|
362
345
|
message: success ? 'Engine failed to process HTTP response' : message
|
|
363
346
|
});
|
|
@@ -407,6 +390,41 @@ var MLS = exports.default = /*#__PURE__*/function () {
|
|
|
407
390
|
this.assertInitialized().leave();
|
|
408
391
|
}
|
|
409
392
|
|
|
393
|
+
/**
|
|
394
|
+
* Detaches engine callbacks and releases the WASM engine and wrapper resources.
|
|
395
|
+
* @returns {void}
|
|
396
|
+
*/
|
|
397
|
+
}, {
|
|
398
|
+
key: "cleanUp",
|
|
399
|
+
value: function cleanUp() {
|
|
400
|
+
this.waitTimeouts.forEach(function (timeout) {
|
|
401
|
+
return clearTimeout(timeout);
|
|
402
|
+
});
|
|
403
|
+
this.waitTimeouts.clear();
|
|
404
|
+
this.transactions.clear();
|
|
405
|
+
this.lastSecurityCode = '';
|
|
406
|
+
var e2ee = this.e2ee;
|
|
407
|
+
this.e2ee = null;
|
|
408
|
+
if (e2ee) {
|
|
409
|
+
e2ee.setOnNewTransaction(null);
|
|
410
|
+
e2ee.setOnCompleteTransaction(null);
|
|
411
|
+
e2ee.setOnHttpRequest(null);
|
|
412
|
+
e2ee.setOnWait(null);
|
|
413
|
+
e2ee.setOnGotKey(null);
|
|
414
|
+
e2ee.setOnUseKey(null);
|
|
415
|
+
e2ee.setOnLeader(null);
|
|
416
|
+
e2ee.setOnPurgeBefore(null);
|
|
417
|
+
e2ee.setOnEvicted(null);
|
|
418
|
+
e2ee.setOnAddRoster(null);
|
|
419
|
+
e2ee.setOnRemoveRoster(null);
|
|
420
|
+
e2ee.setOnE2eeVersion(null);
|
|
421
|
+
e2ee.setOnMissingCommit(null);
|
|
422
|
+
e2ee.setOnLog(null);
|
|
423
|
+
e2ee.delete();
|
|
424
|
+
}
|
|
425
|
+
this.emitter.removeAllListeners();
|
|
426
|
+
}
|
|
427
|
+
|
|
410
428
|
/**
|
|
411
429
|
* Forwards an incoming MLS protocol event (from the signaling channel) to the engine.
|
|
412
430
|
* @param {Uint8Array} eventData
|
package/dist/e2ee/mls.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_events","_interopRequireDefault","require","_loggerProxy","ownKeys","e","r","t","_Object$keys","_Object$getOwnPropertySymbols","o","filter","_Object$getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","Object","forEach","_defineProperty2","default","_Object$getOwnPropertyDescriptors","_Object$defineProperties","_Object$defineProperty","DEFAULT_JOIN_TIMEOUT","DEFAULT_COALESCE_WINDOW","DEFAULT_DEVICE_TYPE","WASM_LOG_LEVELS","MLS","exports","_ref","httpClient","loadModule","_classCallCheck2","EventEmitter","_map","_createClass2","key","value","on","event","listener","emitter","off","emitEvent","payload","LoggerProxy","logger","info","concat","emit","_initialize","_asyncToGenerator2","_regenerator","mark","_callee","config","_config$joinTimeout","_config$coalesceWindo","module","_config$credentials","privateKey","certChain","wrap","_context","prev","next","sent","e2ee","abrupt","WebE2EE","setupCallbacks","initialize","participantId","deviceUrl","deviceType","correlationId","displayName","serviceUrl","credentials","addX509Credential","trustAnchors","setTrustAnchors","webexCaRoots","domainNameRoots","userIdentityRoots","domainNameRootsP7b","Uint8Array","setJoinTimeout","joinTimeout","setCoalesceWindow","coalesceWindow","stop","_x","_this","setOnNewTransaction","_ref2","id","type","transactions","set","setOnCompleteTransaction","result","transactionType","get","warn","delete","status","lastSecurityCode","sec_code","epoch","securityCode","sframe","cipherSuite","sframe_cipher_suite","epochBits","sframe_epoch_bits","baseKey","base_key","index","indexBits","index_bits","canEncrypt","reason","error","setOnHttpRequest","request","url","handlerId","body","_promise","resolve","then","sendHttpRequest","responseBytes","completeHttpRequest","catch","errorCode","getMesErrorCode","message","setOnWait","milliseconds","setTimeout","_this$e2ee","completeWait","setOnGotKey","setOnUseKey","emitSecurityCodeIfChanged","setOnPurgeBefore","setOnLeader","isLeader","setOnAddRoster","added","map","toRosterMember","setOnRemoveRoster","removed","urls","setOnEvicted","setOnE2eeVersion","version","setOnMissingCommit","mlsEpoch","useKeyEpoch","setOnLog","level","_WASM_LOG_LEVELS$leve","label","debug","_sendHttpRequest","_callee2","requestBody","response","_context2","decodeRequestBody","encodeResponseBody","_x2","_x3","success","_this$e2ee2","code","getSecurityCode","join","assertInitialized","leave","clear","handleEvent","eventData","source","handle","setLlmConnectedBeforeJoin","connected","llmConnected","getRoster","roster","Error","JSON","parse","TextDecoder","decode","TextEncoder","encode","_stringify","_error$body","_isInteger","member","display_name","device_type","validationResult","validation_result","x509","identityResults","certificateResult","certificateChain","member_certs","certificate","primaryName","primary_name","commonName","common_name","organizationName","organization_name","emailAddresses","email_addresses","domainNames","domain_names","notBefore","not_before","notAfter","not_after","signatureAlgorithm","signature_algorithm","publicKeyAlgorithm","public_key_algorithm","identityType","identity_type","der","failed_cert_index","undefined","failedCertIndex"],"sources":["mls.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-2026 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport EventEmitter from 'events';\n\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport type {\n E2eeKey,\n E2eeRosterMember,\n E2eeSignalingSource,\n IMlsHttpClient,\n MLSConfig,\n SframeParams,\n} from './types';\nimport type {\n EpochInfo,\n HTTPRequest,\n ModuleInstance,\n RosterMember,\n Transaction,\n TransactionResult,\n WebE2EEInstance,\n} from './wasm';\n\nconst DEFAULT_JOIN_TIMEOUT = 180_000;\nconst DEFAULT_COALESCE_WINDOW = 500;\nconst DEFAULT_DEVICE_TYPE = 'WEB';\n\n// WASM log levels, indexed by the numeric level the engine emits (see LogLevel in libe2ee).\nconst WASM_LOG_LEVELS = ['', 'FATAL', 'ERROR', 'WARN', 'INFO', 'DEBUG'];\n\n/** Payloads for each event emitted by {@link MLS}. */\nexport interface MLSEventMap {\n joinSuccess: {epoch: number; securityCode: string; sframe: SframeParams; key: E2eeKey};\n joinFailure: {reason: string};\n mediaEncryptionRequestFailure: {errorCode: number; message: string};\n newKey: E2eeKey;\n useKey: {epoch: number};\n purgeKeys: {epoch: number};\n rosterAdded: E2eeRosterMember[];\n rosterRemoved: {urls: string[]};\n leaderChanged: {isLeader: boolean};\n evicted: void;\n versionNegotiated: {version: number};\n securityCodeChanged: {code: string};\n}\n\nexport type MLSEvent = keyof MLSEventMap;\n\n/**\n * Pure MLS protocol engine wrapping the WebE2EE WASM module. It has no webex/HTTP/LLM\n * dependencies: all I/O flows through the injected {@link IMlsHttpClient}, and all outputs are\n * emitted as typed events. This keeps it unit-testable in isolation.\n */\nexport default class MLS {\n private readonly loadModule: () => Promise<ModuleInstance>;\n\n private readonly httpClient: IMlsHttpClient;\n\n private readonly emitter = new EventEmitter();\n\n private readonly transactions = new Map<string, Transaction['type']>();\n\n private e2ee: WebE2EEInstance | null = null;\n\n private lastSecurityCode = '';\n\n /**\n * @param {Object} deps\n * @param {IMlsHttpClient} deps.httpClient - Transport for the engine's protocol requests.\n * @param {Function} deps.loadModule - Loads the WASM module instance; supplied by the integration layer.\n */\n constructor({\n httpClient,\n loadModule,\n }: {\n httpClient: IMlsHttpClient;\n loadModule: () => Promise<ModuleInstance>;\n }) {\n this.httpClient = httpClient;\n this.loadModule = loadModule;\n }\n\n /**\n * Subscribe to an engine event.\n * @param {MLSEvent} event\n * @param {Function} listener\n * @returns {void}\n */\n on<K extends MLSEvent>(event: K, listener: (payload: MLSEventMap[K]) => void): void {\n this.emitter.on(event, listener as (payload: unknown) => void);\n }\n\n /**\n * Unsubscribe from an engine event.\n * @param {MLSEvent} event\n * @param {Function} listener\n * @returns {void}\n */\n off<K extends MLSEvent>(event: K, listener: (payload: MLSEventMap[K]) => void): void {\n this.emitter.off(event, listener as (payload: unknown) => void);\n }\n\n /**\n * @param {MLSEvent} event\n * @param {*} [payload]\n * @returns {void}\n */\n private emitEvent<K extends MLSEvent>(event: K, payload?: MLSEventMap[K]): void {\n LoggerProxy.logger.info(`e2ee: MLS --> emitting event: ${event}`);\n this.emitter.emit(event, payload);\n }\n\n /**\n * Loads the WASM module, instantiates the engine, wires its callbacks, and applies credentials,\n * trust anchors and timeouts. Must be called before {@link join}.\n * @param {MLSConfig} config\n * @returns {Promise<void>}\n */\n async initialize(config: MLSConfig): Promise<void> {\n LoggerProxy.logger.info('e2ee: MLS --> initialize: loading WASM and instantiating engine');\n const module = await this.loadModule();\n\n // When loadModule uses WasmLoader.get(), repeated calls share the in-flight promise or return\n // the cached module, so this check can stay after loading.\n if (this.e2ee) {\n LoggerProxy.logger.info('e2ee: MLS --> initialize: already initialized');\n\n return;\n }\n\n this.e2ee = new module.WebE2EE();\n this.setupCallbacks();\n\n this.e2ee.initialize(\n config.participantId,\n config.deviceUrl,\n config.deviceType || DEFAULT_DEVICE_TYPE,\n config.correlationId,\n config.displayName,\n config.serviceUrl\n );\n\n if (config.credentials) {\n const {privateKey, certChain} = config.credentials;\n\n this.e2ee.addX509Credential(privateKey, certChain);\n }\n\n if (config.trustAnchors) {\n this.e2ee.setTrustAnchors(\n config.trustAnchors.webexCaRoots || '',\n config.trustAnchors.domainNameRoots || '',\n config.trustAnchors.userIdentityRoots || '',\n config.trustAnchors.domainNameRootsP7b || new Uint8Array()\n );\n }\n\n this.e2ee.setJoinTimeout(config.joinTimeout ?? DEFAULT_JOIN_TIMEOUT);\n this.e2ee.setCoalesceWindow(config.coalesceWindow ?? DEFAULT_COALESCE_WINDOW);\n\n LoggerProxy.logger.info('e2ee: MLS --> initialize: engine initialized');\n }\n\n /**\n * @returns {void}\n */\n private setupCallbacks(): void {\n const {e2ee} = this;\n\n if (!e2ee) {\n return;\n }\n\n e2ee.setOnNewTransaction(({id, type}: Transaction) => {\n this.transactions.set(id, type);\n });\n\n e2ee.setOnCompleteTransaction((id, result: TransactionResult) => {\n const transactionType = this.transactions.get(id);\n\n if (!transactionType) {\n LoggerProxy.logger.warn(`e2ee: MLS --> completion for unknown transaction (id=${id})`);\n\n return;\n }\n\n this.transactions.delete(id);\n\n if (result.status === 'join_success') {\n if (transactionType !== 'join') {\n LoggerProxy.logger.warn(\n `e2ee: MLS --> join success for non-join transaction (id=${id}, type=${transactionType})`\n );\n\n return;\n }\n\n this.lastSecurityCode = result.sec_code;\n this.emitEvent('joinSuccess', {\n epoch: result.epoch,\n securityCode: result.sec_code,\n sframe: {\n cipherSuite: result.sframe_cipher_suite,\n epochBits: result.sframe_epoch_bits,\n },\n key: {\n epoch: result.epoch,\n baseKey: new Uint8Array(result.base_key),\n index: result.index,\n indexBits: result.index_bits,\n canEncrypt: false,\n },\n });\n } else if (result.status === 'update_success') {\n if (transactionType !== 'update') {\n LoggerProxy.logger.warn(\n `e2ee: MLS --> update success for non-update transaction (id=${id}, type=${transactionType})`\n );\n }\n } else if (result.status === 'failure') {\n if (transactionType === 'join') {\n this.emitEvent('joinFailure', {reason: result.reason});\n } else {\n LoggerProxy.logger.error(\n `e2ee: MLS --> update transaction failed (id=${id}, reason=${result.reason})`\n );\n }\n }\n });\n\n e2ee.setOnHttpRequest((request: HTTPRequest) => {\n const {url, handlerId} = request;\n // The body is a view into WASM memory that is only valid during this callback, so copy it now.\n const body = new Uint8Array(request.body);\n\n // Complete asynchronously so the engine is never re-entered from inside its own request call.\n Promise.resolve()\n .then(() => this.sendHttpRequest(url, body))\n .then((responseBytes) => {\n this.completeHttpRequest(handlerId, true, responseBytes, 0, '');\n })\n .catch((error) => {\n const errorCode = MLS.getMesErrorCode(error);\n const message = error?.message || 'Request failed';\n\n LoggerProxy.logger.warn(\n `e2ee: MLS --> HTTP request failed (url=${url}, errorCode=${errorCode}): ${message}`\n );\n this.completeHttpRequest(handlerId, false, new Uint8Array(0), errorCode, message);\n });\n });\n\n e2ee.setOnWait((milliseconds, handlerId) => {\n setTimeout(() => {\n this.e2ee?.completeWait(handlerId);\n }, milliseconds);\n });\n\n e2ee.setOnGotKey((epoch: EpochInfo) => {\n this.emitEvent('newKey', {\n epoch: epoch.epoch,\n baseKey: new Uint8Array(epoch.base_key),\n index: epoch.index,\n indexBits: epoch.index_bits,\n canEncrypt: false,\n });\n });\n\n e2ee.setOnUseKey((epoch: number) => {\n this.emitEvent('useKey', {epoch});\n this.emitSecurityCodeIfChanged();\n });\n\n e2ee.setOnPurgeBefore((epoch: number) => {\n this.emitEvent('purgeKeys', {epoch});\n });\n\n e2ee.setOnLeader(() => {\n this.emitEvent('leaderChanged', {isLeader: true});\n });\n\n e2ee.setOnAddRoster((added: RosterMember[]) => {\n this.emitEvent('rosterAdded', added.map(MLS.toRosterMember));\n this.emitSecurityCodeIfChanged();\n });\n\n e2ee.setOnRemoveRoster((removed: string[]) => {\n this.emitEvent('rosterRemoved', {urls: removed});\n this.emitSecurityCodeIfChanged();\n });\n\n e2ee.setOnEvicted(() => {\n this.emitEvent('evicted');\n });\n\n e2ee.setOnE2eeVersion((version: number) => {\n this.emitEvent('versionNegotiated', {version});\n });\n\n e2ee.setOnMissingCommit((mlsEpoch, useKeyEpoch) => {\n LoggerProxy.logger.warn(\n `e2ee: MLS --> missing commit (mlsEpoch=${mlsEpoch}, useKeyEpoch=${useKeyEpoch})`\n );\n });\n\n e2ee.setOnLog((level: number, message: string) => {\n const label = WASM_LOG_LEVELS[level] ?? '';\n\n switch (level) {\n case 1:\n case 2:\n LoggerProxy.logger.error(`e2ee: [E2EE ${label}] ${message}`);\n break;\n case 3:\n LoggerProxy.logger.warn(`e2ee: [E2EE ${label}] ${message}`);\n break;\n case 5:\n LoggerProxy.logger.debug(`e2ee: [E2EE ${label}] ${message}`);\n break;\n default:\n LoggerProxy.logger.info(`e2ee: [E2EE ${label}] ${message}`);\n }\n });\n }\n\n /**\n * Sends an engine HTTP request through the injected {@link IMlsHttpClient}, converting between\n * the engine's JSON bytes and the client's objects. Conversion failures reject so the engine's\n * request is completed as failed.\n * @param {string} url - The absolute request URL provided by the engine.\n * @param {Uint8Array} body - JSON request payload as bytes (owned copy, not a WASM memory view).\n * @returns {Promise<Uint8Array>} JSON response payload as bytes.\n */\n private async sendHttpRequest(url: string, body: Uint8Array): Promise<Uint8Array> {\n const requestBody = MLS.decodeRequestBody(url, body);\n const response = await this.httpClient.request(url, requestBody);\n\n return MLS.encodeResponseBody(url, response);\n }\n\n /**\n * @param {string} url - Request URL, used only for logging.\n * @param {Uint8Array} body - JSON request payload as bytes.\n * @returns {unknown} the parsed request body.\n * @throws {Error} when the bytes are not valid JSON.\n */\n private static decodeRequestBody(url: string, body: Uint8Array): unknown {\n try {\n return JSON.parse(new TextDecoder().decode(body));\n } catch (error) {\n LoggerProxy.logger.error(\n `e2ee: MLS --> failed to parse engine HTTP request body as JSON (url=${url}): ${error?.message}`\n );\n throw new Error(`Invalid JSON in HTTP request body: ${error?.message}`);\n }\n }\n\n /**\n * @param {string} url - Request URL, used only for logging.\n * @param {unknown} response - Response object from the HTTP client.\n * @returns {Uint8Array} the response serialized as JSON bytes.\n * @throws {Error} when the response cannot be serialized to JSON.\n */\n private static encodeResponseBody(url: string, response: unknown): Uint8Array {\n try {\n return new TextEncoder().encode(JSON.stringify(response));\n } catch (error) {\n LoggerProxy.logger.error(\n `e2ee: MLS --> failed to serialize HTTP response body as JSON (url=${url}): ${error?.message}`\n );\n throw new Error(`Unserializable HTTP response body: ${error?.message}`);\n }\n }\n\n /**\n * Hands a media-encryption service request outcome back to the engine. libe2ee throws\n * `e2ee_negotiation_failure` out of this call when it can't recover from the service's error code\n * or fails to process a successful response; this surfaces in JS as an opaque value with no\n * message. That is unrecoverable for the in-flight operation, so it is reported as\n * `mediaEncryptionRequestFailure` instead of escaping as an unhandled rejection.\n * @param {number} handlerId\n * @param {boolean} success\n * @param {Uint8Array} body\n * @param {number} errorCode - Media-encryption service error code, or 0 when not applicable.\n * @param {string} message\n * @returns {void}\n */\n private completeHttpRequest(\n handlerId: number,\n success: boolean,\n body: Uint8Array,\n errorCode: number,\n message: string\n ): void {\n try {\n this.e2ee?.completeHttpRequest(handlerId, success, body, errorCode, message);\n } catch (error) {\n LoggerProxy.logger.error(\n `e2ee: MLS --> engine threw while completing HTTP request (success=${success}, errorCode=${errorCode}): ${error}`\n );\n this.emitEvent('mediaEncryptionRequestFailure', {\n errorCode,\n message: success ? 'Engine failed to process HTTP response' : message,\n });\n }\n }\n\n /**\n * @param {*} error - Rejection from the HTTP client.\n * @returns {number} the media-encryption service error code from the response body, or 0.\n */\n private static getMesErrorCode(error: any): number {\n const errorCode = error?.body?.errorCode;\n\n return Number.isInteger(errorCode) ? errorCode : 0;\n }\n\n /**\n * @returns {void}\n */\n private emitSecurityCodeIfChanged(): void {\n const code = this.getSecurityCode();\n\n if (code && code !== this.lastSecurityCode) {\n this.lastSecurityCode = code;\n this.emitEvent('securityCodeChanged', {code});\n }\n }\n\n /**\n * Starts the MLS join.\n * @returns {void}\n */\n join(): void {\n LoggerProxy.logger.info('e2ee: MLS --> join: starting MLS join');\n this.assertInitialized().join();\n }\n\n /**\n * Leaves the MLS group.\n * @returns {void}\n */\n leave(): void {\n LoggerProxy.logger.info('e2ee: MLS --> leave: leaving MLS group');\n this.transactions.clear();\n this.assertInitialized().leave();\n }\n\n /**\n * Forwards an incoming MLS protocol event (from the signaling channel) to the engine.\n * @param {Uint8Array} eventData\n * @param {E2eeSignalingSource} source - Which channel the event arrived on, logged for diagnostics.\n * @returns {void}\n */\n handleEvent(eventData: Uint8Array, source: E2eeSignalingSource): void {\n LoggerProxy.logger.info(\n `e2ee: MLS --> handleEvent: forwarding ${eventData.length} bytes from ${source} to engine`\n );\n this.assertInitialized().handle(new Uint8Array(eventData));\n }\n\n /**\n * Tells the engine whether the signaling channel was already connected before join.\n * @param {boolean} connected\n * @returns {void}\n */\n setLlmConnectedBeforeJoin(connected: boolean): void {\n LoggerProxy.logger.info(`e2ee: MLS --> setLlmConnectedBeforeJoin: ${connected}`);\n this.assertInitialized().setLlmConnectedBeforeJoin(connected);\n }\n\n /**\n * Notifies the engine that the signaling channel is now connected.\n * @returns {void}\n */\n llmConnected(): void {\n LoggerProxy.logger.info('e2ee: MLS --> llmConnected');\n this.assertInitialized().llmConnected();\n }\n\n /**\n * @returns {string} the current security code, or '' if not initialized.\n */\n getSecurityCode(): string {\n return this.e2ee ? this.e2ee.securityCode() : '';\n }\n\n /**\n * @returns {E2eeRosterMember[]} the current MLS roster, or [] if not initialized.\n */\n getRoster(): E2eeRosterMember[] {\n return this.e2ee ? this.e2ee.roster().map(MLS.toRosterMember) : [];\n }\n\n /**\n * @returns {boolean} whether this client is the group leader.\n */\n isLeader(): boolean {\n return this.e2ee ? this.e2ee.isLeader() : false;\n }\n\n /**\n * @returns {WebE2EEInstance}\n */\n private assertInitialized(): WebE2EEInstance {\n if (!this.e2ee) {\n throw new Error('MLS not initialized');\n }\n\n return this.e2ee;\n }\n\n /**\n * @param {RosterMember} member - raw WASM roster member.\n * @returns {E2eeRosterMember}\n */\n private static toRosterMember(member: RosterMember): E2eeRosterMember {\n return {\n url: member.url,\n displayName: member.display_name,\n deviceType: member.device_type,\n validationResult: member.validation_result,\n ...(member.x509 && {\n identityResults: member.x509.map((certificateResult) => ({\n result: certificateResult.result,\n certificateChain: certificateResult.member_certs.map((certificate) => ({\n primaryName: certificate.primary_name,\n commonName: certificate.common_name,\n organizationName: certificate.organization_name,\n emailAddresses: certificate.email_addresses,\n domainNames: certificate.domain_names,\n notBefore: certificate.not_before,\n notAfter: certificate.not_after,\n signatureAlgorithm: certificate.signature_algorithm,\n publicKeyAlgorithm: certificate.public_key_algorithm,\n identityType: certificate.identity_type,\n der: new Uint8Array(certificate.der),\n })),\n ...(certificateResult.failed_cert_index !== undefined && {\n failedCertIndex: certificateResult.failed_cert_index,\n }),\n })),\n }),\n };\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAIA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAF,sBAAA,CAAAC,OAAA;AAAsD,SAAAE,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,YAAA,CAAAH,CAAA,OAAAI,6BAAA,QAAAC,C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,CACD;MACJ,CAAC;IAEL;EAAC;AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_events","_interopRequireDefault","require","_loggerProxy","ownKeys","e","r","t","_Object$keys","_Object$getOwnPropertySymbols","o","filter","_Object$getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","Object","forEach","_defineProperty2","default","_Object$getOwnPropertyDescriptors","_Object$defineProperties","_Object$defineProperty","WASM_LOG_LEVELS","MLS","exports","_ref","httpClient","module","_classCallCheck2","EventEmitter","_map","_set","_createClass2","key","value","on","event","listener","emitter","off","emitEvent","payload","LoggerProxy","logger","info","concat","emit","initialize","config","e2ee","WebE2EE","setupCallbacks","participantId","deviceUrl","deviceType","correlationId","displayName","serviceUrl","credentials","_config$credentials","privateKey","certChain","addX509Credential","trustAnchors","setTrustAnchors","webexCaRoots","domainNameRoots","userIdentityRoots","domainNameRootsP7b","Uint8Array","joinTimeout","undefined","setJoinTimeout","coalesceWindow","setCoalesceWindow","_this","setOnNewTransaction","_ref2","id","type","transactions","set","setOnCompleteTransaction","result","transactionType","get","warn","delete","status","lastSecurityCode","sec_code","epoch","securityCode","sframe","cipherSuite","sframe_cipher_suite","epochBits","sframe_epoch_bits","baseKey","base_key","index","indexBits","index_bits","canEncrypt","reason","error","setOnHttpRequest","request","url","handlerId","body","_promise","resolve","then","sendHttpRequest","responseBytes","completeHttpRequest","catch","errorCode","getMesErrorCode","message","setOnWait","milliseconds","timeout","setTimeout","_this$e2ee","waitTimeouts","completeWait","add","setOnGotKey","setOnUseKey","emitSecurityCodeIfChanged","setOnPurgeBefore","setOnLeader","isLeader","setOnAddRoster","added","map","toRosterMember","setOnRemoveRoster","removed","urls","setOnEvicted","setOnE2eeVersion","version","setOnMissingCommit","mlsEpoch","useKeyEpoch","setOnLog","level","_WASM_LOG_LEVELS$leve","label","debug","_sendHttpRequest","_asyncToGenerator2","_regenerator","mark","_callee","requestBody","response","wrap","_context","prev","next","decodeRequestBody","sent","abrupt","encodeResponseBody","stop","_x","_x2","success","_this$e2ee2","code","getSecurityCode","join","assertInitialized","leave","clear","cleanUp","clearTimeout","removeAllListeners","handleEvent","eventData","source","handle","setLlmConnectedBeforeJoin","connected","llmConnected","getRoster","roster","Error","JSON","parse","TextDecoder","decode","TextEncoder","encode","_stringify","_error$body","_isInteger","member","display_name","device_type","validationResult","validation_result","x509","identityResults","certificateResult","certificateChain","member_certs","certificate","primaryName","primary_name","commonName","common_name","organizationName","organization_name","emailAddresses","email_addresses","domainNames","domain_names","notBefore","not_before","notAfter","not_after","signatureAlgorithm","signature_algorithm","publicKeyAlgorithm","public_key_algorithm","identityType","identity_type","der","failed_cert_index","failedCertIndex"],"sources":["mls.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-2026 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport EventEmitter from 'events';\n\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport type {\n E2eeKey,\n E2eeRosterMember,\n E2eeSignalingSource,\n IMlsHttpClient,\n MLSConfig,\n SframeParams,\n} from './types';\nimport type {\n EpochInfo,\n HTTPRequest,\n ModuleInstance,\n RosterMember,\n Transaction,\n TransactionResult,\n WebE2EEInstance,\n} from './wasm';\n\n// WASM log levels, indexed by the numeric level the engine emits (see LogLevel in libe2ee).\nconst WASM_LOG_LEVELS = ['', 'FATAL', 'ERROR', 'WARN', 'INFO', 'DEBUG'];\n\n/** Payloads for each event emitted by {@link MLS}. */\nexport interface MLSEventMap {\n joinSuccess: {epoch: number; securityCode: string; sframe: SframeParams; key: E2eeKey};\n joinFailure: {reason: string};\n mediaEncryptionServiceFailure: {errorCode: number; message: string};\n newKey: E2eeKey;\n useKey: {epoch: number};\n purgeKeys: {epoch: number};\n rosterAdded: E2eeRosterMember[];\n rosterRemoved: {urls: string[]};\n leaderChanged: {isLeader: boolean};\n evicted: void;\n versionNegotiated: {version: number};\n securityCodeChanged: {code: string};\n}\n\nexport type MLSEvent = keyof MLSEventMap;\n\n/**\n * Pure MLS protocol engine wrapping the WebE2EE WASM module. It has no webex/HTTP/LLM\n * dependencies: all I/O flows through the injected {@link IMlsHttpClient}, and all outputs are\n * emitted as typed events. This keeps it unit-testable in isolation.\n */\nexport default class MLS {\n private readonly module: ModuleInstance;\n\n private readonly httpClient: IMlsHttpClient;\n\n private readonly emitter = new EventEmitter();\n\n private readonly transactions = new Map<string, Transaction['type']>();\n\n private e2ee: WebE2EEInstance | null = null;\n\n private readonly waitTimeouts = new Set<ReturnType<typeof setTimeout>>();\n\n private lastSecurityCode = '';\n\n /**\n * @param {Object} deps\n * @param {ModuleInstance} deps.module - The loaded WASM module used to instantiate the engine.\n * @param {IMlsHttpClient} deps.httpClient - Transport for the engine's protocol requests.\n */\n constructor({httpClient, module}: {httpClient: IMlsHttpClient; module: ModuleInstance}) {\n this.httpClient = httpClient;\n this.module = module;\n }\n\n /**\n * Subscribe to an engine event.\n * @param {MLSEvent} event\n * @param {Function} listener\n * @returns {void}\n */\n on<K extends MLSEvent>(event: K, listener: (payload: MLSEventMap[K]) => void): void {\n this.emitter.on(event, listener as (payload: unknown) => void);\n }\n\n /**\n * Unsubscribe from an engine event.\n * @param {MLSEvent} event\n * @param {Function} listener\n * @returns {void}\n */\n off<K extends MLSEvent>(event: K, listener: (payload: MLSEventMap[K]) => void): void {\n this.emitter.off(event, listener as (payload: unknown) => void);\n }\n\n /**\n * @param {MLSEvent} event\n * @param {*} [payload]\n * @returns {void}\n */\n private emitEvent<K extends MLSEvent>(event: K, payload?: MLSEventMap[K]): void {\n LoggerProxy.logger.info(`e2ee: MLS --> emitting event: ${event}`);\n this.emitter.emit(event, payload);\n }\n\n /**\n * Instantiates the engine, wires its callbacks, and applies credentials, trust anchors and\n * timeouts. Must be called before {@link join}.\n * @param {MLSConfig} config\n * @returns {void}\n */\n initialize(config: MLSConfig): void {\n LoggerProxy.logger.info('e2ee: MLS --> initialize: instantiating engine');\n if (this.e2ee) {\n LoggerProxy.logger.info('e2ee: MLS --> initialize: already initialized');\n\n return;\n }\n\n this.e2ee = new this.module.WebE2EE();\n this.setupCallbacks();\n\n this.e2ee.initialize(\n config.participantId,\n config.deviceUrl,\n config.deviceType,\n config.correlationId,\n config.displayName,\n config.serviceUrl\n );\n\n if (config.credentials) {\n const {privateKey, certChain} = config.credentials;\n\n this.e2ee.addX509Credential(privateKey, certChain);\n }\n\n if (config.trustAnchors) {\n this.e2ee.setTrustAnchors(\n config.trustAnchors.webexCaRoots || '',\n config.trustAnchors.domainNameRoots || '',\n config.trustAnchors.userIdentityRoots || '',\n config.trustAnchors.domainNameRootsP7b || new Uint8Array()\n );\n }\n\n if (config.joinTimeout !== undefined) {\n this.e2ee.setJoinTimeout(config.joinTimeout);\n }\n if (config.coalesceWindow !== undefined) {\n this.e2ee.setCoalesceWindow(config.coalesceWindow);\n }\n\n LoggerProxy.logger.info('e2ee: MLS --> initialize: engine initialized');\n }\n\n /**\n * @returns {void}\n */\n private setupCallbacks(): void {\n const {e2ee} = this;\n\n if (!e2ee) {\n return;\n }\n\n e2ee.setOnNewTransaction(({id, type}: Transaction) => {\n this.transactions.set(id, type);\n });\n\n e2ee.setOnCompleteTransaction((id, result: TransactionResult) => {\n const transactionType = this.transactions.get(id);\n\n if (!transactionType) {\n LoggerProxy.logger.warn(`e2ee: MLS --> completion for unknown transaction (id=${id})`);\n\n return;\n }\n\n this.transactions.delete(id);\n\n if (result.status === 'join_success') {\n if (transactionType !== 'join') {\n LoggerProxy.logger.warn(\n `e2ee: MLS --> join success for non-join transaction (id=${id}, type=${transactionType})`\n );\n\n return;\n }\n\n this.lastSecurityCode = result.sec_code;\n this.emitEvent('joinSuccess', {\n epoch: result.epoch,\n securityCode: result.sec_code,\n sframe: {\n cipherSuite: result.sframe_cipher_suite,\n epochBits: result.sframe_epoch_bits,\n },\n key: {\n epoch: result.epoch,\n baseKey: new Uint8Array(result.base_key),\n index: result.index,\n indexBits: result.index_bits,\n canEncrypt: false,\n },\n });\n } else if (result.status === 'update_success') {\n if (transactionType !== 'update') {\n LoggerProxy.logger.warn(\n `e2ee: MLS --> update success for non-update transaction (id=${id}, type=${transactionType})`\n );\n }\n } else if (result.status === 'failure') {\n if (transactionType === 'join') {\n this.emitEvent('joinFailure', {reason: result.reason});\n } else {\n LoggerProxy.logger.error(\n `e2ee: MLS --> update transaction failed (id=${id}, reason=${result.reason})`\n );\n }\n }\n });\n\n e2ee.setOnHttpRequest((request: HTTPRequest) => {\n const {url, handlerId} = request;\n // The body is a view into WASM memory that is only valid during this callback, so copy it now.\n const body = new Uint8Array(request.body);\n\n // Complete asynchronously so the engine is never re-entered from inside its own request call.\n Promise.resolve()\n .then(() => this.sendHttpRequest(url, body))\n .then((responseBytes) => {\n this.completeHttpRequest(handlerId, true, responseBytes, 0, '');\n })\n .catch((error) => {\n const errorCode = MLS.getMesErrorCode(error);\n const message = error?.message || 'Request failed';\n\n LoggerProxy.logger.warn(\n `e2ee: MLS --> HTTP request failed (url=${url}, errorCode=${errorCode}): ${message}`\n );\n this.completeHttpRequest(handlerId, false, new Uint8Array(0), errorCode, message);\n });\n });\n\n e2ee.setOnWait((milliseconds, handlerId) => {\n const timeout = setTimeout(() => {\n this.waitTimeouts.delete(timeout);\n this.e2ee?.completeWait(handlerId);\n }, milliseconds);\n\n this.waitTimeouts.add(timeout);\n });\n\n e2ee.setOnGotKey((epoch: EpochInfo) => {\n this.emitEvent('newKey', {\n epoch: epoch.epoch,\n baseKey: new Uint8Array(epoch.base_key),\n index: epoch.index,\n indexBits: epoch.index_bits,\n canEncrypt: false, // the key can only be used for encryption after onUseKey is called\n });\n });\n\n e2ee.setOnUseKey((epoch: number) => {\n this.emitEvent('useKey', {epoch});\n this.emitSecurityCodeIfChanged();\n });\n\n e2ee.setOnPurgeBefore((epoch: number) => {\n this.emitEvent('purgeKeys', {epoch});\n });\n\n e2ee.setOnLeader(() => {\n this.emitEvent('leaderChanged', {isLeader: true});\n });\n\n e2ee.setOnAddRoster((added: RosterMember[]) => {\n this.emitEvent('rosterAdded', added.map(MLS.toRosterMember));\n this.emitSecurityCodeIfChanged();\n });\n\n e2ee.setOnRemoveRoster((removed: string[]) => {\n this.emitEvent('rosterRemoved', {urls: removed});\n this.emitSecurityCodeIfChanged();\n });\n\n e2ee.setOnEvicted(() => {\n this.emitEvent('evicted');\n });\n\n e2ee.setOnE2eeVersion((version: number) => {\n this.emitEvent('versionNegotiated', {version});\n });\n\n e2ee.setOnMissingCommit((mlsEpoch, useKeyEpoch) => {\n LoggerProxy.logger.warn(\n `e2ee: MLS --> missing commit (mlsEpoch=${mlsEpoch}, useKeyEpoch=${useKeyEpoch})`\n );\n });\n\n e2ee.setOnLog((level: number, message: string) => {\n const label = WASM_LOG_LEVELS[level] ?? '';\n\n switch (level) {\n case 1:\n case 2:\n LoggerProxy.logger.error(`e2ee: [E2EE ${label}] ${message}`);\n break;\n case 3:\n LoggerProxy.logger.warn(`e2ee: [E2EE ${label}] ${message}`);\n break;\n case 5:\n LoggerProxy.logger.debug(`e2ee: [E2EE ${label}] ${message}`);\n break;\n default:\n LoggerProxy.logger.info(`e2ee: [E2EE ${label}] ${message}`);\n }\n });\n }\n\n /**\n * Sends an engine HTTP request through the injected {@link IMlsHttpClient}, converting between\n * the engine's JSON bytes and the client's objects. Conversion failures reject so the engine's\n * request is completed as failed.\n * @param {string} url - The absolute request URL provided by the engine.\n * @param {Uint8Array} body - JSON request payload as bytes (owned copy, not a WASM memory view).\n * @returns {Promise<Uint8Array>} JSON response payload as bytes.\n */\n private async sendHttpRequest(url: string, body: Uint8Array): Promise<Uint8Array> {\n const requestBody = MLS.decodeRequestBody(url, body);\n const response = await this.httpClient.request(url, requestBody);\n\n return MLS.encodeResponseBody(url, response);\n }\n\n /**\n * @param {string} url - Request URL, used only for logging.\n * @param {Uint8Array} body - JSON request payload as bytes.\n * @returns {unknown} the parsed request body.\n * @throws {Error} when the bytes are not valid JSON.\n */\n private static decodeRequestBody(url: string, body: Uint8Array): unknown {\n try {\n return JSON.parse(new TextDecoder().decode(body));\n } catch (error) {\n LoggerProxy.logger.error(\n `e2ee: MLS --> failed to parse engine HTTP request body as JSON (url=${url}): ${error?.message}`\n );\n throw new Error(`Invalid JSON in HTTP request body: ${error?.message}`);\n }\n }\n\n /**\n * @param {string} url - Request URL, used only for logging.\n * @param {unknown} response - Response object from the HTTP client.\n * @returns {Uint8Array} the response serialized as JSON bytes.\n * @throws {Error} when the response cannot be serialized to JSON.\n */\n private static encodeResponseBody(url: string, response: unknown): Uint8Array {\n try {\n return new TextEncoder().encode(JSON.stringify(response));\n } catch (error) {\n LoggerProxy.logger.error(\n `e2ee: MLS --> failed to serialize HTTP response body as JSON (url=${url}): ${error?.message}`\n );\n throw new Error(`Unserializable HTTP response body: ${error?.message}`);\n }\n }\n\n /**\n * Hands a media-encryption service request outcome back to the engine. libe2ee throws\n * `e2ee_negotiation_failure` out of this call when it can't recover from the service's error code\n * or fails to process a successful response; this surfaces in JS as an opaque value with no\n * message. That is unrecoverable for the in-flight operation, so it is reported as\n * `mediaEncryptionServiceFailure` instead of escaping as an unhandled rejection.\n * @param {number} handlerId\n * @param {boolean} success\n * @param {Uint8Array} body\n * @param {number} errorCode - Media-encryption service error code, or 0 when not applicable.\n * @param {string} message\n * @returns {void}\n */\n private completeHttpRequest(\n handlerId: number,\n success: boolean,\n body: Uint8Array,\n errorCode: number,\n message: string\n ): void {\n try {\n this.e2ee?.completeHttpRequest(handlerId, success, body, errorCode, message);\n } catch (error) {\n LoggerProxy.logger.error(\n `e2ee: MLS --> engine threw while completing HTTP request (success=${success}, errorCode=${errorCode}): ${error}`\n );\n this.emitEvent('mediaEncryptionServiceFailure', {\n errorCode,\n message: success ? 'Engine failed to process HTTP response' : message,\n });\n }\n }\n\n /**\n * @param {*} error - Rejection from the HTTP client.\n * @returns {number} the media-encryption service error code from the response body, or 0.\n */\n private static getMesErrorCode(error: any): number {\n const errorCode = error?.body?.errorCode;\n\n return Number.isInteger(errorCode) ? errorCode : 0;\n }\n\n /**\n * @returns {void}\n */\n private emitSecurityCodeIfChanged(): void {\n const code = this.getSecurityCode();\n\n if (code && code !== this.lastSecurityCode) {\n this.lastSecurityCode = code;\n this.emitEvent('securityCodeChanged', {code});\n }\n }\n\n /**\n * Starts the MLS join.\n * @returns {void}\n */\n join(): void {\n LoggerProxy.logger.info('e2ee: MLS --> join: starting MLS join');\n this.assertInitialized().join();\n }\n\n /**\n * Leaves the MLS group.\n * @returns {void}\n */\n leave(): void {\n LoggerProxy.logger.info('e2ee: MLS --> leave: leaving MLS group');\n this.transactions.clear();\n this.assertInitialized().leave();\n }\n\n /**\n * Detaches engine callbacks and releases the WASM engine and wrapper resources.\n * @returns {void}\n */\n cleanUp(): void {\n this.waitTimeouts.forEach((timeout) => clearTimeout(timeout));\n this.waitTimeouts.clear();\n this.transactions.clear();\n this.lastSecurityCode = '';\n\n const {e2ee} = this;\n\n this.e2ee = null;\n\n if (e2ee) {\n e2ee.setOnNewTransaction(null);\n e2ee.setOnCompleteTransaction(null);\n e2ee.setOnHttpRequest(null);\n e2ee.setOnWait(null);\n e2ee.setOnGotKey(null);\n e2ee.setOnUseKey(null);\n e2ee.setOnLeader(null);\n e2ee.setOnPurgeBefore(null);\n e2ee.setOnEvicted(null);\n e2ee.setOnAddRoster(null);\n e2ee.setOnRemoveRoster(null);\n e2ee.setOnE2eeVersion(null);\n e2ee.setOnMissingCommit(null);\n e2ee.setOnLog(null);\n e2ee.delete();\n }\n\n this.emitter.removeAllListeners();\n }\n\n /**\n * Forwards an incoming MLS protocol event (from the signaling channel) to the engine.\n * @param {Uint8Array} eventData\n * @param {E2eeSignalingSource} source - Which channel the event arrived on, logged for diagnostics.\n * @returns {void}\n */\n handleEvent(eventData: Uint8Array, source: E2eeSignalingSource): void {\n LoggerProxy.logger.info(\n `e2ee: MLS --> handleEvent: forwarding ${eventData.length} bytes from ${source} to engine`\n );\n this.assertInitialized().handle(new Uint8Array(eventData));\n }\n\n /**\n * Tells the engine whether the signaling channel was already connected before join.\n * @param {boolean} connected\n * @returns {void}\n */\n setLlmConnectedBeforeJoin(connected: boolean): void {\n LoggerProxy.logger.info(`e2ee: MLS --> setLlmConnectedBeforeJoin: ${connected}`);\n this.assertInitialized().setLlmConnectedBeforeJoin(connected);\n }\n\n /**\n * Notifies the engine that the signaling channel is now connected.\n * @returns {void}\n */\n llmConnected(): void {\n LoggerProxy.logger.info('e2ee: MLS --> llmConnected');\n this.assertInitialized().llmConnected();\n }\n\n /**\n * @returns {string} the current security code, or '' if not initialized.\n */\n getSecurityCode(): string {\n return this.e2ee ? this.e2ee.securityCode() : '';\n }\n\n /**\n * @returns {E2eeRosterMember[]} the current MLS roster, or [] if not initialized.\n */\n getRoster(): E2eeRosterMember[] {\n return this.e2ee ? this.e2ee.roster().map(MLS.toRosterMember) : [];\n }\n\n /**\n * @returns {boolean} whether this client is the group leader.\n */\n isLeader(): boolean {\n return this.e2ee ? this.e2ee.isLeader() : false;\n }\n\n /**\n * @returns {WebE2EEInstance}\n */\n private assertInitialized(): WebE2EEInstance {\n if (!this.e2ee) {\n throw new Error('MLS not initialized');\n }\n\n return this.e2ee;\n }\n\n /**\n * @param {RosterMember} member - raw WASM roster member.\n * @returns {E2eeRosterMember}\n */\n private static toRosterMember(member: RosterMember): E2eeRosterMember {\n return {\n url: member.url,\n displayName: member.display_name,\n deviceType: member.device_type,\n validationResult: member.validation_result,\n ...(member.x509 && {\n identityResults: member.x509.map((certificateResult) => ({\n result: certificateResult.result,\n certificateChain: certificateResult.member_certs.map((certificate) => ({\n primaryName: certificate.primary_name,\n commonName: certificate.common_name,\n organizationName: certificate.organization_name,\n emailAddresses: certificate.email_addresses,\n domainNames: certificate.domain_names,\n notBefore: certificate.not_before,\n notAfter: certificate.not_after,\n signatureAlgorithm: certificate.signature_algorithm,\n publicKeyAlgorithm: certificate.public_key_algorithm,\n identityType: certificate.identity_type,\n der: new Uint8Array(certificate.der),\n })),\n ...(certificateResult.failed_cert_index !== undefined && {\n failedCertIndex: certificateResult.failed_cert_index,\n }),\n })),\n }),\n };\n }\n}\n"],"mappings":";;;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AAEN,MAAM,CAACK,IAAI,CAACrE,GAAG,CAAC,UAACuE,iBAAiB;UAAA,OAAApM,aAAA;YACjDuE,MAAM,EAAE6H,iBAAiB,CAAC7H,MAAM;YAChC8H,gBAAgB,EAAED,iBAAiB,CAACE,YAAY,CAACzE,GAAG,CAAC,UAAC0E,WAAW;cAAA,OAAM;gBACrEC,WAAW,EAAED,WAAW,CAACE,YAAY;gBACrCC,UAAU,EAAEH,WAAW,CAACI,WAAW;gBACnCC,gBAAgB,EAAEL,WAAW,CAACM,iBAAiB;gBAC/CC,cAAc,EAAEP,WAAW,CAACQ,eAAe;gBAC3CC,WAAW,EAAET,WAAW,CAACU,YAAY;gBACrCC,SAAS,EAAEX,WAAW,CAACY,UAAU;gBACjCC,QAAQ,EAAEb,WAAW,CAACc,SAAS;gBAC/BC,kBAAkB,EAAEf,WAAW,CAACgB,mBAAmB;gBACnDC,kBAAkB,EAAEjB,WAAW,CAACkB,oBAAoB;gBACpDC,YAAY,EAAEnB,WAAW,CAACoB,aAAa;gBACvCC,GAAG,EAAE,IAAInK,UAAU,CAAC8I,WAAW,CAACqB,GAAG;cACrC,CAAC;YAAA,CAAC;UAAC,GACCxB,iBAAiB,CAACyB,iBAAiB,KAAKlK,SAAS,IAAI;YACvDmK,eAAe,EAAE1B,iBAAiB,CAACyB;UACrC,CAAC;QAAA,CACD;MACJ,CAAC;IAEL;EAAC;AAAA","ignoreList":[]}
|
package/dist/e2ee/types.js
CHANGED
|
@@ -4,17 +4,53 @@ var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/defi
|
|
|
4
4
|
_Object$defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.E2eeValidationResult = exports.E2eeIdentityType = void 0;
|
|
7
|
+
exports.TrustState = exports.E2eeValidationResult = exports.E2eeState = exports.E2eeSignalingSource = exports.E2eeIdentityType = void 0;
|
|
8
|
+
var _constants = require("../constants");
|
|
8
9
|
/*!
|
|
9
10
|
* Copyright (c) 2015-2026 Cisco Systems, Inc. See LICENSE file.
|
|
10
11
|
*/
|
|
11
12
|
|
|
13
|
+
/** The Locus DTO fields consumed by E2EE, matching the shape exposed by `Meeting.locusInfo`. */
|
|
14
|
+
|
|
15
|
+
/** Per-meeting context supplied by Meetings without exposing its Meeting class to E2EE. */
|
|
16
|
+
|
|
12
17
|
/**
|
|
13
|
-
* SDK-facing
|
|
14
|
-
* identity-plugin and signaling types are added by the later adapter phases.
|
|
18
|
+
* SDK-facing E2EE types (camelCase), mapped from the raw WASM boundary shapes in wasm.d.ts.
|
|
15
19
|
*/
|
|
16
20
|
|
|
17
|
-
/**
|
|
21
|
+
/** Lifecycle state of a per-meeting MLS session. */
|
|
22
|
+
var E2eeState = exports.E2eeState = {
|
|
23
|
+
Disabled: 'disabled',
|
|
24
|
+
Initializing: 'initializing',
|
|
25
|
+
Joining: 'joining',
|
|
26
|
+
Joined: 'joined',
|
|
27
|
+
Failed: 'failed',
|
|
28
|
+
Evicted: 'evicted',
|
|
29
|
+
Left: 'left'
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/** Event payloads emitted by E2eeController and forwarded through Meeting. */
|
|
33
|
+
|
|
34
|
+
/** The meeting's overall E2EE trust state, surfaced to the app for its UI indicator. */
|
|
35
|
+
var TrustState = exports.TrustState = {
|
|
36
|
+
Calculating: 'calculating',
|
|
37
|
+
Failed: 'failed',
|
|
38
|
+
Strong: 'strong',
|
|
39
|
+
ZeroTrust: 'zeroTrust',
|
|
40
|
+
AdaptiveStrong: 'adaptiveStrong',
|
|
41
|
+
AdaptiveZeroTrust: 'adaptiveZeroTrust'
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/** A media-encryption (SFrame) key for a given MLS epoch. */
|
|
45
|
+
|
|
46
|
+
/** SFrame parameters negotiated for the group, reported on a successful join. */
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Credential-validation outcome for an MLS roster member. Mirrors (by ordinal) the C++
|
|
50
|
+
* `RosterStatus::ValidationResult` enum in libe2ee (`common/include/e2ee_common/types.h`) — keep
|
|
51
|
+
* the two in sync. For MultiCredential, `PartialSuccess` means at least one credential passed and
|
|
52
|
+
* at least one failed; X.509 identity verification is derived from the individual X.509 results.
|
|
53
|
+
*/
|
|
18
54
|
var E2eeValidationResult = exports.E2eeValidationResult = {
|
|
19
55
|
Success: 0,
|
|
20
56
|
PartialSuccess: 1,
|
|
@@ -31,7 +67,10 @@ var E2eeValidationResult = exports.E2eeValidationResult = {
|
|
|
31
67
|
UnsupportedCredentialType: 12,
|
|
32
68
|
MissingDisplayNameExtension: 13
|
|
33
69
|
};
|
|
34
|
-
/**
|
|
70
|
+
/**
|
|
71
|
+
* Identity type attached to the leaf X.509 certificate. Mirrors the C++ `IdentityType` enum in
|
|
72
|
+
* libe2ee (`common/include/e2ee_common/types.h`) — keep the ordinals in sync.
|
|
73
|
+
*/
|
|
35
74
|
var E2eeIdentityType = exports.E2eeIdentityType = {
|
|
36
75
|
WebexAnonymousIdentity: 0,
|
|
37
76
|
WebexMachineIdentity: 1,
|
|
@@ -39,15 +78,11 @@ var E2eeIdentityType = exports.E2eeIdentityType = {
|
|
|
39
78
|
ExternalVerifiedIdentity: 3
|
|
40
79
|
};
|
|
41
80
|
|
|
42
|
-
/**
|
|
43
|
-
|
|
44
|
-
/** SFrame parameters negotiated for an MLS group. */
|
|
81
|
+
/** Parsed X.509 certificate details from a member's certificate chain. */
|
|
45
82
|
|
|
46
|
-
/**
|
|
83
|
+
/** A member of the MLS roster and its overall libe2ee credential validation result. */
|
|
47
84
|
|
|
48
|
-
/**
|
|
49
|
-
|
|
50
|
-
/** Credentials and trust anchors consumed by the WASM engine. */
|
|
85
|
+
/** Configuration for initializing an MLS group session. */
|
|
51
86
|
|
|
52
87
|
/**
|
|
53
88
|
* HTTP transport the MLS engine uses for its protocol requests. Implemented by
|
|
@@ -55,5 +90,9 @@ var E2eeIdentityType = exports.E2eeIdentityType = {
|
|
|
55
90
|
* Bodies are plain JS objects: MLS converts the engine's JSON bytes to/from objects at its boundary.
|
|
56
91
|
*/
|
|
57
92
|
|
|
58
|
-
/**
|
|
93
|
+
/** Which signaling channel an incoming MLS protocol event arrived on. */
|
|
94
|
+
var E2eeSignalingSource = exports.E2eeSignalingSource = {
|
|
95
|
+
Llm: 'llm',
|
|
96
|
+
Mercury: 'mercury'
|
|
97
|
+
};
|
|
59
98
|
//# sourceMappingURL=types.js.map
|
package/dist/e2ee/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_constants","require","E2eeState","exports","Disabled","Initializing","Joining","Joined","Failed","Evicted","Left","TrustState","Calculating","Strong","ZeroTrust","AdaptiveStrong","AdaptiveZeroTrust","E2eeValidationResult","Success","PartialSuccess","Failure","ParseError","UnknownIssuer","UnknownPublicKey","InvalidSignature","Expired","Inactive","Revoked","UnsupportedCaType","InvalidKeypackageSignature","UnsupportedCredentialType","MissingDisplayNameExtension","E2eeIdentityType","WebexAnonymousIdentity","WebexMachineIdentity","WebexUserIdentity","ExternalVerifiedIdentity","E2eeSignalingSource","Llm","Mercury"],"sources":["types.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-2026 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport type {IdentityCredentials, IdentityTrustAnchors} from '@webex/internal-plugin-identity';\nimport type LLMChannel from '@webex/internal-plugin-llm';\n\nimport {EVENT_TRIGGERS, type Enum} from '../constants';\nimport type {LocusDTO} from '../locus-info/types';\nimport type Members from '../members';\n\n/** The Locus DTO fields consumed by E2EE, matching the shape exposed by `Meeting.locusInfo`. */\nexport type E2eeLocusInfo = Pick<LocusDTO, 'url' | 'info'>;\n\n/** Per-meeting context supplied by Meetings without exposing its Meeting class to E2EE. */\nexport interface E2eeMeetingContext {\n getCorrelationId(): string;\n getLocusInfo(): E2eeLocusInfo | undefined;\n getLlmChannel(): LLMChannel | undefined;\n members: Members;\n}\n\n/**\n * SDK-facing E2EE types (camelCase), mapped from the raw WASM boundary shapes in wasm.d.ts.\n */\n\n/** Lifecycle state of a per-meeting MLS session. */\nexport const E2eeState = {\n Disabled: 'disabled',\n Initializing: 'initializing',\n Joining: 'joining',\n Joined: 'joined',\n Failed: 'failed',\n Evicted: 'evicted',\n Left: 'left',\n} as const;\n\nexport type E2eeState = Enum<typeof E2eeState>;\n\n/** Event payloads emitted by E2eeController and forwarded through Meeting. */\nexport interface E2eeControllerEventMap {\n [EVENT_TRIGGERS.MEETING_E2EE_SECURITY_CODE_UPDATED]: {securityCode: string | undefined};\n [EVENT_TRIGGERS.MEETING_E2EE_STATE_CHANGED]: {state: E2eeState};\n [EVENT_TRIGGERS.MEETING_E2EE_MEDIA_SERVICES_CHANGED]: {hasMediaServices: boolean};\n [EVENT_TRIGGERS.MEETING_E2EE_FAILURE]: {\n reason: string;\n errorCode?: number;\n errorMessage?: string;\n };\n}\n\nexport type E2eeControllerEvent = keyof E2eeControllerEventMap;\n\n/** The meeting's overall E2EE trust state, surfaced to the app for its UI indicator. */\nexport const TrustState = {\n Calculating: 'calculating',\n Failed: 'failed',\n Strong: 'strong',\n ZeroTrust: 'zeroTrust',\n AdaptiveStrong: 'adaptiveStrong',\n AdaptiveZeroTrust: 'adaptiveZeroTrust',\n} as const;\n\nexport type TrustState = Enum<typeof TrustState>;\n\n/** A media-encryption (SFrame) key for a given MLS epoch. */\nexport interface E2eeKey {\n epoch: number;\n baseKey: Uint8Array;\n index: number;\n indexBits: number;\n canEncrypt: boolean;\n}\n\n/** SFrame parameters negotiated for the group, reported on a successful join. */\nexport interface SframeParams {\n cipherSuite: number;\n epochBits: number;\n}\n\n/**\n * Credential-validation outcome for an MLS roster member. Mirrors (by ordinal) the C++\n * `RosterStatus::ValidationResult` enum in libe2ee (`common/include/e2ee_common/types.h`) — keep\n * the two in sync. For MultiCredential, `PartialSuccess` means at least one credential passed and\n * at least one failed; X.509 identity verification is derived from the individual X.509 results.\n */\nexport const E2eeValidationResult = {\n Success: 0,\n PartialSuccess: 1,\n Failure: 2,\n ParseError: 3,\n UnknownIssuer: 4,\n UnknownPublicKey: 5,\n InvalidSignature: 6,\n Expired: 7,\n Inactive: 8,\n Revoked: 9,\n UnsupportedCaType: 10,\n InvalidKeypackageSignature: 11,\n UnsupportedCredentialType: 12,\n MissingDisplayNameExtension: 13,\n} as const;\n\nexport type E2eeValidationResult = Enum<typeof E2eeValidationResult>;\n\n/**\n * Identity type attached to the leaf X.509 certificate. Mirrors the C++ `IdentityType` enum in\n * libe2ee (`common/include/e2ee_common/types.h`) — keep the ordinals in sync.\n */\nexport const E2eeIdentityType = {\n WebexAnonymousIdentity: 0,\n WebexMachineIdentity: 1,\n WebexUserIdentity: 2,\n ExternalVerifiedIdentity: 3,\n} as const;\n\nexport type E2eeIdentityType = Enum<typeof E2eeIdentityType>;\n\n/** Parsed X.509 certificate details from a member's certificate chain. */\nexport interface E2eeCertificateInfo {\n primaryName: string;\n commonName: string;\n organizationName: string;\n emailAddresses: string[];\n domainNames: string[];\n notBefore: number;\n notAfter: number;\n signatureAlgorithm: string;\n publicKeyAlgorithm: string;\n identityType?: E2eeIdentityType;\n der: Uint8Array;\n}\n\nexport interface E2eeIdentityResult {\n /** Result for this X.509 credential, which may differ from the overall MultiCredential result. */\n result: E2eeValidationResult;\n certificateChain: E2eeCertificateInfo[];\n failedCertIndex?: number;\n}\n\n/** A member of the MLS roster and its overall libe2ee credential validation result. */\nexport interface E2eeRosterMember {\n url: string;\n displayName: string;\n deviceType: string;\n validationResult: E2eeValidationResult;\n identityResults?: E2eeIdentityResult[];\n}\n\n/** Configuration for initializing an MLS group session. */\nexport interface MLSConfig {\n participantId: string;\n deviceUrl: string;\n deviceType: string;\n correlationId: string;\n displayName: string;\n serviceUrl: string;\n credentials?: IdentityCredentials;\n trustAnchors?: IdentityTrustAnchors;\n joinTimeout?: number;\n coalesceWindow?: number;\n}\n\n/**\n * HTTP transport the MLS engine uses for its protocol requests. Implemented by\n * MediaEncryptionService (which routes to webex.request); injected so the engine stays pure.\n * Bodies are plain JS objects: MLS converts the engine's JSON bytes to/from objects at its boundary.\n */\nexport interface IMlsHttpClient {\n request(url: string, body: unknown): Promise<unknown>;\n}\n\n/** Which signaling channel an incoming MLS protocol event arrived on. */\nexport const E2eeSignalingSource = {\n Llm: 'llm',\n Mercury: 'mercury',\n} as const;\n\nexport type E2eeSignalingSource = Enum<typeof E2eeSignalingSource>;\n"],"mappings":";;;;;;;AAOA,IAAAA,UAAA,GAAAC,OAAA;AAPA;AACA;AACA;;AASA;;AAGA;;AAQA;AACA;AACA;;AAEA;AACO,IAAMC,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAG;EACvBE,QAAQ,EAAE,UAAU;EACpBC,YAAY,EAAE,cAAc;EAC5BC,OAAO,EAAE,SAAS;EAClBC,MAAM,EAAE,QAAQ;EAChBC,MAAM,EAAE,QAAQ;EAChBC,OAAO,EAAE,SAAS;EAClBC,IAAI,EAAE;AACR,CAAU;;AAIV;;AAcA;AACO,IAAMC,UAAU,GAAAR,OAAA,CAAAQ,UAAA,GAAG;EACxBC,WAAW,EAAE,aAAa;EAC1BJ,MAAM,EAAE,QAAQ;EAChBK,MAAM,EAAE,QAAQ;EAChBC,SAAS,EAAE,WAAW;EACtBC,cAAc,EAAE,gBAAgB;EAChCC,iBAAiB,EAAE;AACrB,CAAU;;AAIV;;AASA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACO,IAAMC,oBAAoB,GAAAd,OAAA,CAAAc,oBAAA,GAAG;EAClCC,OAAO,EAAE,CAAC;EACVC,cAAc,EAAE,CAAC;EACjBC,OAAO,EAAE,CAAC;EACVC,UAAU,EAAE,CAAC;EACbC,aAAa,EAAE,CAAC;EAChBC,gBAAgB,EAAE,CAAC;EACnBC,gBAAgB,EAAE,CAAC;EACnBC,OAAO,EAAE,CAAC;EACVC,QAAQ,EAAE,CAAC;EACXC,OAAO,EAAE,CAAC;EACVC,iBAAiB,EAAE,EAAE;EACrBC,0BAA0B,EAAE,EAAE;EAC9BC,yBAAyB,EAAE,EAAE;EAC7BC,2BAA2B,EAAE;AAC/B,CAAU;AAIV;AACA;AACA;AACA;AACO,IAAMC,gBAAgB,GAAA7B,OAAA,CAAA6B,gBAAA,GAAG;EAC9BC,sBAAsB,EAAE,CAAC;EACzBC,oBAAoB,EAAE,CAAC;EACvBC,iBAAiB,EAAE,CAAC;EACpBC,wBAAwB,EAAE;AAC5B,CAAU;;AAIV;;AAsBA;;AASA;;AAcA;AACA;AACA;AACA;AACA;;AAKA;AACO,IAAMC,mBAAmB,GAAAlC,OAAA,CAAAkC,mBAAA,GAAG;EACjCC,GAAG,EAAE,KAAK;EACVC,OAAO,EAAE;AACX,CAAU","ignoreList":[]}
|
package/dist/e2ee/wasm.d.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["wasm.d.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-2026 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport type {E2eeIdentityType, E2eeValidationResult} from './types';\n\n/**\n * Raw WebAssembly (WebE2EE) boundary types. These mirror the emscripten-generated MLS engine API\n * exactly (including its snake_case fields); the SDK-facing camelCase shapes live in types.ts.\n */\n\nexport interface Transaction {\n id: string;\n type: 'join' | 'update';\n}\n\nexport interface JoinSuccessResult {\n status: 'join_success';\n epoch: number;\n base_key: Uint8Array;\n index: number;\n index_bits: number;\n sec_code: string;\n sframe_cipher_suite: number;\n sframe_epoch_bits: number;\n}\n\nexport interface UpdateSuccessResult {\n status: 'update_success';\n}\n\nexport interface TransactionFailureResult {\n status: 'failure';\n reason:\n | 'timeout'\n | 'join_failure'\n | 'tree_fetch_failure'\n | 'commit_fetch_failure'\n | 'update_override';\n}\n\nexport type TransactionResult = JoinSuccessResult | UpdateSuccessResult | TransactionFailureResult;\n\nexport interface HTTPRequest {\n url: string;\n /** A view into WASM memory (`typed_memory_view`); only valid during the callback — copy before async use. */\n body: Uint8Array;\n handlerId: number;\n}\n\nexport interface EpochInfo {\n epoch: number;\n base_key: Uint8Array;\n index: number;\n index_bits: number;\n sec_code: string;\n}\n\nexport interface CertificateInfo {\n primary_name: string;\n common_name: string;\n organization_name: string;\n email_addresses: string[];\n domain_names: string[];\n not_before: number;\n not_after: number;\n signature_algorithm: string;\n public_key_algorithm: string;\n identity_type?: E2eeIdentityType;\n der: Uint8Array;\n}\n\nexport interface CertificateResult {\n result: E2eeValidationResult;\n member_certs: CertificateInfo[];\n failed_cert_index?: number;\n}\n\nexport interface RosterMember {\n url: string;\n display_name: string;\n device_type: string;\n validation_result: E2eeValidationResult;\n x509?: CertificateResult[];\n}\n\nexport interface WebE2EEInstance {\n initialize(\n participantId: string,\n deviceUrl: string,\n deviceType: string,\n correlationId: string,\n displayName: string,\n serviceUrl: string\n ): void;\n\n addX509Credential(privateKey: Uint8Array, certChain: Uint8Array[]): void;\n setTrustAnchors(\n webexCaRoots: string,\n domainNameRoots: string,\n userIdentityRoots: string,\n domainNameRootsP7b: Uint8Array\n ): void;\n\n join(): void;\n leave(): void;\n joined(): boolean;\n securityCode(): string;\n sessionSecret(): Uint8Array | null;\n contentKey(): Uint8Array | null;\n contentKeyId(): string;\n roster(): RosterMember[];\n handle(event: Uint8Array): void;\n isLeader(): boolean;\n /**\n * Used by backend services such as Homer; client SDKs do not need to call this.\n */\n keepAlive(): void;\n llmConnected(): void;\n setLlmConnectedBeforeJoin(connected: boolean): void;\n setGzipThreshold(threshold: number): void;\n setCoalesceWindow(milliseconds: number): void;\n setJoinTimeout(milliseconds: number): void;\n setPurgeKeysTimeout(milliseconds: number): void;\n\n setOnNewTransaction(callback: (transaction: Transaction) => void): void;\n setOnCompleteTransaction(callback: (id: string, result: TransactionResult) => void): void;\n setOnHttpRequest(callback: (request: HTTPRequest) => void): void;\n setOnWait(callback: (milliseconds: number, handlerId: number) => void): void;\n setOnGotKey(callback: (epoch: EpochInfo) => void): void;\n setOnUseKey(callback: (epoch: number) => void): void;\n setOnLeader(callback: () => void): void;\n setOnPurgeBefore(callback: (epoch: number) => void): void;\n setOnEvicted(callback: () => void): void;\n setOnAddRoster(callback: (added: RosterMember[]) => void): void;\n setOnRemoveRoster(callback: (removed: string[]) => void): void;\n setOnE2eeVersion(callback: (version: number) => void): void;\n setOnMissingCommit(callback: (mlsEpoch: number, useKeyEpoch: number) => void): void;\n setOnLog(callback: (level: number, message: string) => void): void;\n\n completeHttpRequest(\n handlerId: number,\n success: boolean,\n body: Uint8Array,\n errorCode: number,\n errorMessage: string\n ): void;\n completeWait(handlerId: number): void;\n}\n\nexport interface ModuleInstance {\n WebE2EE: new () => WebE2EEInstance;\n}\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["wasm.d.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-2026 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport type {E2eeIdentityType, E2eeValidationResult} from './types';\n\n/**\n * Raw WebAssembly (WebE2EE) boundary types. These mirror the emscripten-generated MLS engine API\n * exactly (including its snake_case fields); the SDK-facing camelCase shapes live in types.ts.\n */\n\nexport interface Transaction {\n id: string;\n type: 'join' | 'update';\n}\n\nexport interface JoinSuccessResult {\n status: 'join_success';\n epoch: number;\n base_key: Uint8Array;\n index: number;\n index_bits: number;\n sec_code: string;\n sframe_cipher_suite: number;\n sframe_epoch_bits: number;\n}\n\nexport interface UpdateSuccessResult {\n status: 'update_success';\n}\n\nexport interface TransactionFailureResult {\n status: 'failure';\n reason:\n | 'timeout'\n | 'join_failure'\n | 'tree_fetch_failure'\n | 'commit_fetch_failure'\n | 'update_override';\n}\n\nexport type TransactionResult = JoinSuccessResult | UpdateSuccessResult | TransactionFailureResult;\n\nexport interface HTTPRequest {\n url: string;\n /** A view into WASM memory (`typed_memory_view`); only valid during the callback — copy before async use. */\n body: Uint8Array;\n handlerId: number;\n}\n\nexport interface EpochInfo {\n epoch: number;\n base_key: Uint8Array;\n index: number;\n index_bits: number;\n sec_code: string;\n}\n\nexport interface CertificateInfo {\n primary_name: string;\n common_name: string;\n organization_name: string;\n email_addresses: string[];\n domain_names: string[];\n not_before: number;\n not_after: number;\n signature_algorithm: string;\n public_key_algorithm: string;\n identity_type?: E2eeIdentityType;\n der: Uint8Array;\n}\n\nexport interface CertificateResult {\n result: E2eeValidationResult;\n member_certs: CertificateInfo[];\n failed_cert_index?: number;\n}\n\nexport interface RosterMember {\n url: string;\n display_name: string;\n device_type: string;\n validation_result: E2eeValidationResult;\n x509?: CertificateResult[];\n}\n\nexport interface WebE2EEInstance {\n delete(): void;\n\n initialize(\n participantId: string,\n deviceUrl: string,\n deviceType: string,\n correlationId: string,\n displayName: string,\n serviceUrl: string\n ): void;\n\n addX509Credential(privateKey: Uint8Array, certChain: Uint8Array[]): void;\n setTrustAnchors(\n webexCaRoots: string,\n domainNameRoots: string,\n userIdentityRoots: string,\n domainNameRootsP7b: Uint8Array\n ): void;\n\n join(): void;\n leave(): void;\n joined(): boolean;\n securityCode(): string;\n sessionSecret(): Uint8Array | null;\n contentKey(): Uint8Array | null;\n contentKeyId(): string;\n roster(): RosterMember[];\n handle(event: Uint8Array): void;\n isLeader(): boolean;\n /**\n * Used by backend services such as Homer; client SDKs do not need to call this.\n */\n keepAlive(): void;\n llmConnected(): void;\n setLlmConnectedBeforeJoin(connected: boolean): void;\n setGzipThreshold(threshold: number): void;\n setCoalesceWindow(milliseconds: number): void;\n setJoinTimeout(milliseconds: number): void;\n setPurgeKeysTimeout(milliseconds: number): void;\n\n setOnNewTransaction(callback: ((transaction: Transaction) => void) | null): void;\n setOnCompleteTransaction(\n callback: ((id: string, result: TransactionResult) => void) | null\n ): void;\n setOnHttpRequest(callback: ((request: HTTPRequest) => void) | null): void;\n setOnWait(callback: ((milliseconds: number, handlerId: number) => void) | null): void;\n setOnGotKey(callback: ((epoch: EpochInfo) => void) | null): void;\n setOnUseKey(callback: ((epoch: number) => void) | null): void;\n setOnLeader(callback: (() => void) | null): void;\n setOnPurgeBefore(callback: ((epoch: number) => void) | null): void;\n setOnEvicted(callback: (() => void) | null): void;\n setOnAddRoster(callback: ((added: RosterMember[]) => void) | null): void;\n setOnRemoveRoster(callback: ((removed: string[]) => void) | null): void;\n setOnE2eeVersion(callback: ((version: number) => void) | null): void;\n setOnMissingCommit(callback: ((mlsEpoch: number, useKeyEpoch: number) => void) | null): void;\n setOnLog(callback: ((level: number, message: string) => void) | null): void;\n\n completeHttpRequest(\n handlerId: number,\n success: boolean,\n body: Uint8Array,\n errorCode: number,\n errorMessage: string\n ): void;\n completeWait(handlerId: number): void;\n}\n\nexport interface ModuleInstance {\n WebE2EE: new () => WebE2EEInstance;\n}\n"],"mappings":"","ignoreList":[]}
|