@webex/plugin-meetings 3.13.0-next.17 → 3.13.0-next.18
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/E2eeController.js +32 -4
- package/dist/e2ee/E2eeController.js.map +1 -1
- package/dist/e2ee/MemberMLSReconciler.js +194 -0
- package/dist/e2ee/MemberMLSReconciler.js.map +1 -0
- package/dist/e2ee/mls.js +1 -1
- package/dist/e2ee/mls.js.map +1 -1
- package/dist/e2ee/types.js +17 -1
- package/dist/e2ee/types.js.map +1 -1
- package/dist/interpretation/index.js +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/member/index.js +159 -0
- package/dist/member/index.js.map +1 -1
- package/dist/member/types.js.map +1 -1
- package/dist/members/collection.js +84 -1
- package/dist/members/collection.js.map +1 -1
- package/dist/members/index.js +58 -1
- package/dist/members/index.js.map +1 -1
- package/dist/types/e2ee/E2eeController.d.ts +1 -0
- package/dist/types/e2ee/MemberMLSReconciler.d.ts +76 -0
- package/dist/types/e2ee/types.d.ts +25 -1
- package/dist/types/member/index.d.ts +62 -0
- package/dist/types/member/types.d.ts +1 -0
- package/dist/types/members/collection.d.ts +30 -0
- package/dist/types/members/index.d.ts +73 -0
- package/dist/webinar/index.js +1 -1
- package/package.json +1 -1
- package/src/e2ee/DESIGN.md +1 -1
- package/src/e2ee/E2eeController.ts +28 -2
- package/src/e2ee/MemberMLSReconciler.ts +175 -0
- package/src/e2ee/mls.ts +1 -1
- package/src/e2ee/types.ts +30 -1
- package/src/member/index.ts +169 -0
- package/src/member/types.ts +1 -0
- package/src/members/collection.ts +67 -1
- package/src/members/index.ts +59 -1
- package/test/unit/spec/e2ee/E2eeController.ts +101 -10
- package/test/unit/spec/e2ee/MemberMLSReconciler.ts +353 -0
- package/test/unit/spec/e2ee/mls.ts +2 -2
- package/test/unit/spec/member/index.js +292 -0
- package/test/unit/spec/members/collection.js +50 -0
- package/test/unit/spec/members/index.js +71 -0
|
@@ -5,18 +5,34 @@ import Member from '../member';
|
|
|
5
5
|
export default class MembersCollection {
|
|
6
6
|
members: Record<string, Member>;
|
|
7
7
|
namespace: string;
|
|
8
|
+
private memberByDeviceUrl;
|
|
8
9
|
/**
|
|
9
10
|
* @param {Object} locus
|
|
10
11
|
* @memberof Members
|
|
11
12
|
*/
|
|
12
13
|
constructor();
|
|
14
|
+
/**
|
|
15
|
+
* @param {String} id
|
|
16
|
+
* @param {Member} member
|
|
17
|
+
* @returns {void}
|
|
18
|
+
*/
|
|
13
19
|
set(id: string, member: Member): void;
|
|
20
|
+
/**
|
|
21
|
+
* @param {Object} members
|
|
22
|
+
* @returns {void}
|
|
23
|
+
*/
|
|
14
24
|
setAll(members: Record<string, Member>): void;
|
|
15
25
|
/**
|
|
16
26
|
* @param {String} id
|
|
17
27
|
* @returns {Member}
|
|
18
28
|
*/
|
|
19
29
|
get(id: string): Member;
|
|
30
|
+
/**
|
|
31
|
+
* @param {String} deviceUrl
|
|
32
|
+
* @returns {Member | undefined} the member that owns the given device URL, if any.
|
|
33
|
+
* @memberof MembersCollection
|
|
34
|
+
*/
|
|
35
|
+
getMemberByDeviceUrl(deviceUrl: string): Member | undefined;
|
|
20
36
|
/**
|
|
21
37
|
* @returns {Object} returns an object map of Member instances
|
|
22
38
|
* @memberof MembersCollection
|
|
@@ -33,4 +49,18 @@ export default class MembersCollection {
|
|
|
33
49
|
* reset members
|
|
34
50
|
*/
|
|
35
51
|
reset(): void;
|
|
52
|
+
/**
|
|
53
|
+
* @param {Member} member
|
|
54
|
+
* @returns {void}
|
|
55
|
+
*/
|
|
56
|
+
private addToDeviceUrlIndex;
|
|
57
|
+
/**
|
|
58
|
+
* @param {Member} member
|
|
59
|
+
* @returns {void}
|
|
60
|
+
*/
|
|
61
|
+
private removeFromDeviceUrlIndex;
|
|
62
|
+
/**
|
|
63
|
+
* @returns {void}
|
|
64
|
+
*/
|
|
65
|
+
private rebuildDeviceUrlIndex;
|
|
36
66
|
}
|
|
@@ -5,6 +5,54 @@ import { ReceiveSlotManager } from '../multistream/receiveSlotManager';
|
|
|
5
5
|
import { MediaRequestManager } from '../multistream/mediaRequestManager';
|
|
6
6
|
import { ServerRoleShape } from './types';
|
|
7
7
|
import { Invitee } from '../meeting/type';
|
|
8
|
+
/**
|
|
9
|
+
* Members Update Event
|
|
10
|
+
* Emitted when something in the roster list needs to be updated
|
|
11
|
+
* @event members:update
|
|
12
|
+
* @instance
|
|
13
|
+
* @property {Object} delta the changes to the members list
|
|
14
|
+
* @property {Array} delta.updated array only the updates, includes removals, as they will have updated status and member properties
|
|
15
|
+
* @property {Array} delta.added array added members to the meeting
|
|
16
|
+
* @property {Array} full array the full members collection
|
|
17
|
+
* @memberof Members
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* Members Content Update Event
|
|
21
|
+
* Emitted when who is sharing changes
|
|
22
|
+
* @event members:content:update
|
|
23
|
+
* @instance
|
|
24
|
+
* @property {String} activeContentSharingId
|
|
25
|
+
* @property {String} endedContentSharingId
|
|
26
|
+
* @memberof Members
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* Members Host Update Event
|
|
30
|
+
* Emitted when who is the host changes
|
|
31
|
+
* @event members:host:update
|
|
32
|
+
* @instance
|
|
33
|
+
* @property {String} activeHostId
|
|
34
|
+
* @property {String} endedHostId
|
|
35
|
+
* @memberof Members
|
|
36
|
+
*/
|
|
37
|
+
/**
|
|
38
|
+
* Members Self Update Event
|
|
39
|
+
* Emitted when who is the self changes
|
|
40
|
+
* @event members:self:update
|
|
41
|
+
* @instance
|
|
42
|
+
* @property {String} activeSelfId
|
|
43
|
+
* @property {String} endedSelfId
|
|
44
|
+
* @memberof Members
|
|
45
|
+
*/
|
|
46
|
+
export type UpdatedMembers = {
|
|
47
|
+
added: Array<Member>;
|
|
48
|
+
updated: Array<Member>;
|
|
49
|
+
removedIds?: Array<string>;
|
|
50
|
+
};
|
|
51
|
+
/** Payload passed to a processor before the corresponding `members:update` event is emitted. */
|
|
52
|
+
export type MembersUpdatePayload = {
|
|
53
|
+
delta: UpdatedMembers;
|
|
54
|
+
isReplace: boolean;
|
|
55
|
+
};
|
|
8
56
|
/**
|
|
9
57
|
* @class Members
|
|
10
58
|
*/
|
|
@@ -31,6 +79,12 @@ export default class Members extends StatelessWebexPlugin {
|
|
|
31
79
|
* @private
|
|
32
80
|
*/
|
|
33
81
|
private memberIdByHistoryCsi;
|
|
82
|
+
/**
|
|
83
|
+
* Optional hook invoked with the member changes right before `members:update` is emitted, so a
|
|
84
|
+
* consumer (e.g. E2EE) can stamp derived data onto the members and have it appear in that event.
|
|
85
|
+
* @private
|
|
86
|
+
*/
|
|
87
|
+
private membersUpdateProcessor?;
|
|
34
88
|
namespace: string;
|
|
35
89
|
/**
|
|
36
90
|
*
|
|
@@ -97,6 +151,25 @@ export default class Members extends StatelessWebexPlugin {
|
|
|
97
151
|
isReplace?: boolean;
|
|
98
152
|
removedParticipantIds?: Array<string>;
|
|
99
153
|
}): void;
|
|
154
|
+
/**
|
|
155
|
+
* Registers (or clears, when passed undefined) a hook invoked with the member changes just before
|
|
156
|
+
* `members:update` is emitted. Lets a consumer stamp derived data onto the changed members so it
|
|
157
|
+
* is present in the emitted event.
|
|
158
|
+
* @param {Function} [processor]
|
|
159
|
+
* @returns {void}
|
|
160
|
+
* @public
|
|
161
|
+
* @memberof Members
|
|
162
|
+
*/
|
|
163
|
+
setMembersUpdateProcessor(processor?: (payload: MembersUpdatePayload) => void): void;
|
|
164
|
+
/**
|
|
165
|
+
* Emits a `members:update` for members whose data changed outside of a Locus participant update
|
|
166
|
+
* (e.g. E2EE verification completing). The given members are reported in `delta.updated`.
|
|
167
|
+
* @param {Member[]} updatedMembers
|
|
168
|
+
* @returns {void}
|
|
169
|
+
* @public
|
|
170
|
+
* @memberof Members
|
|
171
|
+
*/
|
|
172
|
+
reportMembersUpdated(updatedMembers: Array<Member>): void;
|
|
100
173
|
/**
|
|
101
174
|
* Internal update the content id
|
|
102
175
|
* @param {Object} payload
|
package/dist/webinar/index.js
CHANGED
package/package.json
CHANGED
package/src/e2ee/DESIGN.md
CHANGED
|
@@ -203,7 +203,7 @@ breakout moves. `setLlmChannel()` swaps the channel when `Meeting` replaces it o
|
|
|
203
203
|
|
|
204
204
|
Holds only the MLS roster (`Map<deviceUrl, E2eeRosterMember>`). The `deviceUrl → Member` index
|
|
205
205
|
lives in `MembersCollection.getMemberByDeviceUrl()`, and verification is stored on each `Member`.
|
|
206
|
-
Matching is per device: `rosterMember.
|
|
206
|
+
Matching is per device: `rosterMember.deviceUrl === member.participant.devices[i].url`.
|
|
207
207
|
|
|
208
208
|
Verification is surfaced through the existing `members:update` event; there is no dedicated event:
|
|
209
209
|
|
|
@@ -12,6 +12,7 @@ import {EVENT_TRIGGERS} from '../constants';
|
|
|
12
12
|
import MLS, {type MLSEvent, type MLSEventMap} from './mls';
|
|
13
13
|
import MediaEncryptionService from './MediaEncryptionService';
|
|
14
14
|
import E2eeSignaling from './E2eeSignaling';
|
|
15
|
+
import MemberMLSReconciler from './MemberMLSReconciler';
|
|
15
16
|
import {MEDIA_SERVICE_DEVICE_TYPE} from './constants';
|
|
16
17
|
import MeetingsUtil from '../meetings/util';
|
|
17
18
|
import type WasmLoader from '../common/wasm-loader';
|
|
@@ -49,6 +50,8 @@ export default class E2eeController extends TypedEventsScope<E2eeControllerEvent
|
|
|
49
50
|
|
|
50
51
|
private signaling?: E2eeSignaling;
|
|
51
52
|
|
|
53
|
+
private reconciler?: MemberMLSReconciler;
|
|
54
|
+
|
|
52
55
|
private sessionUnsubscribers: Array<() => void> = [];
|
|
53
56
|
|
|
54
57
|
private currentState: E2eeState = E2eeState.Disabled;
|
|
@@ -88,6 +91,19 @@ export default class E2eeController extends TypedEventsScope<E2eeControllerEvent
|
|
|
88
91
|
this.wasmLoader = wasmLoader;
|
|
89
92
|
this.wasmUrl = wasmUrl;
|
|
90
93
|
this.identityProvider = identityProvider;
|
|
94
|
+
|
|
95
|
+
if (MeetingsUtil.isE2eeEnabledAndSupported(this.webex?.config)) {
|
|
96
|
+
// Created eagerly (not on join) and registered as the Members pre-emit processor, so member
|
|
97
|
+
// verification is stamped into every members:update - even for member changes outside a
|
|
98
|
+
// joined meeting. Roster-driven verification changes are reported back through Members too.
|
|
99
|
+
this.reconciler = new MemberMLSReconciler({
|
|
100
|
+
membersCollection: context.members.membersCollection,
|
|
101
|
+
reportMembersUpdated: (members) => context.members.reportMembersUpdated(members),
|
|
102
|
+
});
|
|
103
|
+
context.members.setMembersUpdateProcessor((payload) =>
|
|
104
|
+
this.reconciler?.processMembersUpdate(payload)
|
|
105
|
+
);
|
|
106
|
+
}
|
|
91
107
|
}
|
|
92
108
|
|
|
93
109
|
/**
|
|
@@ -281,9 +297,11 @@ export default class E2eeController extends TypedEventsScope<E2eeControllerEvent
|
|
|
281
297
|
});
|
|
282
298
|
|
|
283
299
|
subscribe('rosterAdded', (added) => {
|
|
300
|
+
this.reconciler?.applyRosterAdded(added);
|
|
284
301
|
this.updateFromRoster({added, removed: []});
|
|
285
302
|
});
|
|
286
303
|
subscribe('rosterRemoved', ({urls}) => {
|
|
304
|
+
this.reconciler?.applyRosterRemoved(urls);
|
|
287
305
|
this.updateFromRoster({added: [], removed: urls});
|
|
288
306
|
});
|
|
289
307
|
|
|
@@ -334,10 +352,10 @@ export default class E2eeController extends TypedEventsScope<E2eeControllerEvent
|
|
|
334
352
|
|
|
335
353
|
for (const member of added) {
|
|
336
354
|
if (member.deviceType === MEDIA_SERVICE_DEVICE_TYPE) {
|
|
337
|
-
this.mediaServiceUrls.add(member.
|
|
355
|
+
this.mediaServiceUrls.add(member.deviceUrl);
|
|
338
356
|
}
|
|
339
357
|
|
|
340
|
-
if (member.
|
|
358
|
+
if (member.deviceUrl === this.webex.internal.device.url) {
|
|
341
359
|
ownDeviceAdded = true;
|
|
342
360
|
}
|
|
343
361
|
}
|
|
@@ -428,6 +446,14 @@ export default class E2eeController extends TypedEventsScope<E2eeControllerEvent
|
|
|
428
446
|
LoggerProxy.logger.warn(`e2ee: E2eeController --> error cleaning up MLS session: ${error}`);
|
|
429
447
|
}
|
|
430
448
|
|
|
449
|
+
try {
|
|
450
|
+
this.reconciler?.reset();
|
|
451
|
+
} catch (error) {
|
|
452
|
+
LoggerProxy.logger.warn(
|
|
453
|
+
`e2ee: E2eeController --> error resetting member verification: ${error}`
|
|
454
|
+
);
|
|
455
|
+
}
|
|
456
|
+
|
|
431
457
|
if (hadMediaServices) {
|
|
432
458
|
this.emitE2eeEvent(EVENT_TRIGGERS.MEETING_E2EE_MEDIA_SERVICES_CHANGED, {
|
|
433
459
|
hasMediaServices: false,
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2015-2026 Cisco Systems, Inc. See LICENSE file.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import LoggerProxy from '../common/logs/logger-proxy';
|
|
6
|
+
import type Member from '../member';
|
|
7
|
+
import type MembersCollection from '../members/collection';
|
|
8
|
+
import type {MembersUpdatePayload} from '../members';
|
|
9
|
+
import type {E2eeDeviceVerification, E2eeRosterMember} from './types';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Reconciles the MLS roster (keyed by device URL) against the meeting's `Members`, stamping a
|
|
13
|
+
* per-device verification onto each `Member` and deriving an aggregate verification state.
|
|
14
|
+
*
|
|
15
|
+
* It holds only the MLS roster; the device-URL -> member lookup lives in `MembersCollection`, and
|
|
16
|
+
* verification lives on each `Member`. Every path iterates its argument exactly once:
|
|
17
|
+
* - Member changes are fed in via `processMembersUpdate` (from the Members pre-emit processor),
|
|
18
|
+
* which stamps the (recreated) members' verification before `members:update` is emitted.
|
|
19
|
+
* - Roster changes update only the members owning the affected device URLs (via the collection's
|
|
20
|
+
* reverse index); members whose verification actually changed are handed to
|
|
21
|
+
* `reportMembersUpdated` so Members emits a `members:update` for them.
|
|
22
|
+
*/
|
|
23
|
+
export default class MemberMLSReconciler {
|
|
24
|
+
private readonly membersCollection: MembersCollection;
|
|
25
|
+
|
|
26
|
+
private readonly reportMembersUpdated: (updatedMembers: Member[]) => void;
|
|
27
|
+
|
|
28
|
+
private readonly rosterByDeviceUrl = new Map<string, E2eeRosterMember>();
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @param {Object} deps
|
|
32
|
+
* @param {MembersCollection} deps.membersCollection - The meeting's members collection.
|
|
33
|
+
* @param {Function} deps.reportMembersUpdated - Asks Members to emit `members:update` for the
|
|
34
|
+
* given members (used for roster-driven verification changes that have no Locus update).
|
|
35
|
+
*/
|
|
36
|
+
constructor({
|
|
37
|
+
membersCollection,
|
|
38
|
+
reportMembersUpdated,
|
|
39
|
+
}: {
|
|
40
|
+
membersCollection: MembersCollection;
|
|
41
|
+
reportMembersUpdated: (updatedMembers: Member[]) => void;
|
|
42
|
+
}) {
|
|
43
|
+
this.membersCollection = membersCollection;
|
|
44
|
+
this.reportMembersUpdated = reportMembersUpdated;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Stamps verification onto the members changed by a Locus update, before `members:update` is
|
|
49
|
+
* emitted. Does not itself emit — Members emits the (single) event.
|
|
50
|
+
* @param {MembersUpdatePayload} payload
|
|
51
|
+
* @returns {void}
|
|
52
|
+
*/
|
|
53
|
+
processMembersUpdate(payload: MembersUpdatePayload): void {
|
|
54
|
+
const {added = [], updated = []} = payload?.delta ?? {};
|
|
55
|
+
|
|
56
|
+
[...added, ...updated].forEach((member) => this.stampMember(member));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Adds/updates MLS roster members, updating the owning member's per-device verification and
|
|
61
|
+
* reporting the members whose verification changed.
|
|
62
|
+
* @param {E2eeRosterMember[]} added
|
|
63
|
+
* @returns {void}
|
|
64
|
+
*/
|
|
65
|
+
applyRosterAdded(added: E2eeRosterMember[]): void {
|
|
66
|
+
const changed = new Set<any>();
|
|
67
|
+
|
|
68
|
+
added.forEach((entry) => {
|
|
69
|
+
this.rosterByDeviceUrl.set(entry.deviceUrl, entry);
|
|
70
|
+
|
|
71
|
+
const member = this.membersCollection.getMemberByDeviceUrl(entry.deviceUrl);
|
|
72
|
+
|
|
73
|
+
if (
|
|
74
|
+
member?.setE2eeDeviceVerification?.(
|
|
75
|
+
entry.deviceUrl,
|
|
76
|
+
MemberMLSReconciler.toDeviceVerification(entry)
|
|
77
|
+
)
|
|
78
|
+
) {
|
|
79
|
+
changed.add(member);
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
LoggerProxy.logger.info(
|
|
84
|
+
`e2ee: MemberMLSReconciler#applyRosterAdded --> ${added.length} added (roster size ${this.rosterByDeviceUrl.size})`
|
|
85
|
+
);
|
|
86
|
+
this.report(changed);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Removes MLS roster members by device URL, clearing the owning member's per-device verification
|
|
91
|
+
* and reporting the members whose verification changed.
|
|
92
|
+
* @param {string[]} urls
|
|
93
|
+
* @returns {void}
|
|
94
|
+
*/
|
|
95
|
+
applyRosterRemoved(urls: string[]): void {
|
|
96
|
+
const changed = new Set<any>();
|
|
97
|
+
|
|
98
|
+
urls.forEach((url) => {
|
|
99
|
+
this.rosterByDeviceUrl.delete(url);
|
|
100
|
+
|
|
101
|
+
const member = this.membersCollection.getMemberByDeviceUrl(url);
|
|
102
|
+
|
|
103
|
+
if (member?.removeE2eeDeviceVerification?.(url)) {
|
|
104
|
+
changed.add(member);
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
LoggerProxy.logger.info(
|
|
109
|
+
`e2ee: MemberMLSReconciler#applyRosterRemoved --> ${urls.length} removed (roster size ${this.rosterByDeviceUrl.size})`
|
|
110
|
+
);
|
|
111
|
+
this.report(changed);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Clears the roster and the verification it had applied, reporting the affected members.
|
|
116
|
+
* @returns {void}
|
|
117
|
+
*/
|
|
118
|
+
reset(): void {
|
|
119
|
+
const changed = new Set<any>();
|
|
120
|
+
|
|
121
|
+
this.rosterByDeviceUrl.forEach((_entry, url) => {
|
|
122
|
+
const member = this.membersCollection.getMemberByDeviceUrl(url);
|
|
123
|
+
|
|
124
|
+
if (member?.removeE2eeDeviceVerification?.(url)) {
|
|
125
|
+
changed.add(member);
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
this.rosterByDeviceUrl.clear();
|
|
130
|
+
this.report(changed);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Replaces a member's verification from the current roster (for a recreated member). No report.
|
|
135
|
+
* @param {any} member
|
|
136
|
+
* @returns {void}
|
|
137
|
+
*/
|
|
138
|
+
private stampMember(member: any): void {
|
|
139
|
+
const verifications: E2eeDeviceVerification[] = [];
|
|
140
|
+
|
|
141
|
+
(member?.participant?.devices ?? []).forEach((device) => {
|
|
142
|
+
const rosterEntry = device?.url ? this.rosterByDeviceUrl.get(device.url) : undefined;
|
|
143
|
+
|
|
144
|
+
if (rosterEntry) {
|
|
145
|
+
verifications.push(MemberMLSReconciler.toDeviceVerification(rosterEntry));
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
member.setE2eeDeviceVerifications?.(verifications);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* @param {Set} changed
|
|
154
|
+
* @returns {void}
|
|
155
|
+
*/
|
|
156
|
+
private report(changed: Set<any>): void {
|
|
157
|
+
if (changed.size) {
|
|
158
|
+
this.reportMembersUpdated([...changed]);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* @param {E2eeRosterMember} rosterEntry
|
|
164
|
+
* @returns {E2eeDeviceVerification}
|
|
165
|
+
*/
|
|
166
|
+
private static toDeviceVerification(rosterEntry: E2eeRosterMember): E2eeDeviceVerification {
|
|
167
|
+
return {
|
|
168
|
+
deviceUrl: rosterEntry.deviceUrl,
|
|
169
|
+
validationResult: rosterEntry.validationResult,
|
|
170
|
+
displayName: rosterEntry.displayName,
|
|
171
|
+
deviceType: rosterEntry.deviceType,
|
|
172
|
+
...(rosterEntry.identityResults && {identityResults: rosterEntry.identityResults}),
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
}
|
package/src/e2ee/mls.ts
CHANGED
|
@@ -548,7 +548,7 @@ export default class MLS {
|
|
|
548
548
|
*/
|
|
549
549
|
private static toRosterMember(member: RosterMember): E2eeRosterMember {
|
|
550
550
|
return {
|
|
551
|
-
|
|
551
|
+
deviceUrl: member.url,
|
|
552
552
|
displayName: member.display_name,
|
|
553
553
|
deviceType: member.device_type,
|
|
554
554
|
validationResult: member.validation_result,
|
package/src/e2ee/types.ts
CHANGED
|
@@ -140,13 +140,42 @@ export interface E2eeIdentityResult {
|
|
|
140
140
|
|
|
141
141
|
/** A member of the MLS roster and its overall libe2ee credential validation result. */
|
|
142
142
|
export interface E2eeRosterMember {
|
|
143
|
-
|
|
143
|
+
deviceUrl: string;
|
|
144
144
|
displayName: string;
|
|
145
145
|
deviceType: string;
|
|
146
146
|
validationResult: E2eeValidationResult;
|
|
147
147
|
identityResults?: E2eeIdentityResult[];
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
+
/** Per-device E2EE verification result, derived from the MLS roster and applied onto a Member. */
|
|
151
|
+
export interface E2eeDeviceVerification {
|
|
152
|
+
deviceUrl: string;
|
|
153
|
+
/** Overall libe2ee result for this device's credential or MultiCredential. */
|
|
154
|
+
validationResult: E2eeValidationResult;
|
|
155
|
+
displayName?: string;
|
|
156
|
+
deviceType?: string;
|
|
157
|
+
identityResults?: E2eeIdentityResult[];
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/** E2EE verification state of a single device, derived from its X.509 identity result. */
|
|
161
|
+
export const E2eeDeviceVerificationState = {
|
|
162
|
+
Unknown: 'unknown',
|
|
163
|
+
Verified: 'verified',
|
|
164
|
+
Unverified: 'unverified',
|
|
165
|
+
} as const;
|
|
166
|
+
|
|
167
|
+
export type E2eeDeviceVerificationState = Enum<typeof E2eeDeviceVerificationState>;
|
|
168
|
+
|
|
169
|
+
/** A member's aggregate E2EE verification state across all of their devices. */
|
|
170
|
+
export const E2eeMemberVerificationState = {
|
|
171
|
+
Unknown: 'unknown',
|
|
172
|
+
Verified: 'verified',
|
|
173
|
+
Unverified: 'unverified',
|
|
174
|
+
PartiallyVerified: 'partiallyVerified',
|
|
175
|
+
} as const;
|
|
176
|
+
|
|
177
|
+
export type E2eeMemberVerificationState = Enum<typeof E2eeMemberVerificationState>;
|
|
178
|
+
|
|
150
179
|
/** Configuration for initializing an MLS group session. */
|
|
151
180
|
export interface MLSConfig {
|
|
152
181
|
participantId: string;
|
package/src/member/index.ts
CHANGED
|
@@ -2,11 +2,19 @@
|
|
|
2
2
|
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
3
3
|
*/
|
|
4
4
|
import {MEETINGS, _IN_LOBBY_, _NOT_IN_MEETING_, _IN_MEETING_, _OBSERVE_} from '../constants';
|
|
5
|
+
import {
|
|
6
|
+
E2eeDeviceVerificationState,
|
|
7
|
+
E2eeIdentityType,
|
|
8
|
+
E2eeMemberVerificationState,
|
|
9
|
+
E2eeValidationResult,
|
|
10
|
+
} from '../e2ee/types';
|
|
11
|
+
import type {E2eeDeviceVerification} from '../e2ee/types';
|
|
5
12
|
import {IExternalRoles, IMediaStatus, Participant, ParticipantUrl} from './types';
|
|
6
13
|
|
|
7
14
|
import MemberUtil from './util';
|
|
8
15
|
|
|
9
16
|
export type MemberId = string;
|
|
17
|
+
|
|
10
18
|
/**
|
|
11
19
|
* @class Member
|
|
12
20
|
*/
|
|
@@ -53,6 +61,10 @@ export default class Member {
|
|
|
53
61
|
memberId?: MemberId;
|
|
54
62
|
};
|
|
55
63
|
|
|
64
|
+
// Per-device E2EE verification, keyed by device URL, applied by the E2EE roster reconciler.
|
|
65
|
+
e2eeDeviceVerifications: Map<string, E2eeDeviceVerification>;
|
|
66
|
+
e2eeVerificationState: E2eeMemberVerificationState;
|
|
67
|
+
|
|
56
68
|
/**
|
|
57
69
|
* @param {Object} participant - the locus participant
|
|
58
70
|
* @param {Object} [options] - constructor params
|
|
@@ -329,6 +341,8 @@ export default class Member {
|
|
|
329
341
|
participantUrl: undefined,
|
|
330
342
|
memberId: undefined,
|
|
331
343
|
};
|
|
344
|
+
this.e2eeDeviceVerifications = new Map();
|
|
345
|
+
this.e2eeVerificationState = E2eeMemberVerificationState.Unknown;
|
|
332
346
|
/**
|
|
333
347
|
* @instance
|
|
334
348
|
* @type {IMediaStatus}
|
|
@@ -504,6 +518,161 @@ export default class Member {
|
|
|
504
518
|
this.isSelf = flag;
|
|
505
519
|
}
|
|
506
520
|
|
|
521
|
+
/**
|
|
522
|
+
* Replaces this member's per-device E2EE verifications and recomputes the aggregate state.
|
|
523
|
+
* Called by the E2EE roster reconciler; a member with no matching MLS roster devices is reset.
|
|
524
|
+
* @param {E2eeDeviceVerification[]} verifications
|
|
525
|
+
* @returns {undefined}
|
|
526
|
+
* @public
|
|
527
|
+
* @memberof Member
|
|
528
|
+
*/
|
|
529
|
+
public setE2eeDeviceVerifications(verifications: E2eeDeviceVerification[]) {
|
|
530
|
+
this.e2eeDeviceVerifications = new Map(
|
|
531
|
+
verifications.map((verification) => [verification.deviceUrl, verification])
|
|
532
|
+
);
|
|
533
|
+
this.recomputeE2eeVerificationState();
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
/**
|
|
537
|
+
* Upserts the verification for a single device and recomputes the aggregate state.
|
|
538
|
+
* @param {String} deviceUrl
|
|
539
|
+
* @param {E2eeDeviceVerification} verification
|
|
540
|
+
* @returns {boolean} whether the verification actually changed.
|
|
541
|
+
* @public
|
|
542
|
+
* @memberof Member
|
|
543
|
+
*/
|
|
544
|
+
public setE2eeDeviceVerification(
|
|
545
|
+
deviceUrl: string,
|
|
546
|
+
verification: E2eeDeviceVerification
|
|
547
|
+
): boolean {
|
|
548
|
+
const previous = this.e2eeDeviceVerifications.get(deviceUrl);
|
|
549
|
+
|
|
550
|
+
if (previous && JSON.stringify(previous) === JSON.stringify(verification)) {
|
|
551
|
+
return false;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
this.e2eeDeviceVerifications.set(deviceUrl, verification);
|
|
555
|
+
this.recomputeE2eeVerificationState();
|
|
556
|
+
|
|
557
|
+
return true;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
/**
|
|
561
|
+
* Removes the verification for a single device and recomputes the aggregate state.
|
|
562
|
+
* @param {String} deviceUrl
|
|
563
|
+
* @returns {boolean} whether a verification was actually removed.
|
|
564
|
+
* @public
|
|
565
|
+
* @memberof Member
|
|
566
|
+
*/
|
|
567
|
+
public removeE2eeDeviceVerification(deviceUrl: string): boolean {
|
|
568
|
+
if (!this.e2eeDeviceVerifications.has(deviceUrl)) {
|
|
569
|
+
return false;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
this.e2eeDeviceVerifications.delete(deviceUrl);
|
|
573
|
+
this.recomputeE2eeVerificationState();
|
|
574
|
+
|
|
575
|
+
return true;
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
/**
|
|
579
|
+
* @param {String} deviceUrl
|
|
580
|
+
* @returns {E2eeDeviceVerification | undefined} the verification for a single device.
|
|
581
|
+
* @public
|
|
582
|
+
* @memberof Member
|
|
583
|
+
*/
|
|
584
|
+
public getE2eeDeviceVerification(deviceUrl: string): E2eeDeviceVerification | undefined {
|
|
585
|
+
return this.e2eeDeviceVerifications.get(deviceUrl);
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
/**
|
|
589
|
+
* @returns {E2eeDeviceVerification[]} all per-device verifications for this member.
|
|
590
|
+
* @public
|
|
591
|
+
* @memberof Member
|
|
592
|
+
*/
|
|
593
|
+
public getE2eeDeviceVerifications(): E2eeDeviceVerification[] {
|
|
594
|
+
return Array.from(this.e2eeDeviceVerifications.values());
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
/**
|
|
598
|
+
* Recomputes the aggregate E2EE verification state from the per-device X.509 identity results.
|
|
599
|
+
* A successful X.509 result is classified by its leaf identity type, matching UCF's per-device
|
|
600
|
+
* identity display; the resulting device states are then aggregated across this Member's devices.
|
|
601
|
+
* @returns {undefined}
|
|
602
|
+
* @private
|
|
603
|
+
* @memberof Member
|
|
604
|
+
*/
|
|
605
|
+
private recomputeE2eeVerificationState() {
|
|
606
|
+
const verifications = this.getE2eeDeviceVerifications();
|
|
607
|
+
|
|
608
|
+
if (verifications.length === 0) {
|
|
609
|
+
this.e2eeVerificationState = E2eeMemberVerificationState.Unknown;
|
|
610
|
+
|
|
611
|
+
return;
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
const deviceStates = verifications.map((verification) =>
|
|
615
|
+
this.getE2eeDeviceVerificationState(verification)
|
|
616
|
+
);
|
|
617
|
+
const verifiedCount = deviceStates.filter(
|
|
618
|
+
(state) => state === E2eeDeviceVerificationState.Verified
|
|
619
|
+
).length;
|
|
620
|
+
|
|
621
|
+
if (verifiedCount === deviceStates.length) {
|
|
622
|
+
this.e2eeVerificationState = E2eeMemberVerificationState.Verified;
|
|
623
|
+
} else if (verifiedCount === 0) {
|
|
624
|
+
this.e2eeVerificationState = deviceStates.every(
|
|
625
|
+
(state) => state === E2eeDeviceVerificationState.Unknown
|
|
626
|
+
)
|
|
627
|
+
? E2eeMemberVerificationState.Unknown
|
|
628
|
+
: E2eeMemberVerificationState.Unverified;
|
|
629
|
+
} else {
|
|
630
|
+
this.e2eeVerificationState = E2eeMemberVerificationState.PartiallyVerified;
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
/**
|
|
635
|
+
* Derives the identity status for one device using the same X.509 result selection and identity
|
|
636
|
+
* type rules as UCF. `validationResult` is the aggregate credential result, so it is not enough
|
|
637
|
+
* to classify MultiCredential identities on its own.
|
|
638
|
+
* @param {E2eeDeviceVerification} verification
|
|
639
|
+
* @returns {E2eeDeviceVerificationState}
|
|
640
|
+
* @private
|
|
641
|
+
* @memberof Member
|
|
642
|
+
*/
|
|
643
|
+
private getE2eeDeviceVerificationState(
|
|
644
|
+
verification: E2eeDeviceVerification
|
|
645
|
+
): E2eeDeviceVerificationState {
|
|
646
|
+
const identityResults = verification.identityResults ?? [];
|
|
647
|
+
|
|
648
|
+
if (identityResults.length === 0) {
|
|
649
|
+
return E2eeDeviceVerificationState.Unknown;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
const identityResult =
|
|
653
|
+
identityResults.find((result) => result.result === E2eeValidationResult.Success) ??
|
|
654
|
+
identityResults[0];
|
|
655
|
+
|
|
656
|
+
if (!identityResult) {
|
|
657
|
+
return E2eeDeviceVerificationState.Unknown;
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
if (identityResult.result !== E2eeValidationResult.Success) {
|
|
661
|
+
return E2eeDeviceVerificationState.Unverified;
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
switch (identityResult.certificateChain[0]?.identityType) {
|
|
665
|
+
case E2eeIdentityType.WebexMachineIdentity:
|
|
666
|
+
case E2eeIdentityType.WebexUserIdentity:
|
|
667
|
+
case E2eeIdentityType.ExternalVerifiedIdentity:
|
|
668
|
+
return E2eeDeviceVerificationState.Verified;
|
|
669
|
+
case E2eeIdentityType.WebexAnonymousIdentity:
|
|
670
|
+
return E2eeDeviceVerificationState.Unverified;
|
|
671
|
+
default:
|
|
672
|
+
return E2eeDeviceVerificationState.Unknown;
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
|
|
507
676
|
/**
|
|
508
677
|
* determine if this member is content sharing
|
|
509
678
|
* @param {Object} participant
|
package/src/member/types.ts
CHANGED
|
@@ -55,6 +55,7 @@ export interface ParticipantDevice {
|
|
|
55
55
|
mediaSessions: Array<MediaSession>;
|
|
56
56
|
mediaSessionsExternal: boolean;
|
|
57
57
|
state: string; // probably one of MEETING_STATE.STATES
|
|
58
|
+
url: string; // device (WDM) URL; present at runtime, used to match against the MLS roster
|
|
58
59
|
}
|
|
59
60
|
|
|
60
61
|
// this is not a complete type, Locus may send more fields
|