@webex/plugin-meetings 3.13.0-next.6 → 3.13.0-next.7
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/config.js +1 -1
- package/dist/e2ee/E2eeSignaling.js +200 -0
- package/dist/e2ee/E2eeSignaling.js.map +1 -0
- package/dist/e2ee/MediaEncryptionService.js +75 -0
- package/dist/e2ee/MediaEncryptionService.js.map +1 -0
- package/dist/interpretation/index.js +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/types/e2ee/E2eeSignaling.d.ts +94 -0
- package/dist/types/e2ee/MediaEncryptionService.d.ts +27 -0
- package/dist/webinar/index.js +1 -1
- package/package.json +1 -1
- package/src/e2ee/E2eeSignaling.ts +215 -0
- package/src/e2ee/MediaEncryptionService.ts +41 -0
- package/test/unit/spec/e2ee/E2eeSignaling.ts +172 -0
- package/test/unit/spec/e2ee/MediaEncryptionService.ts +43 -0
|
@@ -191,7 +191,7 @@ var AIEnableRequest = _webexCore.WebexPlugin.extend({
|
|
|
191
191
|
method: _constants.HTTP_VERBS.PUT
|
|
192
192
|
});
|
|
193
193
|
},
|
|
194
|
-
version: "3.13.0-next.
|
|
194
|
+
version: "3.13.0-next.7"
|
|
195
195
|
});
|
|
196
196
|
var _default = exports.default = AIEnableRequest;
|
|
197
197
|
//# sourceMappingURL=index.js.map
|
package/dist/breakouts/index.js
CHANGED
|
@@ -1230,7 +1230,7 @@ var Breakouts = _webexCore.WebexPlugin.extend({
|
|
|
1230
1230
|
this.trigger(_constants.BREAKOUTS.EVENTS.ASK_RETURN_TO_MAIN);
|
|
1231
1231
|
}
|
|
1232
1232
|
},
|
|
1233
|
-
version: "3.13.0-next.
|
|
1233
|
+
version: "3.13.0-next.7"
|
|
1234
1234
|
});
|
|
1235
1235
|
var _default = exports.default = Breakouts;
|
|
1236
1236
|
//# sourceMappingURL=index.js.map
|
package/dist/config.js
CHANGED
|
@@ -90,7 +90,7 @@ var _default = exports.default = {
|
|
|
90
90
|
enableExtmap: false,
|
|
91
91
|
enableAutomaticLLM: false,
|
|
92
92
|
enableE2ee: false,
|
|
93
|
-
assetsBaseUrl: (0, _common.getUmdAssetsBaseUrl)('plugin-meetings', "3.13.0-next.
|
|
93
|
+
assetsBaseUrl: (0, _common.getUmdAssetsBaseUrl)('plugin-meetings', "3.13.0-next.8", "3.13.0-next.7"),
|
|
94
94
|
installedOrgID: undefined,
|
|
95
95
|
multipartSitePrefixList: ['.my.', '.mydmz.', '.mybts.', '.mydev.', '.myats2.', '.myats.'],
|
|
96
96
|
experimental: {
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
|
5
|
+
_Object$defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = exports.MEDIA_ENCRYPTION_MERCURY_EVENTS = exports.LLM_ONLINE_EVENT = void 0;
|
|
9
|
+
var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
|
|
10
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
|
|
11
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
|
|
12
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
|
|
13
|
+
/*!
|
|
14
|
+
* Copyright (c) 2015-2026 Cisco Systems, Inc. See LICENSE file.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/** Source labels passed to the MLS engine for incoming signaling messages. */
|
|
18
|
+
|
|
19
|
+
/** LLM event carrying the channel's connection state. */
|
|
20
|
+
var LLM_ONLINE_EVENT = exports.LLM_ONLINE_EVENT = 'online';
|
|
21
|
+
|
|
22
|
+
/** Mercury events carrying MLS protocol messages. */
|
|
23
|
+
var MEDIA_ENCRYPTION_MERCURY_EVENTS = exports.MEDIA_ENCRYPTION_MERCURY_EVENTS = ['event:media_encryption.leader_nominated', 'event:media_encryption.welcome', 'event:media_encryption.annotated_welcome', 'event:media_encryption.multi_welcome', 'event:media_encryption.group_update', 'event:media_encryption.annotated_commit', 'event:media_encryption.large_group_update', 'event:media_encryption.use_key', 'event:media_encryption.join_request', 'event:media_encryption.leave_request', 'event:media_encryption.join_failure', 'event:media_encryption.leader_changed', 'event:media_encryption.message_segment'];
|
|
24
|
+
|
|
25
|
+
/** The subset of the MLS engine the signaling adapter drives. */
|
|
26
|
+
|
|
27
|
+
/** The subset of a mercury channel the adapter subscribes to for MLS protocol events. */
|
|
28
|
+
/**
|
|
29
|
+
* Mercury (and LLM) adapter for the MLS engine. Subscribes to this meeting's
|
|
30
|
+
* media_encryption.* events on both the LLM and mercury channels and forwards them to the engine,
|
|
31
|
+
* and tracks whether the signaling channel is connected so the engine knows when it can proceed
|
|
32
|
+
* with its join.
|
|
33
|
+
*/
|
|
34
|
+
var E2eeSignaling = exports.default = /*#__PURE__*/function () {
|
|
35
|
+
/**
|
|
36
|
+
* @param {Object} deps
|
|
37
|
+
* @param {LLMChannel} [deps.llm] - This meeting's LLM channel, when one is available.
|
|
38
|
+
* @param {IMercuryChannel} deps.mercury - The mercury channel (webex.internal.mercury).
|
|
39
|
+
* @param {Function} deps.getLocusUrl - Returns the meeting's current locus url (read live, as it
|
|
40
|
+
* can change, e.g. when moving between breakout sessions).
|
|
41
|
+
* @param {IMlsSignalingTarget} deps.session - The MLS engine to drive.
|
|
42
|
+
*/
|
|
43
|
+
function E2eeSignaling(_ref) {
|
|
44
|
+
var _this = this;
|
|
45
|
+
var llm = _ref.llm,
|
|
46
|
+
mercury = _ref.mercury,
|
|
47
|
+
getLocusUrl = _ref.getLocusUrl,
|
|
48
|
+
session = _ref.session;
|
|
49
|
+
(0, _classCallCheck2.default)(this, E2eeSignaling);
|
|
50
|
+
(0, _defineProperty2.default)(this, "llm", void 0);
|
|
51
|
+
(0, _defineProperty2.default)(this, "mercury", void 0);
|
|
52
|
+
(0, _defineProperty2.default)(this, "getLocusUrl", void 0);
|
|
53
|
+
(0, _defineProperty2.default)(this, "session", void 0);
|
|
54
|
+
(0, _defineProperty2.default)(this, "started", false);
|
|
55
|
+
/**
|
|
56
|
+
* @param {Object} envelope - The mercury event envelope from the LLM channel.
|
|
57
|
+
* @returns {void}
|
|
58
|
+
*/
|
|
59
|
+
(0, _defineProperty2.default)(this, "onLlmEvent", function (envelope) {
|
|
60
|
+
_this.forwardEvent(envelope, 'llm');
|
|
61
|
+
});
|
|
62
|
+
/**
|
|
63
|
+
* @param {Object} envelope - The mercury event envelope from the mercury channel.
|
|
64
|
+
* @returns {void}
|
|
65
|
+
*/
|
|
66
|
+
(0, _defineProperty2.default)(this, "onMercuryEvent", function (envelope) {
|
|
67
|
+
_this.forwardEvent(envelope, 'mercury');
|
|
68
|
+
});
|
|
69
|
+
/**
|
|
70
|
+
* @returns {void}
|
|
71
|
+
*/
|
|
72
|
+
(0, _defineProperty2.default)(this, "onLlmOnline", function () {
|
|
73
|
+
if (_this.isLlmOnlineForThisSession()) {
|
|
74
|
+
_this.session.llmConnected();
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
this.llm = llm;
|
|
78
|
+
this.mercury = mercury;
|
|
79
|
+
this.getLocusUrl = getLocusUrl;
|
|
80
|
+
this.session = session;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Subscribes to MLS mercury events and wires up connection tracking. Idempotent.
|
|
85
|
+
* @returns {void}
|
|
86
|
+
*/
|
|
87
|
+
return (0, _createClass2.default)(E2eeSignaling, [{
|
|
88
|
+
key: "start",
|
|
89
|
+
value: function start() {
|
|
90
|
+
var _this2 = this;
|
|
91
|
+
if (this.started) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
this.started = true;
|
|
95
|
+
MEDIA_ENCRYPTION_MERCURY_EVENTS.forEach(function (event) {
|
|
96
|
+
_this2.mercury.on(event, _this2.onMercuryEvent);
|
|
97
|
+
});
|
|
98
|
+
if (this.llm && this.isLlmOnlineForThisSession()) {
|
|
99
|
+
this.session.setLlmConnectedBeforeJoin(true);
|
|
100
|
+
}
|
|
101
|
+
this.subscribeToLlmEvents();
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Removes all subscriptions. Idempotent.
|
|
106
|
+
* @returns {void}
|
|
107
|
+
*/
|
|
108
|
+
}, {
|
|
109
|
+
key: "stop",
|
|
110
|
+
value: function stop() {
|
|
111
|
+
var _this3 = this;
|
|
112
|
+
if (!this.started) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
this.started = false;
|
|
116
|
+
MEDIA_ENCRYPTION_MERCURY_EVENTS.forEach(function (event) {
|
|
117
|
+
_this3.mercury.off(event, _this3.onMercuryEvent);
|
|
118
|
+
});
|
|
119
|
+
this.unsubscribeFromLlmEvents();
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Replaces the meeting-owned LLM channel after the meeting reconnects its data channel.
|
|
124
|
+
* @param {LLMChannel} [llm]
|
|
125
|
+
* @returns {void}
|
|
126
|
+
*/
|
|
127
|
+
}, {
|
|
128
|
+
key: "setLlmChannel",
|
|
129
|
+
value: function setLlmChannel(llm) {
|
|
130
|
+
if (this.llm === llm) {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
this.unsubscribeFromLlmEvents();
|
|
134
|
+
this.llm = llm;
|
|
135
|
+
if (!this.started || !this.llm) {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
this.subscribeToLlmEvents();
|
|
139
|
+
if (this.isLlmOnlineForThisSession()) {
|
|
140
|
+
this.session.llmConnected();
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Forwards a signaling envelope to the engine, tagging which channel it came from.
|
|
146
|
+
* @param {Object} envelope - The mercury event envelope.
|
|
147
|
+
* @param {E2eeSignalingSource} source - The channel the envelope arrived on.
|
|
148
|
+
* @returns {void}
|
|
149
|
+
*/
|
|
150
|
+
}, {
|
|
151
|
+
key: "forwardEvent",
|
|
152
|
+
value: function forwardEvent(envelope, source) {
|
|
153
|
+
var _envelope$data;
|
|
154
|
+
var eventData = (_envelope$data = envelope === null || envelope === void 0 ? void 0 : envelope.data) !== null && _envelope$data !== void 0 ? _envelope$data : envelope;
|
|
155
|
+
var bytes = new TextEncoder().encode((0, _stringify.default)(eventData));
|
|
156
|
+
this.session.handleEvent(new Uint8Array(bytes), source);
|
|
157
|
+
}
|
|
158
|
+
}, {
|
|
159
|
+
key: "subscribeToLlmEvents",
|
|
160
|
+
value: /** @returns {void} */
|
|
161
|
+
function subscribeToLlmEvents() {
|
|
162
|
+
var _this4 = this;
|
|
163
|
+
if (!this.started || !this.llm) {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
MEDIA_ENCRYPTION_MERCURY_EVENTS.forEach(function (event) {
|
|
167
|
+
var _this4$llm;
|
|
168
|
+
(_this4$llm = _this4.llm) === null || _this4$llm === void 0 ? void 0 : _this4$llm.on(event, _this4.onLlmEvent);
|
|
169
|
+
});
|
|
170
|
+
if (!this.isLlmOnlineForThisSession()) {
|
|
171
|
+
this.llm.on(LLM_ONLINE_EVENT, this.onLlmOnline);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/** @returns {void} */
|
|
176
|
+
}, {
|
|
177
|
+
key: "unsubscribeFromLlmEvents",
|
|
178
|
+
value: function unsubscribeFromLlmEvents() {
|
|
179
|
+
var _this$llm,
|
|
180
|
+
_this5 = this;
|
|
181
|
+
(_this$llm = this.llm) === null || _this$llm === void 0 ? void 0 : _this$llm.off(LLM_ONLINE_EVENT, this.onLlmOnline);
|
|
182
|
+
MEDIA_ENCRYPTION_MERCURY_EVENTS.forEach(function (event) {
|
|
183
|
+
var _this5$llm;
|
|
184
|
+
(_this5$llm = _this5.llm) === null || _this5$llm === void 0 ? void 0 : _this5$llm.off(event, _this5.onLlmEvent);
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* @returns {boolean} whether the LLM is connected for this specific session (locus-url matched).
|
|
190
|
+
*/
|
|
191
|
+
}, {
|
|
192
|
+
key: "isLlmOnlineForThisSession",
|
|
193
|
+
value: function isLlmOnlineForThisSession() {
|
|
194
|
+
var _this$llm2;
|
|
195
|
+
var sessionLocusUrl = this.getLocusUrl();
|
|
196
|
+
return !!sessionLocusUrl && !!((_this$llm2 = this.llm) !== null && _this$llm2 !== void 0 && _this$llm2.isConnected()) && sessionLocusUrl === this.llm.getLocusUrl();
|
|
197
|
+
}
|
|
198
|
+
}]);
|
|
199
|
+
}();
|
|
200
|
+
//# sourceMappingURL=E2eeSignaling.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["LLM_ONLINE_EVENT","exports","MEDIA_ENCRYPTION_MERCURY_EVENTS","E2eeSignaling","default","_ref","_this","llm","mercury","getLocusUrl","session","_classCallCheck2","_defineProperty2","envelope","forwardEvent","isLlmOnlineForThisSession","llmConnected","_createClass2","key","value","start","_this2","started","forEach","event","on","onMercuryEvent","setLlmConnectedBeforeJoin","subscribeToLlmEvents","stop","_this3","off","unsubscribeFromLlmEvents","setLlmChannel","source","_envelope$data","eventData","data","bytes","TextEncoder","encode","_stringify","handleEvent","Uint8Array","_this4","_this4$llm","onLlmEvent","onLlmOnline","_this$llm","_this5","_this5$llm","_this$llm2","sessionLocusUrl","isConnected"],"sources":["E2eeSignaling.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-2026 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport type LLMChannel from '@webex/internal-plugin-llm';\n\n/** Source labels passed to the MLS engine for incoming signaling messages. */\ntype E2eeSignalingSource = 'llm' | 'mercury';\n\n/** LLM event carrying the channel's connection state. */\nexport const LLM_ONLINE_EVENT = 'online';\n\n/** Mercury events carrying MLS protocol messages. */\nexport const MEDIA_ENCRYPTION_MERCURY_EVENTS = [\n 'event:media_encryption.leader_nominated',\n 'event:media_encryption.welcome',\n 'event:media_encryption.annotated_welcome',\n 'event:media_encryption.multi_welcome',\n 'event:media_encryption.group_update',\n 'event:media_encryption.annotated_commit',\n 'event:media_encryption.large_group_update',\n 'event:media_encryption.use_key',\n 'event:media_encryption.join_request',\n 'event:media_encryption.leave_request',\n 'event:media_encryption.join_failure',\n 'event:media_encryption.leader_changed',\n 'event:media_encryption.message_segment',\n];\n\n/** The subset of the MLS engine the signaling adapter drives. */\nexport interface IMlsSignalingTarget {\n handleEvent(bytes: Uint8Array, source: E2eeSignalingSource): void;\n setLlmConnectedBeforeJoin(connected: boolean): void;\n llmConnected(): void;\n}\n\n/** The subset of a mercury channel the adapter subscribes to for MLS protocol events. */\nexport interface IMercuryChannel {\n on(event: string, handler: (envelope: any) => void): void;\n off(event: string, handler: (envelope: any) => void): void;\n}\n\n/**\n * Mercury (and LLM) adapter for the MLS engine. Subscribes to this meeting's\n * media_encryption.* events on both the LLM and mercury channels and forwards them to the engine,\n * and tracks whether the signaling channel is connected so the engine knows when it can proceed\n * with its join.\n */\nexport default class E2eeSignaling {\n private llm?: LLMChannel;\n\n private readonly mercury: IMercuryChannel;\n\n private readonly getLocusUrl: () => string | undefined;\n\n private readonly session: IMlsSignalingTarget;\n\n private started = false;\n\n /**\n * @param {Object} deps\n * @param {LLMChannel} [deps.llm] - This meeting's LLM channel, when one is available.\n * @param {IMercuryChannel} deps.mercury - The mercury channel (webex.internal.mercury).\n * @param {Function} deps.getLocusUrl - Returns the meeting's current locus url (read live, as it\n * can change, e.g. when moving between breakout sessions).\n * @param {IMlsSignalingTarget} deps.session - The MLS engine to drive.\n */\n constructor({\n llm,\n mercury,\n getLocusUrl,\n session,\n }: {\n llm?: LLMChannel;\n mercury: IMercuryChannel;\n getLocusUrl: () => string | undefined;\n session: IMlsSignalingTarget;\n }) {\n this.llm = llm;\n this.mercury = mercury;\n this.getLocusUrl = getLocusUrl;\n this.session = session;\n }\n\n /**\n * Subscribes to MLS mercury events and wires up connection tracking. Idempotent.\n * @returns {void}\n */\n start(): void {\n if (this.started) {\n return;\n }\n this.started = true;\n\n MEDIA_ENCRYPTION_MERCURY_EVENTS.forEach((event) => {\n this.mercury.on(event, this.onMercuryEvent);\n });\n\n if (this.llm && this.isLlmOnlineForThisSession()) {\n this.session.setLlmConnectedBeforeJoin(true);\n }\n this.subscribeToLlmEvents();\n }\n\n /**\n * Removes all subscriptions. Idempotent.\n * @returns {void}\n */\n stop(): void {\n if (!this.started) {\n return;\n }\n this.started = false;\n\n MEDIA_ENCRYPTION_MERCURY_EVENTS.forEach((event) => {\n this.mercury.off(event, this.onMercuryEvent);\n });\n this.unsubscribeFromLlmEvents();\n }\n\n /**\n * Replaces the meeting-owned LLM channel after the meeting reconnects its data channel.\n * @param {LLMChannel} [llm]\n * @returns {void}\n */\n setLlmChannel(llm?: LLMChannel): void {\n if (this.llm === llm) {\n return;\n }\n\n this.unsubscribeFromLlmEvents();\n this.llm = llm;\n\n if (!this.started || !this.llm) {\n return;\n }\n\n this.subscribeToLlmEvents();\n\n if (this.isLlmOnlineForThisSession()) {\n this.session.llmConnected();\n }\n }\n\n /**\n * Forwards a signaling envelope to the engine, tagging which channel it came from.\n * @param {Object} envelope - The mercury event envelope.\n * @param {E2eeSignalingSource} source - The channel the envelope arrived on.\n * @returns {void}\n */\n private forwardEvent(envelope: any, source: E2eeSignalingSource): void {\n const eventData = envelope?.data ?? envelope;\n const bytes = new TextEncoder().encode(JSON.stringify(eventData));\n\n this.session.handleEvent(new Uint8Array(bytes), source);\n }\n\n /**\n * @param {Object} envelope - The mercury event envelope from the LLM channel.\n * @returns {void}\n */\n private onLlmEvent = (envelope: any): void => {\n this.forwardEvent(envelope, 'llm');\n };\n\n /**\n * @param {Object} envelope - The mercury event envelope from the mercury channel.\n * @returns {void}\n */\n private onMercuryEvent = (envelope: any): void => {\n this.forwardEvent(envelope, 'mercury');\n };\n\n /**\n * @returns {void}\n */\n private onLlmOnline = (): void => {\n if (this.isLlmOnlineForThisSession()) {\n this.session.llmConnected();\n }\n };\n\n /** @returns {void} */\n private subscribeToLlmEvents(): void {\n if (!this.started || !this.llm) {\n return;\n }\n\n MEDIA_ENCRYPTION_MERCURY_EVENTS.forEach((event) => {\n this.llm?.on(event, this.onLlmEvent);\n });\n if (!this.isLlmOnlineForThisSession()) {\n this.llm.on(LLM_ONLINE_EVENT, this.onLlmOnline);\n }\n }\n\n /** @returns {void} */\n private unsubscribeFromLlmEvents(): void {\n this.llm?.off(LLM_ONLINE_EVENT, this.onLlmOnline);\n MEDIA_ENCRYPTION_MERCURY_EVENTS.forEach((event) => {\n this.llm?.off(event, this.onLlmEvent);\n });\n }\n\n /**\n * @returns {boolean} whether the LLM is connected for this specific session (locus-url matched).\n */\n private isLlmOnlineForThisSession(): boolean {\n const sessionLocusUrl = this.getLocusUrl();\n\n return (\n !!sessionLocusUrl && !!this.llm?.isConnected() && sessionLocusUrl === this.llm.getLocusUrl()\n );\n }\n}\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
|
5
|
+
_Object$defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
|
|
10
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
|
|
11
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
|
|
12
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
|
|
13
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
|
|
14
|
+
/*!
|
|
15
|
+
* Copyright (c) 2015-2026 Cisco Systems, Inc. See LICENSE file.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
var MEDIA_ENCRYPTION_SERVICE = 'media-encryption';
|
|
19
|
+
|
|
20
|
+
/** The bound webex.request function shape consumed by this adapter. */
|
|
21
|
+
/**
|
|
22
|
+
* Routes the MLS engine's protocol HTTP requests to the media-encryption service via
|
|
23
|
+
* webex.request. Bodies are plain JS objects; MLS owns the conversion to/from the engine's bytes.
|
|
24
|
+
* Requests use standard webex auth (Authorization bearer token) — no custom header is needed.
|
|
25
|
+
*/
|
|
26
|
+
var MediaEncryptionService = exports.default = /*#__PURE__*/function () {
|
|
27
|
+
/**
|
|
28
|
+
* @param {Object} deps
|
|
29
|
+
* @param {WebexRequestMethod} deps.webexRequest - The (bound) webex.request method.
|
|
30
|
+
*/
|
|
31
|
+
function MediaEncryptionService(_ref) {
|
|
32
|
+
var webexRequest = _ref.webexRequest;
|
|
33
|
+
(0, _classCallCheck2.default)(this, MediaEncryptionService);
|
|
34
|
+
(0, _defineProperty2.default)(this, "webexRequest", void 0);
|
|
35
|
+
this.webexRequest = webexRequest;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @param {string} url - The absolute request URL provided by the engine.
|
|
40
|
+
* @param {unknown} body - Request payload, sent as JSON.
|
|
41
|
+
* @returns {Promise<unknown>} The JSON-parsed response body.
|
|
42
|
+
*/
|
|
43
|
+
return (0, _createClass2.default)(MediaEncryptionService, [{
|
|
44
|
+
key: "request",
|
|
45
|
+
value: (function () {
|
|
46
|
+
var _request = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(url, body) {
|
|
47
|
+
var _yield$this$webexRequ, responseBody;
|
|
48
|
+
return _regenerator.default.wrap(function (_context) {
|
|
49
|
+
while (1) switch (_context.prev = _context.next) {
|
|
50
|
+
case 0:
|
|
51
|
+
_context.next = 1;
|
|
52
|
+
return this.webexRequest({
|
|
53
|
+
method: 'POST',
|
|
54
|
+
service: MEDIA_ENCRYPTION_SERVICE,
|
|
55
|
+
url: url,
|
|
56
|
+
body: body
|
|
57
|
+
});
|
|
58
|
+
case 1:
|
|
59
|
+
_yield$this$webexRequ = _context.sent;
|
|
60
|
+
responseBody = _yield$this$webexRequ.body;
|
|
61
|
+
return _context.abrupt("return", responseBody);
|
|
62
|
+
case 2:
|
|
63
|
+
case "end":
|
|
64
|
+
return _context.stop();
|
|
65
|
+
}
|
|
66
|
+
}, _callee, this);
|
|
67
|
+
}));
|
|
68
|
+
function request(_x, _x2) {
|
|
69
|
+
return _request.apply(this, arguments);
|
|
70
|
+
}
|
|
71
|
+
return request;
|
|
72
|
+
}())
|
|
73
|
+
}]);
|
|
74
|
+
}();
|
|
75
|
+
//# sourceMappingURL=MediaEncryptionService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["MEDIA_ENCRYPTION_SERVICE","MediaEncryptionService","exports","default","_ref","webexRequest","_classCallCheck2","_defineProperty2","_createClass2","key","value","_request","_asyncToGenerator2","_regenerator","mark","_callee","url","body","_yield$this$webexRequ","responseBody","wrap","_context","prev","next","method","service","sent","abrupt","stop","request","_x","_x2","apply","arguments"],"sources":["MediaEncryptionService.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-2026 Cisco Systems, Inc. See LICENSE file.\n */\n\nconst MEDIA_ENCRYPTION_SERVICE = 'media-encryption';\n\n/** The bound webex.request function shape consumed by this adapter. */\ntype WebexRequestMethod = (options: Record<string, any>) => Promise<any>;\n\n/**\n * Routes the MLS engine's protocol HTTP requests to the media-encryption service via\n * webex.request. Bodies are plain JS objects; MLS owns the conversion to/from the engine's bytes.\n * Requests use standard webex auth (Authorization bearer token) — no custom header is needed.\n */\nexport default class MediaEncryptionService {\n private readonly webexRequest: WebexRequestMethod;\n\n /**\n * @param {Object} deps\n * @param {WebexRequestMethod} deps.webexRequest - The (bound) webex.request method.\n */\n constructor({webexRequest}: {webexRequest: WebexRequestMethod}) {\n this.webexRequest = webexRequest;\n }\n\n /**\n * @param {string} url - The absolute request URL provided by the engine.\n * @param {unknown} body - Request payload, sent as JSON.\n * @returns {Promise<unknown>} The JSON-parsed response body.\n */\n async request(url: string, body: unknown): Promise<unknown> {\n const {body: responseBody} = await this.webexRequest({\n method: 'POST',\n service: MEDIA_ENCRYPTION_SERVICE,\n url,\n body,\n });\n\n return responseBody;\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAAA;AACA;AACA;;AAEA,IAAMA,wBAAwB,GAAG,kBAAkB;;AAEnD;AAGA;AACA;AACA;AACA;AACA;AAJA,IAKqBC,sBAAsB,GAAAC,OAAA,CAAAC,OAAA;EAGzC;AACF;AACA;AACA;EACE,SAAAF,uBAAAG,IAAA,EAAgE;IAAA,IAAnDC,YAAY,GAAAD,IAAA,CAAZC,YAAY;IAAA,IAAAC,gBAAA,CAAAH,OAAA,QAAAF,sBAAA;IAAA,IAAAM,gBAAA,CAAAJ,OAAA;IACvB,IAAI,CAACE,YAAY,GAAGA,YAAY;EAClC;;EAEA;AACF;AACA;AACA;AACA;EAJE,WAAAG,aAAA,CAAAL,OAAA,EAAAF,sBAAA;IAAAQ,GAAA;IAAAC,KAAA;MAAA,IAAAC,QAAA,OAAAC,kBAAA,CAAAT,OAAA,eAAAU,YAAA,CAAAV,OAAA,CAAAW,IAAA,CAKA,SAAAC,QAAcC,GAAW,EAAEC,IAAa;QAAA,IAAAC,qBAAA,EAAAC,YAAA;QAAA,OAAAN,YAAA,CAAAV,OAAA,CAAAiB,IAAA,WAAAC,QAAA;UAAA,kBAAAA,QAAA,CAAAC,IAAA,GAAAD,QAAA,CAAAE,IAAA;YAAA;cAAAF,QAAA,CAAAE,IAAA;cAAA,OACH,IAAI,CAAClB,YAAY,CAAC;gBACnDmB,MAAM,EAAE,MAAM;gBACdC,OAAO,EAAEzB,wBAAwB;gBACjCgB,GAAG,EAAHA,GAAG;gBACHC,IAAI,EAAJA;cACF,CAAC,CAAC;YAAA;cAAAC,qBAAA,GAAAG,QAAA,CAAAK,IAAA;cALWP,YAAY,GAAAD,qBAAA,CAAlBD,IAAI;cAAA,OAAAI,QAAA,CAAAM,MAAA,WAOJR,YAAY;YAAA;YAAA;cAAA,OAAAE,QAAA,CAAAO,IAAA;UAAA;QAAA,GAAAb,OAAA;MAAA,CACpB;MAAA,SATKc,OAAOA,CAAAC,EAAA,EAAAC,GAAA;QAAA,OAAApB,QAAA,CAAAqB,KAAA,OAAAC,SAAA;MAAA;MAAA,OAAPJ,OAAO;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -415,7 +415,7 @@ var SimultaneousInterpretation = _webexCore.WebexPlugin.extend({
|
|
|
415
415
|
throw error;
|
|
416
416
|
});
|
|
417
417
|
},
|
|
418
|
-
version: "3.13.0-next.
|
|
418
|
+
version: "3.13.0-next.7"
|
|
419
419
|
});
|
|
420
420
|
var _default = exports.default = SimultaneousInterpretation;
|
|
421
421
|
//# sourceMappingURL=index.js.map
|
|
@@ -18,7 +18,7 @@ var SILanguage = _webexCore.WebexPlugin.extend({
|
|
|
18
18
|
languageCode: 'number',
|
|
19
19
|
languageName: 'string'
|
|
20
20
|
},
|
|
21
|
-
version: "3.13.0-next.
|
|
21
|
+
version: "3.13.0-next.7"
|
|
22
22
|
});
|
|
23
23
|
var _default = exports.default = SILanguage;
|
|
24
24
|
//# sourceMappingURL=siLanguage.js.map
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2015-2026 Cisco Systems, Inc. See LICENSE file.
|
|
3
|
+
*/
|
|
4
|
+
import type LLMChannel from '@webex/internal-plugin-llm';
|
|
5
|
+
/** Source labels passed to the MLS engine for incoming signaling messages. */
|
|
6
|
+
type E2eeSignalingSource = 'llm' | 'mercury';
|
|
7
|
+
/** LLM event carrying the channel's connection state. */
|
|
8
|
+
export declare const LLM_ONLINE_EVENT = "online";
|
|
9
|
+
/** Mercury events carrying MLS protocol messages. */
|
|
10
|
+
export declare const MEDIA_ENCRYPTION_MERCURY_EVENTS: string[];
|
|
11
|
+
/** The subset of the MLS engine the signaling adapter drives. */
|
|
12
|
+
export interface IMlsSignalingTarget {
|
|
13
|
+
handleEvent(bytes: Uint8Array, source: E2eeSignalingSource): void;
|
|
14
|
+
setLlmConnectedBeforeJoin(connected: boolean): void;
|
|
15
|
+
llmConnected(): void;
|
|
16
|
+
}
|
|
17
|
+
/** The subset of a mercury channel the adapter subscribes to for MLS protocol events. */
|
|
18
|
+
export interface IMercuryChannel {
|
|
19
|
+
on(event: string, handler: (envelope: any) => void): void;
|
|
20
|
+
off(event: string, handler: (envelope: any) => void): void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Mercury (and LLM) adapter for the MLS engine. Subscribes to this meeting's
|
|
24
|
+
* media_encryption.* events on both the LLM and mercury channels and forwards them to the engine,
|
|
25
|
+
* and tracks whether the signaling channel is connected so the engine knows when it can proceed
|
|
26
|
+
* with its join.
|
|
27
|
+
*/
|
|
28
|
+
export default class E2eeSignaling {
|
|
29
|
+
private llm?;
|
|
30
|
+
private readonly mercury;
|
|
31
|
+
private readonly getLocusUrl;
|
|
32
|
+
private readonly session;
|
|
33
|
+
private started;
|
|
34
|
+
/**
|
|
35
|
+
* @param {Object} deps
|
|
36
|
+
* @param {LLMChannel} [deps.llm] - This meeting's LLM channel, when one is available.
|
|
37
|
+
* @param {IMercuryChannel} deps.mercury - The mercury channel (webex.internal.mercury).
|
|
38
|
+
* @param {Function} deps.getLocusUrl - Returns the meeting's current locus url (read live, as it
|
|
39
|
+
* can change, e.g. when moving between breakout sessions).
|
|
40
|
+
* @param {IMlsSignalingTarget} deps.session - The MLS engine to drive.
|
|
41
|
+
*/
|
|
42
|
+
constructor({ llm, mercury, getLocusUrl, session, }: {
|
|
43
|
+
llm?: LLMChannel;
|
|
44
|
+
mercury: IMercuryChannel;
|
|
45
|
+
getLocusUrl: () => string | undefined;
|
|
46
|
+
session: IMlsSignalingTarget;
|
|
47
|
+
});
|
|
48
|
+
/**
|
|
49
|
+
* Subscribes to MLS mercury events and wires up connection tracking. Idempotent.
|
|
50
|
+
* @returns {void}
|
|
51
|
+
*/
|
|
52
|
+
start(): void;
|
|
53
|
+
/**
|
|
54
|
+
* Removes all subscriptions. Idempotent.
|
|
55
|
+
* @returns {void}
|
|
56
|
+
*/
|
|
57
|
+
stop(): void;
|
|
58
|
+
/**
|
|
59
|
+
* Replaces the meeting-owned LLM channel after the meeting reconnects its data channel.
|
|
60
|
+
* @param {LLMChannel} [llm]
|
|
61
|
+
* @returns {void}
|
|
62
|
+
*/
|
|
63
|
+
setLlmChannel(llm?: LLMChannel): void;
|
|
64
|
+
/**
|
|
65
|
+
* Forwards a signaling envelope to the engine, tagging which channel it came from.
|
|
66
|
+
* @param {Object} envelope - The mercury event envelope.
|
|
67
|
+
* @param {E2eeSignalingSource} source - The channel the envelope arrived on.
|
|
68
|
+
* @returns {void}
|
|
69
|
+
*/
|
|
70
|
+
private forwardEvent;
|
|
71
|
+
/**
|
|
72
|
+
* @param {Object} envelope - The mercury event envelope from the LLM channel.
|
|
73
|
+
* @returns {void}
|
|
74
|
+
*/
|
|
75
|
+
private onLlmEvent;
|
|
76
|
+
/**
|
|
77
|
+
* @param {Object} envelope - The mercury event envelope from the mercury channel.
|
|
78
|
+
* @returns {void}
|
|
79
|
+
*/
|
|
80
|
+
private onMercuryEvent;
|
|
81
|
+
/**
|
|
82
|
+
* @returns {void}
|
|
83
|
+
*/
|
|
84
|
+
private onLlmOnline;
|
|
85
|
+
/** @returns {void} */
|
|
86
|
+
private subscribeToLlmEvents;
|
|
87
|
+
/** @returns {void} */
|
|
88
|
+
private unsubscribeFromLlmEvents;
|
|
89
|
+
/**
|
|
90
|
+
* @returns {boolean} whether the LLM is connected for this specific session (locus-url matched).
|
|
91
|
+
*/
|
|
92
|
+
private isLlmOnlineForThisSession;
|
|
93
|
+
}
|
|
94
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2015-2026 Cisco Systems, Inc. See LICENSE file.
|
|
3
|
+
*/
|
|
4
|
+
/** The bound webex.request function shape consumed by this adapter. */
|
|
5
|
+
type WebexRequestMethod = (options: Record<string, any>) => Promise<any>;
|
|
6
|
+
/**
|
|
7
|
+
* Routes the MLS engine's protocol HTTP requests to the media-encryption service via
|
|
8
|
+
* webex.request. Bodies are plain JS objects; MLS owns the conversion to/from the engine's bytes.
|
|
9
|
+
* Requests use standard webex auth (Authorization bearer token) — no custom header is needed.
|
|
10
|
+
*/
|
|
11
|
+
export default class MediaEncryptionService {
|
|
12
|
+
private readonly webexRequest;
|
|
13
|
+
/**
|
|
14
|
+
* @param {Object} deps
|
|
15
|
+
* @param {WebexRequestMethod} deps.webexRequest - The (bound) webex.request method.
|
|
16
|
+
*/
|
|
17
|
+
constructor({ webexRequest }: {
|
|
18
|
+
webexRequest: WebexRequestMethod;
|
|
19
|
+
});
|
|
20
|
+
/**
|
|
21
|
+
* @param {string} url - The absolute request URL provided by the engine.
|
|
22
|
+
* @param {unknown} body - Request payload, sent as JSON.
|
|
23
|
+
* @returns {Promise<unknown>} The JSON-parsed response body.
|
|
24
|
+
*/
|
|
25
|
+
request(url: string, body: unknown): Promise<unknown>;
|
|
26
|
+
}
|
|
27
|
+
export {};
|
package/dist/webinar/index.js
CHANGED
package/package.json
CHANGED
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2015-2026 Cisco Systems, Inc. See LICENSE file.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import type LLMChannel from '@webex/internal-plugin-llm';
|
|
6
|
+
|
|
7
|
+
/** Source labels passed to the MLS engine for incoming signaling messages. */
|
|
8
|
+
type E2eeSignalingSource = 'llm' | 'mercury';
|
|
9
|
+
|
|
10
|
+
/** LLM event carrying the channel's connection state. */
|
|
11
|
+
export const LLM_ONLINE_EVENT = 'online';
|
|
12
|
+
|
|
13
|
+
/** Mercury events carrying MLS protocol messages. */
|
|
14
|
+
export const MEDIA_ENCRYPTION_MERCURY_EVENTS = [
|
|
15
|
+
'event:media_encryption.leader_nominated',
|
|
16
|
+
'event:media_encryption.welcome',
|
|
17
|
+
'event:media_encryption.annotated_welcome',
|
|
18
|
+
'event:media_encryption.multi_welcome',
|
|
19
|
+
'event:media_encryption.group_update',
|
|
20
|
+
'event:media_encryption.annotated_commit',
|
|
21
|
+
'event:media_encryption.large_group_update',
|
|
22
|
+
'event:media_encryption.use_key',
|
|
23
|
+
'event:media_encryption.join_request',
|
|
24
|
+
'event:media_encryption.leave_request',
|
|
25
|
+
'event:media_encryption.join_failure',
|
|
26
|
+
'event:media_encryption.leader_changed',
|
|
27
|
+
'event:media_encryption.message_segment',
|
|
28
|
+
];
|
|
29
|
+
|
|
30
|
+
/** The subset of the MLS engine the signaling adapter drives. */
|
|
31
|
+
export interface IMlsSignalingTarget {
|
|
32
|
+
handleEvent(bytes: Uint8Array, source: E2eeSignalingSource): void;
|
|
33
|
+
setLlmConnectedBeforeJoin(connected: boolean): void;
|
|
34
|
+
llmConnected(): void;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** The subset of a mercury channel the adapter subscribes to for MLS protocol events. */
|
|
38
|
+
export interface IMercuryChannel {
|
|
39
|
+
on(event: string, handler: (envelope: any) => void): void;
|
|
40
|
+
off(event: string, handler: (envelope: any) => void): void;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Mercury (and LLM) adapter for the MLS engine. Subscribes to this meeting's
|
|
45
|
+
* media_encryption.* events on both the LLM and mercury channels and forwards them to the engine,
|
|
46
|
+
* and tracks whether the signaling channel is connected so the engine knows when it can proceed
|
|
47
|
+
* with its join.
|
|
48
|
+
*/
|
|
49
|
+
export default class E2eeSignaling {
|
|
50
|
+
private llm?: LLMChannel;
|
|
51
|
+
|
|
52
|
+
private readonly mercury: IMercuryChannel;
|
|
53
|
+
|
|
54
|
+
private readonly getLocusUrl: () => string | undefined;
|
|
55
|
+
|
|
56
|
+
private readonly session: IMlsSignalingTarget;
|
|
57
|
+
|
|
58
|
+
private started = false;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* @param {Object} deps
|
|
62
|
+
* @param {LLMChannel} [deps.llm] - This meeting's LLM channel, when one is available.
|
|
63
|
+
* @param {IMercuryChannel} deps.mercury - The mercury channel (webex.internal.mercury).
|
|
64
|
+
* @param {Function} deps.getLocusUrl - Returns the meeting's current locus url (read live, as it
|
|
65
|
+
* can change, e.g. when moving between breakout sessions).
|
|
66
|
+
* @param {IMlsSignalingTarget} deps.session - The MLS engine to drive.
|
|
67
|
+
*/
|
|
68
|
+
constructor({
|
|
69
|
+
llm,
|
|
70
|
+
mercury,
|
|
71
|
+
getLocusUrl,
|
|
72
|
+
session,
|
|
73
|
+
}: {
|
|
74
|
+
llm?: LLMChannel;
|
|
75
|
+
mercury: IMercuryChannel;
|
|
76
|
+
getLocusUrl: () => string | undefined;
|
|
77
|
+
session: IMlsSignalingTarget;
|
|
78
|
+
}) {
|
|
79
|
+
this.llm = llm;
|
|
80
|
+
this.mercury = mercury;
|
|
81
|
+
this.getLocusUrl = getLocusUrl;
|
|
82
|
+
this.session = session;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Subscribes to MLS mercury events and wires up connection tracking. Idempotent.
|
|
87
|
+
* @returns {void}
|
|
88
|
+
*/
|
|
89
|
+
start(): void {
|
|
90
|
+
if (this.started) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
this.started = true;
|
|
94
|
+
|
|
95
|
+
MEDIA_ENCRYPTION_MERCURY_EVENTS.forEach((event) => {
|
|
96
|
+
this.mercury.on(event, this.onMercuryEvent);
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
if (this.llm && this.isLlmOnlineForThisSession()) {
|
|
100
|
+
this.session.setLlmConnectedBeforeJoin(true);
|
|
101
|
+
}
|
|
102
|
+
this.subscribeToLlmEvents();
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Removes all subscriptions. Idempotent.
|
|
107
|
+
* @returns {void}
|
|
108
|
+
*/
|
|
109
|
+
stop(): void {
|
|
110
|
+
if (!this.started) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
this.started = false;
|
|
114
|
+
|
|
115
|
+
MEDIA_ENCRYPTION_MERCURY_EVENTS.forEach((event) => {
|
|
116
|
+
this.mercury.off(event, this.onMercuryEvent);
|
|
117
|
+
});
|
|
118
|
+
this.unsubscribeFromLlmEvents();
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Replaces the meeting-owned LLM channel after the meeting reconnects its data channel.
|
|
123
|
+
* @param {LLMChannel} [llm]
|
|
124
|
+
* @returns {void}
|
|
125
|
+
*/
|
|
126
|
+
setLlmChannel(llm?: LLMChannel): void {
|
|
127
|
+
if (this.llm === llm) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
this.unsubscribeFromLlmEvents();
|
|
132
|
+
this.llm = llm;
|
|
133
|
+
|
|
134
|
+
if (!this.started || !this.llm) {
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
this.subscribeToLlmEvents();
|
|
139
|
+
|
|
140
|
+
if (this.isLlmOnlineForThisSession()) {
|
|
141
|
+
this.session.llmConnected();
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Forwards a signaling envelope to the engine, tagging which channel it came from.
|
|
147
|
+
* @param {Object} envelope - The mercury event envelope.
|
|
148
|
+
* @param {E2eeSignalingSource} source - The channel the envelope arrived on.
|
|
149
|
+
* @returns {void}
|
|
150
|
+
*/
|
|
151
|
+
private forwardEvent(envelope: any, source: E2eeSignalingSource): void {
|
|
152
|
+
const eventData = envelope?.data ?? envelope;
|
|
153
|
+
const bytes = new TextEncoder().encode(JSON.stringify(eventData));
|
|
154
|
+
|
|
155
|
+
this.session.handleEvent(new Uint8Array(bytes), source);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* @param {Object} envelope - The mercury event envelope from the LLM channel.
|
|
160
|
+
* @returns {void}
|
|
161
|
+
*/
|
|
162
|
+
private onLlmEvent = (envelope: any): void => {
|
|
163
|
+
this.forwardEvent(envelope, 'llm');
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* @param {Object} envelope - The mercury event envelope from the mercury channel.
|
|
168
|
+
* @returns {void}
|
|
169
|
+
*/
|
|
170
|
+
private onMercuryEvent = (envelope: any): void => {
|
|
171
|
+
this.forwardEvent(envelope, 'mercury');
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* @returns {void}
|
|
176
|
+
*/
|
|
177
|
+
private onLlmOnline = (): void => {
|
|
178
|
+
if (this.isLlmOnlineForThisSession()) {
|
|
179
|
+
this.session.llmConnected();
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
/** @returns {void} */
|
|
184
|
+
private subscribeToLlmEvents(): void {
|
|
185
|
+
if (!this.started || !this.llm) {
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
MEDIA_ENCRYPTION_MERCURY_EVENTS.forEach((event) => {
|
|
190
|
+
this.llm?.on(event, this.onLlmEvent);
|
|
191
|
+
});
|
|
192
|
+
if (!this.isLlmOnlineForThisSession()) {
|
|
193
|
+
this.llm.on(LLM_ONLINE_EVENT, this.onLlmOnline);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/** @returns {void} */
|
|
198
|
+
private unsubscribeFromLlmEvents(): void {
|
|
199
|
+
this.llm?.off(LLM_ONLINE_EVENT, this.onLlmOnline);
|
|
200
|
+
MEDIA_ENCRYPTION_MERCURY_EVENTS.forEach((event) => {
|
|
201
|
+
this.llm?.off(event, this.onLlmEvent);
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* @returns {boolean} whether the LLM is connected for this specific session (locus-url matched).
|
|
207
|
+
*/
|
|
208
|
+
private isLlmOnlineForThisSession(): boolean {
|
|
209
|
+
const sessionLocusUrl = this.getLocusUrl();
|
|
210
|
+
|
|
211
|
+
return (
|
|
212
|
+
!!sessionLocusUrl && !!this.llm?.isConnected() && sessionLocusUrl === this.llm.getLocusUrl()
|
|
213
|
+
);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2015-2026 Cisco Systems, Inc. See LICENSE file.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
const MEDIA_ENCRYPTION_SERVICE = 'media-encryption';
|
|
6
|
+
|
|
7
|
+
/** The bound webex.request function shape consumed by this adapter. */
|
|
8
|
+
type WebexRequestMethod = (options: Record<string, any>) => Promise<any>;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Routes the MLS engine's protocol HTTP requests to the media-encryption service via
|
|
12
|
+
* webex.request. Bodies are plain JS objects; MLS owns the conversion to/from the engine's bytes.
|
|
13
|
+
* Requests use standard webex auth (Authorization bearer token) — no custom header is needed.
|
|
14
|
+
*/
|
|
15
|
+
export default class MediaEncryptionService {
|
|
16
|
+
private readonly webexRequest: WebexRequestMethod;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @param {Object} deps
|
|
20
|
+
* @param {WebexRequestMethod} deps.webexRequest - The (bound) webex.request method.
|
|
21
|
+
*/
|
|
22
|
+
constructor({webexRequest}: {webexRequest: WebexRequestMethod}) {
|
|
23
|
+
this.webexRequest = webexRequest;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @param {string} url - The absolute request URL provided by the engine.
|
|
28
|
+
* @param {unknown} body - Request payload, sent as JSON.
|
|
29
|
+
* @returns {Promise<unknown>} The JSON-parsed response body.
|
|
30
|
+
*/
|
|
31
|
+
async request(url: string, body: unknown): Promise<unknown> {
|
|
32
|
+
const {body: responseBody} = await this.webexRequest({
|
|
33
|
+
method: 'POST',
|
|
34
|
+
service: MEDIA_ENCRYPTION_SERVICE,
|
|
35
|
+
url,
|
|
36
|
+
body,
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
return responseBody;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2015-2026 Cisco Systems, Inc. See LICENSE file.
|
|
3
|
+
*/
|
|
4
|
+
import 'jsdom-global/register';
|
|
5
|
+
import {assert} from '@webex/test-helper-chai';
|
|
6
|
+
import sinon from 'sinon';
|
|
7
|
+
import E2eeSignaling, {
|
|
8
|
+
LLM_ONLINE_EVENT,
|
|
9
|
+
MEDIA_ENCRYPTION_MERCURY_EVENTS,
|
|
10
|
+
} from '../../../../src/e2ee/E2eeSignaling';
|
|
11
|
+
|
|
12
|
+
describe('plugin-meetings', () => {
|
|
13
|
+
describe('E2eeSignaling', () => {
|
|
14
|
+
let session;
|
|
15
|
+
let llm;
|
|
16
|
+
let mercury;
|
|
17
|
+
let signaling;
|
|
18
|
+
|
|
19
|
+
beforeEach(() => {
|
|
20
|
+
llm = {
|
|
21
|
+
on: sinon.stub(),
|
|
22
|
+
off: sinon.stub(),
|
|
23
|
+
isConnected: sinon.stub().returns(false),
|
|
24
|
+
getLocusUrl: sinon.stub().returns('locus-1'),
|
|
25
|
+
};
|
|
26
|
+
mercury = {
|
|
27
|
+
on: sinon.stub(),
|
|
28
|
+
off: sinon.stub(),
|
|
29
|
+
};
|
|
30
|
+
session = {
|
|
31
|
+
handleEvent: sinon.stub(),
|
|
32
|
+
setLlmConnectedBeforeJoin: sinon.stub(),
|
|
33
|
+
llmConnected: sinon.stub(),
|
|
34
|
+
};
|
|
35
|
+
signaling = new E2eeSignaling({llm, mercury, getLocusUrl: () => 'locus-1', session});
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
afterEach(() => {
|
|
39
|
+
sinon.restore();
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it('subscribes to every mercury event on start', () => {
|
|
43
|
+
signaling.start();
|
|
44
|
+
|
|
45
|
+
MEDIA_ENCRYPTION_MERCURY_EVENTS.forEach((event) => {
|
|
46
|
+
assert.calledWith(llm.on, event, sinon.match.func);
|
|
47
|
+
assert.calledWith(mercury.on, event, sinon.match.func);
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('forwards mercury event data to the session as JSON bytes, tagged with the llm source', () => {
|
|
52
|
+
signaling.start();
|
|
53
|
+
|
|
54
|
+
const handler = llm.on.getCall(0).args[1];
|
|
55
|
+
|
|
56
|
+
handler({data: {foo: 'bar'}});
|
|
57
|
+
|
|
58
|
+
assert.calledOnce(session.handleEvent);
|
|
59
|
+
const [bytes, source] = session.handleEvent.firstCall.args;
|
|
60
|
+
|
|
61
|
+
assert.instanceOf(bytes, Uint8Array);
|
|
62
|
+
assert.deepEqual(JSON.parse(new TextDecoder().decode(bytes)), {foo: 'bar'});
|
|
63
|
+
assert.equal(source, 'llm');
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it('forwards events coming from the mercury channel to the session, tagged with the mercury source', () => {
|
|
67
|
+
signaling.start();
|
|
68
|
+
|
|
69
|
+
const handler = mercury.on.getCall(0).args[1];
|
|
70
|
+
|
|
71
|
+
handler({data: {foo: 'baz'}});
|
|
72
|
+
|
|
73
|
+
assert.calledOnce(session.handleEvent);
|
|
74
|
+
const [bytes, source] = session.handleEvent.firstCall.args;
|
|
75
|
+
|
|
76
|
+
assert.instanceOf(bytes, Uint8Array);
|
|
77
|
+
assert.deepEqual(JSON.parse(new TextDecoder().decode(bytes)), {foo: 'baz'});
|
|
78
|
+
assert.equal(source, 'mercury');
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
it('tells the engine the channel is already connected when online for this meeting', () => {
|
|
82
|
+
llm.isConnected.returns(true);
|
|
83
|
+
llm.getLocusUrl.returns('locus-1');
|
|
84
|
+
|
|
85
|
+
signaling.start();
|
|
86
|
+
|
|
87
|
+
assert.calledOnceWithExactly(session.setLlmConnectedBeforeJoin, true);
|
|
88
|
+
assert.neverCalledWith(llm.on, LLM_ONLINE_EVENT, sinon.match.func);
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
it('waits for online and notifies only when it is for this meeting', () => {
|
|
92
|
+
signaling.start();
|
|
93
|
+
|
|
94
|
+
const onlineCall = llm.on.getCalls().find((call) => call.args[0] === LLM_ONLINE_EVENT);
|
|
95
|
+
|
|
96
|
+
assert.isDefined(onlineCall);
|
|
97
|
+
const onOnline = onlineCall.args[1];
|
|
98
|
+
|
|
99
|
+
// Online for a different meeting -> no notify.
|
|
100
|
+
llm.isConnected.returns(true);
|
|
101
|
+
llm.getLocusUrl.returns('other-locus');
|
|
102
|
+
onOnline();
|
|
103
|
+
assert.notCalled(session.llmConnected);
|
|
104
|
+
|
|
105
|
+
// Online for our meeting -> notify.
|
|
106
|
+
llm.getLocusUrl.returns('locus-1');
|
|
107
|
+
onOnline();
|
|
108
|
+
assert.calledOnce(session.llmConnected);
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
it('moves subscriptions when the meeting replaces or clears its LLM channel', () => {
|
|
112
|
+
signaling.start();
|
|
113
|
+
|
|
114
|
+
const replacementLlm = {
|
|
115
|
+
on: sinon.stub(),
|
|
116
|
+
off: sinon.stub(),
|
|
117
|
+
isConnected: sinon.stub().returns(false),
|
|
118
|
+
getLocusUrl: sinon.stub().returns('locus-1'),
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
signaling.setLlmChannel(replacementLlm);
|
|
122
|
+
|
|
123
|
+
MEDIA_ENCRYPTION_MERCURY_EVENTS.forEach((event) => {
|
|
124
|
+
assert.calledWith(llm.off, event, sinon.match.func);
|
|
125
|
+
assert.calledWith(replacementLlm.on, event, sinon.match.func);
|
|
126
|
+
});
|
|
127
|
+
assert.calledWith(llm.off, LLM_ONLINE_EVENT, sinon.match.func);
|
|
128
|
+
assert.calledWith(replacementLlm.on, LLM_ONLINE_EVENT, sinon.match.func);
|
|
129
|
+
|
|
130
|
+
const replacementHandler = replacementLlm.on.getCall(0).args[1];
|
|
131
|
+
|
|
132
|
+
replacementHandler({data: {foo: 'replacement'}});
|
|
133
|
+
|
|
134
|
+
const [bytes, source] = session.handleEvent.firstCall.args;
|
|
135
|
+
|
|
136
|
+
assert.deepEqual(JSON.parse(new TextDecoder().decode(bytes)), {foo: 'replacement'});
|
|
137
|
+
assert.equal(source, 'llm');
|
|
138
|
+
|
|
139
|
+
signaling.setLlmChannel(undefined);
|
|
140
|
+
|
|
141
|
+
MEDIA_ENCRYPTION_MERCURY_EVENTS.forEach((event) => {
|
|
142
|
+
assert.calledWith(replacementLlm.off, event, sinon.match.func);
|
|
143
|
+
});
|
|
144
|
+
assert.calledWith(replacementLlm.off, LLM_ONLINE_EVENT, sinon.match.func);
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
it('removes all subscriptions on stop', () => {
|
|
148
|
+
signaling.start();
|
|
149
|
+
signaling.stop();
|
|
150
|
+
|
|
151
|
+
MEDIA_ENCRYPTION_MERCURY_EVENTS.forEach((event) => {
|
|
152
|
+
assert.calledWith(llm.off, event, sinon.match.func);
|
|
153
|
+
assert.calledWith(mercury.off, event, sinon.match.func);
|
|
154
|
+
});
|
|
155
|
+
assert.calledWith(llm.off, LLM_ONLINE_EVENT, sinon.match.func);
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
it('is idempotent across repeated start/stop calls', () => {
|
|
159
|
+
signaling.start();
|
|
160
|
+
const onCountAfterStart = llm.on.callCount;
|
|
161
|
+
|
|
162
|
+
signaling.start();
|
|
163
|
+
assert.equal(llm.on.callCount, onCountAfterStart);
|
|
164
|
+
|
|
165
|
+
signaling.stop();
|
|
166
|
+
const offCountAfterStop = llm.off.callCount;
|
|
167
|
+
|
|
168
|
+
signaling.stop();
|
|
169
|
+
assert.equal(llm.off.callCount, offCountAfterStop);
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2015-2026 Cisco Systems, Inc. See LICENSE file.
|
|
3
|
+
*/
|
|
4
|
+
import 'jsdom-global/register';
|
|
5
|
+
import {assert} from '@webex/test-helper-chai';
|
|
6
|
+
import sinon from 'sinon';
|
|
7
|
+
import MediaEncryptionService from '../../../../src/e2ee/MediaEncryptionService';
|
|
8
|
+
|
|
9
|
+
describe('plugin-meetings', () => {
|
|
10
|
+
describe('MediaEncryptionService', () => {
|
|
11
|
+
let webexRequest;
|
|
12
|
+
let service;
|
|
13
|
+
|
|
14
|
+
beforeEach(() => {
|
|
15
|
+
webexRequest = sinon.stub().resolves({body: {result: 'ok', n: 1}});
|
|
16
|
+
service = new MediaEncryptionService({webexRequest});
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
afterEach(() => {
|
|
20
|
+
sinon.restore();
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('posts the request object to the media-encryption service and resolves with the response body', async () => {
|
|
24
|
+
const requestBody = {op: 'join', epoch: 2};
|
|
25
|
+
|
|
26
|
+
const result = await service.request('https://mes.webex.com/op', requestBody);
|
|
27
|
+
|
|
28
|
+
assert.calledOnceWithExactly(webexRequest, {
|
|
29
|
+
method: 'POST',
|
|
30
|
+
service: 'media-encryption',
|
|
31
|
+
url: 'https://mes.webex.com/op',
|
|
32
|
+
body: requestBody,
|
|
33
|
+
});
|
|
34
|
+
assert.deepEqual(result, {result: 'ok', n: 1});
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('rejects when webex.request rejects', async () => {
|
|
38
|
+
webexRequest.rejects(new Error('boom'));
|
|
39
|
+
|
|
40
|
+
await assert.isRejected(service.request('https://mes.webex.com/op', {}), /boom/);
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
});
|