@webex/plugin-meetings 3.12.0-next.84 → 3.12.0-next.86
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 +0 -2
- package/dist/config.js.map +1 -1
- package/dist/constants.js +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/interpretation/index.js +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/meetings/index.js +0 -40
- package/dist/meetings/index.js.map +1 -1
- package/dist/reachability/index.js +10 -13
- package/dist/reachability/index.js.map +1 -1
- package/dist/reachability/reachability.types.js +2 -0
- package/dist/reachability/reachability.types.js.map +1 -1
- package/dist/reachability/util.js +45 -0
- package/dist/reachability/util.js.map +1 -1
- package/dist/types/config.d.ts +0 -2
- package/dist/types/meetings/index.d.ts +0 -16
- package/dist/types/reachability/index.d.ts +1 -1
- package/dist/types/reachability/reachability.types.d.ts +7 -0
- package/dist/types/reachability/util.d.ts +17 -0
- package/dist/webinar/index.js +1 -1
- package/package.json +1 -1
- package/src/config.ts +0 -2
- package/src/constants.ts +4 -1
- package/src/meetings/index.ts +0 -36
- package/src/reachability/index.ts +19 -15
- package/src/reachability/reachability.types.ts +11 -0
- package/src/reachability/util.ts +36 -0
- package/test/unit/spec/locus-info/infoUtils.js +97 -1
- package/test/unit/spec/meetings/index.js +0 -26
- package/test/unit/spec/reachability/index.ts +59 -46
- package/test/unit/spec/reachability/util.ts +31 -0
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { IP_VERSION, Enum } from '../constants';
|
|
2
2
|
export type Protocol = 'udp' | 'tcp' | 'xtls';
|
|
3
|
+
export type ResolvedReachabilityProtocols = {
|
|
4
|
+
udp: boolean;
|
|
5
|
+
tcp: boolean;
|
|
6
|
+
tls: boolean;
|
|
7
|
+
};
|
|
8
|
+
export type ReachabilityProtocolConfig = Partial<Omit<ResolvedReachabilityProtocols, 'udp'>>;
|
|
9
|
+
export type EnableReachabilityChecksConfig = boolean | ReachabilityProtocolConfig;
|
|
3
10
|
/**
|
|
4
11
|
* Events emitted by ReachabilityPeerConnection
|
|
5
12
|
*/
|
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
import { EnableReachabilityChecksConfig, ResolvedReachabilityProtocols } from './reachability.types';
|
|
2
|
+
/**
|
|
3
|
+
* Resolves `enableReachabilityChecks` into explicit per-protocol flags.
|
|
4
|
+
* Defaults to all protocols enabled when not configured.
|
|
5
|
+
* UDP is always tested unless reachability is disabled entirely (`false`).
|
|
6
|
+
*
|
|
7
|
+
* @param {EnableReachabilityChecksConfig} enabled value of config.meetings.enableReachabilityChecks
|
|
8
|
+
* @returns {ResolvedReachabilityProtocols} resolved per-protocol flags
|
|
9
|
+
*/
|
|
10
|
+
export declare function resolveReachabilityProtocols(enabled?: EnableReachabilityChecksConfig): ResolvedReachabilityProtocols;
|
|
11
|
+
/**
|
|
12
|
+
* Whether any reachability protocol is enabled.
|
|
13
|
+
*
|
|
14
|
+
* @param {EnableReachabilityChecksConfig} config value of config.meetings.enableReachabilityChecks
|
|
15
|
+
* @returns {boolean} true if any protocol is enabled
|
|
16
|
+
*/
|
|
17
|
+
export declare function isReachabilityEnabled(config?: EnableReachabilityChecksConfig): boolean;
|
|
1
18
|
/**
|
|
2
19
|
* Converts a stun url to a turn url
|
|
3
20
|
*
|
package/dist/webinar/index.js
CHANGED
package/package.json
CHANGED
package/src/config.ts
CHANGED
|
@@ -87,8 +87,6 @@ export default {
|
|
|
87
87
|
enableMediaNegotiatedEvent: false,
|
|
88
88
|
enableUnifiedMeetings: true,
|
|
89
89
|
enableAdhocMeetings: true,
|
|
90
|
-
enableTcpReachability: false,
|
|
91
|
-
enableTlsReachability: false,
|
|
92
90
|
storeLocusHashTreeEventsForDebugging: false,
|
|
93
91
|
},
|
|
94
92
|
degradationPreferences: {
|
package/src/constants.ts
CHANGED
|
@@ -1108,7 +1108,10 @@ export const DISPLAY_HINTS = {
|
|
|
1108
1108
|
ANONYMOUS_DISPLAY_NAMES_ENABLED: 'ANONYMOUS_DISPLAY_NAMES_ENABLED',
|
|
1109
1109
|
};
|
|
1110
1110
|
|
|
1111
|
-
export const INTERSTITIAL_DISPLAY_HINTS = [
|
|
1111
|
+
export const INTERSTITIAL_DISPLAY_HINTS = [
|
|
1112
|
+
DISPLAY_HINTS.VOIP_IS_ENABLED,
|
|
1113
|
+
DISPLAY_HINTS.ANONYMOUS_DISPLAY_NAMES_ENABLED,
|
|
1114
|
+
];
|
|
1112
1115
|
|
|
1113
1116
|
export const SELF_ROLES = {
|
|
1114
1117
|
COHOST: 'COHOST',
|
package/src/meetings/index.ts
CHANGED
|
@@ -840,42 +840,6 @@ export default class Meetings extends WebexPlugin {
|
|
|
840
840
|
}
|
|
841
841
|
}
|
|
842
842
|
|
|
843
|
-
/**
|
|
844
|
-
* API to toggle TCP reachability, needs to be called before webex.meetings.register()
|
|
845
|
-
* @param {Boolean} newValue
|
|
846
|
-
* @private
|
|
847
|
-
* @memberof Meetings
|
|
848
|
-
* @returns {undefined}
|
|
849
|
-
*/
|
|
850
|
-
private _toggleTcpReachability(newValue: boolean) {
|
|
851
|
-
if (typeof newValue !== 'boolean') {
|
|
852
|
-
return;
|
|
853
|
-
}
|
|
854
|
-
// @ts-ignore
|
|
855
|
-
if (this.config.experimental.enableTcpReachability !== newValue) {
|
|
856
|
-
// @ts-ignore
|
|
857
|
-
this.config.experimental.enableTcpReachability = newValue;
|
|
858
|
-
}
|
|
859
|
-
}
|
|
860
|
-
|
|
861
|
-
/**
|
|
862
|
-
* API to toggle TLS reachability, needs to be called before webex.meetings.register()
|
|
863
|
-
* @param {Boolean} newValue
|
|
864
|
-
* @private
|
|
865
|
-
* @memberof Meetings
|
|
866
|
-
* @returns {undefined}
|
|
867
|
-
*/
|
|
868
|
-
private _toggleTlsReachability(newValue: boolean) {
|
|
869
|
-
if (typeof newValue !== 'boolean') {
|
|
870
|
-
return;
|
|
871
|
-
}
|
|
872
|
-
// @ts-ignore
|
|
873
|
-
if (this.config.experimental.enableTlsReachability !== newValue) {
|
|
874
|
-
// @ts-ignore
|
|
875
|
-
this.config.experimental.enableTlsReachability = newValue;
|
|
876
|
-
}
|
|
877
|
-
}
|
|
878
|
-
|
|
879
843
|
/**
|
|
880
844
|
* API to toggle backend ipv6 native support config, needs to be called before webex.meetings.register()
|
|
881
845
|
*
|
|
@@ -33,6 +33,7 @@ import {
|
|
|
33
33
|
NatTypeUpdatedEventData,
|
|
34
34
|
ResultEventData,
|
|
35
35
|
} from './clusterReachability';
|
|
36
|
+
import {isReachabilityEnabled, resolveReachabilityProtocols} from './util';
|
|
36
37
|
import EventsScope from '../common/events/events-scope';
|
|
37
38
|
import BEHAVIORAL_METRICS from '../metrics/constants';
|
|
38
39
|
import Metrics from '../metrics';
|
|
@@ -194,7 +195,7 @@ export default class Reachability extends EventsScope {
|
|
|
194
195
|
*/
|
|
195
196
|
public async gatherReachability(trigger: string): Promise<ReachabilityResults> {
|
|
196
197
|
// @ts-ignore
|
|
197
|
-
if (!this.webex.config.meetings.enableReachabilityChecks) {
|
|
198
|
+
if (!isReachabilityEnabled(this.webex.config.meetings.enableReachabilityChecks)) {
|
|
198
199
|
throw new Error('enableReachabilityChecks is disabled in config');
|
|
199
200
|
}
|
|
200
201
|
|
|
@@ -515,7 +516,7 @@ export default class Reachability extends EventsScope {
|
|
|
515
516
|
* Returns true only if ALL protocols (UDP, TCP and TLS) have been tested and none
|
|
516
517
|
* of the media clusters where reachable with any of the protocols. This is done
|
|
517
518
|
* irrespective of the config, so for example:
|
|
518
|
-
* if config.meetings.
|
|
519
|
+
* if config.meetings.enableReachabilityChecks disables TLS,
|
|
519
520
|
* it will return false, because TLS reachability won't be tested,
|
|
520
521
|
* so we can't say for sure that media backend is unreachable over TLS.
|
|
521
522
|
*
|
|
@@ -888,14 +889,21 @@ export default class Reachability extends EventsScope {
|
|
|
888
889
|
|
|
889
890
|
this.startTime = performance.now();
|
|
890
891
|
|
|
892
|
+
const protocols = resolveReachabilityProtocols(
|
|
893
|
+
// @ts-ignore
|
|
894
|
+
this.webex.config.meetings.enableReachabilityChecks
|
|
895
|
+
);
|
|
896
|
+
|
|
897
|
+
const enabledProtocols = [
|
|
898
|
+
protocols.udp && 'UDP',
|
|
899
|
+
protocols.tcp && 'TCP',
|
|
900
|
+
protocols.tls && 'TLS',
|
|
901
|
+
].filter(Boolean);
|
|
902
|
+
|
|
891
903
|
LoggerProxy.logger.log(
|
|
892
|
-
`Reachability:index#performReachabilityChecks --> doing
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
}${
|
|
896
|
-
// @ts-ignore
|
|
897
|
-
this.webex.config.meetings.experimental.enableTlsReachability ? ',TLS' : ''
|
|
898
|
-
} reachability checks`
|
|
904
|
+
`Reachability:index#performReachabilityChecks --> doing ${enabledProtocols.join(
|
|
905
|
+
','
|
|
906
|
+
)} reachability checks`
|
|
899
907
|
);
|
|
900
908
|
|
|
901
909
|
this.resetResultCounters();
|
|
@@ -905,18 +913,14 @@ export default class Reachability extends EventsScope {
|
|
|
905
913
|
const cluster = clusterList[key];
|
|
906
914
|
|
|
907
915
|
// Linus doesn't support TCP reachability checks on video mesh nodes
|
|
908
|
-
const includeTcpReachability =
|
|
909
|
-
// @ts-ignore
|
|
910
|
-
this.webex.config.meetings.experimental.enableTcpReachability && !cluster.isVideoMesh;
|
|
916
|
+
const includeTcpReachability = protocols.tcp && !cluster.isVideoMesh;
|
|
911
917
|
|
|
912
918
|
if (!includeTcpReachability) {
|
|
913
919
|
cluster.tcp = [];
|
|
914
920
|
}
|
|
915
921
|
|
|
916
922
|
// Linus doesn't support xTLS reachability checks on video mesh nodes
|
|
917
|
-
const includeTlsReachability =
|
|
918
|
-
// @ts-ignore
|
|
919
|
-
this.webex.config.meetings.experimental.enableTlsReachability && !cluster.isVideoMesh;
|
|
923
|
+
const includeTlsReachability = protocols.tls && !cluster.isVideoMesh;
|
|
920
924
|
|
|
921
925
|
if (!includeTlsReachability) {
|
|
922
926
|
cluster.xtls = [];
|
|
@@ -2,6 +2,17 @@ import {IP_VERSION, Enum} from '../constants';
|
|
|
2
2
|
|
|
3
3
|
export type Protocol = 'udp' | 'tcp' | 'xtls';
|
|
4
4
|
|
|
5
|
+
// Per-protocol reachability flags, fully resolved.
|
|
6
|
+
export type ResolvedReachabilityProtocols = {
|
|
7
|
+
udp: boolean;
|
|
8
|
+
tcp: boolean;
|
|
9
|
+
tls: boolean;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type ReachabilityProtocolConfig = Partial<Omit<ResolvedReachabilityProtocols, 'udp'>>;
|
|
13
|
+
|
|
14
|
+
export type EnableReachabilityChecksConfig = boolean | ReachabilityProtocolConfig;
|
|
15
|
+
|
|
5
16
|
/**
|
|
6
17
|
* Events emitted by ReachabilityPeerConnection
|
|
7
18
|
*/
|
package/src/reachability/util.ts
CHANGED
|
@@ -1,4 +1,40 @@
|
|
|
1
1
|
/* eslint-disable import/prefer-default-export */
|
|
2
|
+
import {EnableReachabilityChecksConfig, ResolvedReachabilityProtocols} from './reachability.types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Resolves `enableReachabilityChecks` into explicit per-protocol flags.
|
|
6
|
+
* Defaults to all protocols enabled when not configured.
|
|
7
|
+
* UDP is always tested unless reachability is disabled entirely (`false`).
|
|
8
|
+
*
|
|
9
|
+
* @param {EnableReachabilityChecksConfig} enabled value of config.meetings.enableReachabilityChecks
|
|
10
|
+
* @returns {ResolvedReachabilityProtocols} resolved per-protocol flags
|
|
11
|
+
*/
|
|
12
|
+
export function resolveReachabilityProtocols(
|
|
13
|
+
enabled: EnableReachabilityChecksConfig = true
|
|
14
|
+
): ResolvedReachabilityProtocols {
|
|
15
|
+
if (typeof enabled === 'object') {
|
|
16
|
+
return {
|
|
17
|
+
udp: true,
|
|
18
|
+
tcp: enabled.tcp ?? true,
|
|
19
|
+
tls: enabled.tls ?? true,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return {udp: enabled, tcp: enabled, tls: enabled};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Whether any reachability protocol is enabled.
|
|
28
|
+
*
|
|
29
|
+
* @param {EnableReachabilityChecksConfig} config value of config.meetings.enableReachabilityChecks
|
|
30
|
+
* @returns {boolean} true if any protocol is enabled
|
|
31
|
+
*/
|
|
32
|
+
export function isReachabilityEnabled(config: EnableReachabilityChecksConfig = true): boolean {
|
|
33
|
+
const {udp, tcp, tls} = resolveReachabilityProtocols(config);
|
|
34
|
+
|
|
35
|
+
return udp || tcp || tls;
|
|
36
|
+
}
|
|
37
|
+
|
|
2
38
|
/**
|
|
3
39
|
* Converts a stun url to a turn url
|
|
4
40
|
*
|
|
@@ -83,7 +83,7 @@ describe('plugin-meetings', () => {
|
|
|
83
83
|
});
|
|
84
84
|
});
|
|
85
85
|
|
|
86
|
-
it('only includes interstitial display hints when user has not joined the meeting', () => {
|
|
86
|
+
it('only includes interstitial display (VOIP_IS_ENABLED) hints when user has not joined the meeting', () => {
|
|
87
87
|
assert.deepEqual(InfoUtils.parse(info, ['MODERATOR'], false), {
|
|
88
88
|
policy: {HINT_3: true, VOIP_IS_ENABLED: true},
|
|
89
89
|
moderator: {HINT_1: true, HINT_2: true, LOWER_SOMEONE_ELSES_HAND: true},
|
|
@@ -111,6 +111,102 @@ describe('plugin-meetings', () => {
|
|
|
111
111
|
});
|
|
112
112
|
});
|
|
113
113
|
|
|
114
|
+
it('only includes interstitial display (ANONYMOUS_DISPLAY_NAMES_ENABLED) hints when user has not joined the meeting', () => {
|
|
115
|
+
const interstitialInfo = {
|
|
116
|
+
displayHints: {
|
|
117
|
+
moderator: ['HINT_1', 'HINT_2'],
|
|
118
|
+
joined: [
|
|
119
|
+
'HINT_3',
|
|
120
|
+
'ANONYMOUS_DISPLAY_NAMES_ENABLED',
|
|
121
|
+
],
|
|
122
|
+
coHost: ['HINT_4'],
|
|
123
|
+
presenter: ['HINT_5'],
|
|
124
|
+
panelist: ['HINT_6'],
|
|
125
|
+
attendee: ['HINT_7'],
|
|
126
|
+
},
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
assert.deepEqual(InfoUtils.parse(interstitialInfo, ['MODERATOR'], false), {
|
|
130
|
+
policy: {HINT_3: true, ANONYMOUS_DISPLAY_NAMES_ENABLED: true},
|
|
131
|
+
moderator: {HINT_1: true, HINT_2: true, LOWER_SOMEONE_ELSES_HAND: true},
|
|
132
|
+
coHost: {HINT_4: true, LOWER_SOMEONE_ELSES_HAND: true},
|
|
133
|
+
presenter: {HINT_5: true},
|
|
134
|
+
panelist: {HINT_6: true},
|
|
135
|
+
attendee: {HINT_7: true},
|
|
136
|
+
userDisplayHints: ['ANONYMOUS_DISPLAY_NAMES_ENABLED', 'HINT_1', 'HINT_2', 'LOWER_SOMEONE_ELSES_HAND'],
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
assert.deepEqual(InfoUtils.parse(interstitialInfo, ['MODERATOR'], true), {
|
|
140
|
+
policy: {HINT_3: true, ANONYMOUS_DISPLAY_NAMES_ENABLED: true},
|
|
141
|
+
moderator: {HINT_1: true, HINT_2: true, LOWER_SOMEONE_ELSES_HAND: true},
|
|
142
|
+
coHost: {HINT_4: true, LOWER_SOMEONE_ELSES_HAND: true},
|
|
143
|
+
presenter: {HINT_5: true},
|
|
144
|
+
panelist: {HINT_6: true},
|
|
145
|
+
attendee: {HINT_7: true},
|
|
146
|
+
userDisplayHints: [
|
|
147
|
+
'HINT_3',
|
|
148
|
+
'ANONYMOUS_DISPLAY_NAMES_ENABLED',
|
|
149
|
+
'HINT_1',
|
|
150
|
+
'HINT_2',
|
|
151
|
+
'LOWER_SOMEONE_ELSES_HAND',
|
|
152
|
+
],
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
it('includes all interstitial display hints (VOIP_IS_ENABLED and ANONYMOUS_DISPLAY_NAMES_ENABLED) when user has not joined the meeting', () => {
|
|
157
|
+
const interstitialInfo = {
|
|
158
|
+
displayHints: {
|
|
159
|
+
moderator: ['HINT_1', 'HINT_2'],
|
|
160
|
+
joined: [
|
|
161
|
+
'HINT_3',
|
|
162
|
+
'VOIP_IS_ENABLED',
|
|
163
|
+
'ANONYMOUS_DISPLAY_NAMES_ENABLED',
|
|
164
|
+
'HINT_NON_INTERSTITIAL',
|
|
165
|
+
],
|
|
166
|
+
coHost: ['HINT_4'],
|
|
167
|
+
presenter: ['HINT_5'],
|
|
168
|
+
panelist: ['HINT_6'],
|
|
169
|
+
attendee: ['HINT_7'],
|
|
170
|
+
},
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
assert.deepEqual(InfoUtils.parse(interstitialInfo, [], false), {
|
|
174
|
+
policy: {
|
|
175
|
+
HINT_3: true,
|
|
176
|
+
VOIP_IS_ENABLED: true,
|
|
177
|
+
ANONYMOUS_DISPLAY_NAMES_ENABLED: true,
|
|
178
|
+
HINT_NON_INTERSTITIAL: true,
|
|
179
|
+
},
|
|
180
|
+
moderator: {HINT_1: true, HINT_2: true, LOWER_SOMEONE_ELSES_HAND: true},
|
|
181
|
+
coHost: {HINT_4: true, LOWER_SOMEONE_ELSES_HAND: true},
|
|
182
|
+
presenter: {HINT_5: true},
|
|
183
|
+
panelist: {HINT_6: true},
|
|
184
|
+
attendee: {HINT_7: true},
|
|
185
|
+
userDisplayHints: ['VOIP_IS_ENABLED', 'ANONYMOUS_DISPLAY_NAMES_ENABLED'],
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
assert.deepEqual(InfoUtils.parse(interstitialInfo, ['MODERATOR'], false), {
|
|
189
|
+
policy: {
|
|
190
|
+
HINT_3: true,
|
|
191
|
+
VOIP_IS_ENABLED: true,
|
|
192
|
+
ANONYMOUS_DISPLAY_NAMES_ENABLED: true,
|
|
193
|
+
HINT_NON_INTERSTITIAL: true,
|
|
194
|
+
},
|
|
195
|
+
moderator: {HINT_1: true, HINT_2: true, LOWER_SOMEONE_ELSES_HAND: true},
|
|
196
|
+
coHost: {HINT_4: true, LOWER_SOMEONE_ELSES_HAND: true},
|
|
197
|
+
presenter: {HINT_5: true},
|
|
198
|
+
panelist: {HINT_6: true},
|
|
199
|
+
attendee: {HINT_7: true},
|
|
200
|
+
userDisplayHints: [
|
|
201
|
+
'VOIP_IS_ENABLED',
|
|
202
|
+
'ANONYMOUS_DISPLAY_NAMES_ENABLED',
|
|
203
|
+
'HINT_1',
|
|
204
|
+
'HINT_2',
|
|
205
|
+
'LOWER_SOMEONE_ELSES_HAND',
|
|
206
|
+
],
|
|
207
|
+
});
|
|
208
|
+
});
|
|
209
|
+
|
|
114
210
|
it('merges presenter hints when user has PRESENTER role', () => {
|
|
115
211
|
assert.deepEqual(InfoUtils.parse(info, ['PRESENTER']), {
|
|
116
212
|
policy: {HINT_3: true, VOIP_IS_ENABLED: true},
|
|
@@ -358,32 +358,6 @@ describe('plugin-meetings', () => {
|
|
|
358
358
|
});
|
|
359
359
|
});
|
|
360
360
|
|
|
361
|
-
describe('#_toggleTcpReachability', () => {
|
|
362
|
-
it('should have _toggleTcpReachability', () => {
|
|
363
|
-
assert.equal(typeof webex.meetings._toggleTcpReachability, 'function');
|
|
364
|
-
});
|
|
365
|
-
|
|
366
|
-
describe('success', () => {
|
|
367
|
-
it('should update meetings to do TCP reachability', () => {
|
|
368
|
-
webex.meetings._toggleTcpReachability(true);
|
|
369
|
-
assert.equal(webex.meetings.config.experimental.enableTcpReachability, true);
|
|
370
|
-
});
|
|
371
|
-
});
|
|
372
|
-
});
|
|
373
|
-
|
|
374
|
-
describe('#_toggleTlsReachability', () => {
|
|
375
|
-
it('should have _toggleTlsReachability', () => {
|
|
376
|
-
assert.equal(typeof webex.meetings._toggleTlsReachability, 'function');
|
|
377
|
-
});
|
|
378
|
-
|
|
379
|
-
describe('success', () => {
|
|
380
|
-
it('should update meetings to do TLS reachability', () => {
|
|
381
|
-
webex.meetings._toggleTlsReachability(true);
|
|
382
|
-
assert.equal(webex.meetings.config.experimental.enableTlsReachability, true);
|
|
383
|
-
});
|
|
384
|
-
});
|
|
385
|
-
});
|
|
386
|
-
|
|
387
361
|
describe('#_toggleIpv6BackendNativeSupport', () => {
|
|
388
362
|
it('should have _toggleIpv6BackendNativeSupport', () => {
|
|
389
363
|
assert.equal(typeof webex.meetings._toggleIpv6BackendNativeSupport, 'function');
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import 'jsdom-global/register';
|
|
1
2
|
import {assert} from '@webex/test-helper-chai';
|
|
2
3
|
import MockWebex from '@webex/test-helper-mock-webex';
|
|
3
4
|
import { CapabilityState, WebCapabilities } from '@webex/web-capabilities';
|
|
@@ -63,6 +64,13 @@ describe('isAnyPublicClusterReachable', () => {
|
|
|
63
64
|
);
|
|
64
65
|
});
|
|
65
66
|
|
|
67
|
+
it('returns false when only xtls is reachable', async () => {
|
|
68
|
+
await checkIsClusterReachable(
|
|
69
|
+
{x: {udp: {result: 'unreachable'}, tcp: {result: 'unreachable'}, xtls: {result: 'reachable'}}},
|
|
70
|
+
false
|
|
71
|
+
);
|
|
72
|
+
});
|
|
73
|
+
|
|
66
74
|
it('returns false when both tcp and udp are unreachable', async () => {
|
|
67
75
|
await checkIsClusterReachable(
|
|
68
76
|
{x: {udp: {result: 'unreachable'}, tcp: {result: 'unreachable'}}},
|
|
@@ -70,6 +78,13 @@ describe('isAnyPublicClusterReachable', () => {
|
|
|
70
78
|
);
|
|
71
79
|
});
|
|
72
80
|
|
|
81
|
+
it('returns false when udp, tcp and xtls are all unreachable', async () => {
|
|
82
|
+
await checkIsClusterReachable(
|
|
83
|
+
{x: {udp: {result: 'unreachable'}, tcp: {result: 'unreachable'}, xtls: {result: 'unreachable'}}},
|
|
84
|
+
false
|
|
85
|
+
);
|
|
86
|
+
});
|
|
87
|
+
|
|
73
88
|
it('returns false when reachability result is empty', async () => {
|
|
74
89
|
await checkIsClusterReachable({x: {}}, false);
|
|
75
90
|
});
|
|
@@ -510,10 +525,7 @@ describe('gatherReachability', () => {
|
|
|
510
525
|
return mockInstance;
|
|
511
526
|
});
|
|
512
527
|
|
|
513
|
-
webex.config.meetings.
|
|
514
|
-
enableTcpReachability: false,
|
|
515
|
-
enableTlsReachability: false,
|
|
516
|
-
};
|
|
528
|
+
webex.config.meetings.enableReachabilityChecks = {tcp: false, tls: false};
|
|
517
529
|
});
|
|
518
530
|
|
|
519
531
|
afterEach(() => {
|
|
@@ -1229,10 +1241,7 @@ describe('gatherReachability', () => {
|
|
|
1229
1241
|
expectedMetrics,
|
|
1230
1242
|
}) =>
|
|
1231
1243
|
it(`works correctly for the case: ${title}`, async () => {
|
|
1232
|
-
webex.config.meetings.
|
|
1233
|
-
enableTcpReachability: true,
|
|
1234
|
-
enableTlsReachability: true,
|
|
1235
|
-
};
|
|
1244
|
+
webex.config.meetings.enableReachabilityChecks = true;
|
|
1236
1245
|
|
|
1237
1246
|
// the metrics related to ipver and trigger are not tested in these tests and are all the same, so setting them up here
|
|
1238
1247
|
const expectedMetricsFull = {
|
|
@@ -1367,10 +1376,7 @@ describe('gatherReachability', () => {
|
|
|
1367
1376
|
});
|
|
1368
1377
|
|
|
1369
1378
|
it(`starts ip network version detection and includes the results in the metrics`, async () => {
|
|
1370
|
-
webex.config.meetings.
|
|
1371
|
-
enableTcpReachability: true,
|
|
1372
|
-
enableTlsReachability: true,
|
|
1373
|
-
};
|
|
1379
|
+
webex.config.meetings.enableReachabilityChecks = true;
|
|
1374
1380
|
webex.internal.device.ipNetworkDetector = {
|
|
1375
1381
|
supportsIpV4: true,
|
|
1376
1382
|
supportsIpV6: true,
|
|
@@ -1447,10 +1453,7 @@ describe('gatherReachability', () => {
|
|
|
1447
1453
|
});
|
|
1448
1454
|
|
|
1449
1455
|
it('keeps updating reachability results after the 3s public cloud timeout expires', async () => {
|
|
1450
|
-
webex.config.meetings.
|
|
1451
|
-
enableTcpReachability: true,
|
|
1452
|
-
enableTlsReachability: true,
|
|
1453
|
-
};
|
|
1456
|
+
webex.config.meetings.enableReachabilityChecks = true;
|
|
1454
1457
|
|
|
1455
1458
|
const reachability = new Reachability(webex);
|
|
1456
1459
|
|
|
@@ -1546,10 +1549,7 @@ describe('gatherReachability', () => {
|
|
|
1546
1549
|
});
|
|
1547
1550
|
|
|
1548
1551
|
it('handles clientMediaIpsUpdated event by updating clientMediaIps in results', async () => {
|
|
1549
|
-
webex.config.meetings.
|
|
1550
|
-
enableTcpReachability: true,
|
|
1551
|
-
enableTlsReachability: true,
|
|
1552
|
-
};
|
|
1552
|
+
webex.config.meetings.enableReachabilityChecks = true;
|
|
1553
1553
|
|
|
1554
1554
|
const reachability = new Reachability(webex);
|
|
1555
1555
|
|
|
@@ -1634,10 +1634,7 @@ describe('gatherReachability', () => {
|
|
|
1634
1634
|
});
|
|
1635
1635
|
|
|
1636
1636
|
it('starts ClusterReachability on each media cluster', async () => {
|
|
1637
|
-
webex.config.meetings.
|
|
1638
|
-
enableTcpReachability: true,
|
|
1639
|
-
enableTlsReachability: true,
|
|
1640
|
-
};
|
|
1637
|
+
webex.config.meetings.enableReachabilityChecks = true;
|
|
1641
1638
|
|
|
1642
1639
|
const getClustersResult = {
|
|
1643
1640
|
clusters: {
|
|
@@ -1686,10 +1683,7 @@ describe('gatherReachability', () => {
|
|
|
1686
1683
|
});
|
|
1687
1684
|
|
|
1688
1685
|
it('does not do TCP reachability if it is disabled in config', async () => {
|
|
1689
|
-
webex.config.meetings.
|
|
1690
|
-
enableTcpReachability: false,
|
|
1691
|
-
enableTlsReachability: true,
|
|
1692
|
-
};
|
|
1686
|
+
webex.config.meetings.enableReachabilityChecks = {tcp: false, tls: true};
|
|
1693
1687
|
|
|
1694
1688
|
const getClustersResult = {
|
|
1695
1689
|
clusters: {
|
|
@@ -1720,10 +1714,7 @@ describe('gatherReachability', () => {
|
|
|
1720
1714
|
});
|
|
1721
1715
|
|
|
1722
1716
|
it('does not do TLS reachability if it is disabled in config', async () => {
|
|
1723
|
-
webex.config.meetings.
|
|
1724
|
-
enableTcpReachability: true,
|
|
1725
|
-
enableTlsReachability: false,
|
|
1726
|
-
};
|
|
1717
|
+
webex.config.meetings.enableReachabilityChecks = {tcp: true, tls: false};
|
|
1727
1718
|
|
|
1728
1719
|
const getClustersResult = {
|
|
1729
1720
|
clusters: {
|
|
@@ -1755,10 +1746,7 @@ describe('gatherReachability', () => {
|
|
|
1755
1746
|
});
|
|
1756
1747
|
|
|
1757
1748
|
it('does not do TCP or TLS reachability if it is disabled in config', async () => {
|
|
1758
|
-
webex.config.meetings.
|
|
1759
|
-
enableTcpReachability: false,
|
|
1760
|
-
enableTlsReachability: false,
|
|
1761
|
-
};
|
|
1749
|
+
webex.config.meetings.enableReachabilityChecks = {tcp: false, tls: false};
|
|
1762
1750
|
|
|
1763
1751
|
const getClustersResult = {
|
|
1764
1752
|
clusters: {
|
|
@@ -1789,12 +1777,40 @@ describe('gatherReachability', () => {
|
|
|
1789
1777
|
}, undefined);
|
|
1790
1778
|
});
|
|
1791
1779
|
|
|
1792
|
-
it('
|
|
1793
|
-
webex.config.meetings.
|
|
1794
|
-
|
|
1795
|
-
|
|
1780
|
+
it('does UDP, TCP and TLS reachability by default (enableReachabilityChecks=true)', async () => {
|
|
1781
|
+
webex.config.meetings.enableReachabilityChecks = true;
|
|
1782
|
+
|
|
1783
|
+
const getClustersResult = {
|
|
1784
|
+
clusters: {
|
|
1785
|
+
'cluster name': {
|
|
1786
|
+
udp: ['testUDP1', 'testUDP2'],
|
|
1787
|
+
tcp: ['testTCP1', 'testTCP2'],
|
|
1788
|
+
xtls: ['testXTLS1', 'testXTLS2'],
|
|
1789
|
+
isVideoMesh: false,
|
|
1790
|
+
},
|
|
1791
|
+
},
|
|
1792
|
+
joinCookie: {id: 'id'},
|
|
1796
1793
|
};
|
|
1797
1794
|
|
|
1795
|
+
const reachability = new Reachability(webex);
|
|
1796
|
+
|
|
1797
|
+
reachability.reachabilityRequest.getClusters = sinon.stub().returns(getClustersResult);
|
|
1798
|
+
|
|
1799
|
+
const promise = reachability.gatherReachability('test');
|
|
1800
|
+
await simulateTimeout();
|
|
1801
|
+
await promise;
|
|
1802
|
+
|
|
1803
|
+
assert.calledOnceWithExactly(clusterReachabilityCtorStub, 'cluster name', {
|
|
1804
|
+
isVideoMesh: false,
|
|
1805
|
+
udp: ['testUDP1', 'testUDP2'],
|
|
1806
|
+
tcp: ['testTCP1', 'testTCP2'],
|
|
1807
|
+
xtls: ['testXTLS1', 'testXTLS2'],
|
|
1808
|
+
}, undefined);
|
|
1809
|
+
});
|
|
1810
|
+
|
|
1811
|
+
it('retry of getClusters is succesfull', async () => {
|
|
1812
|
+
webex.config.meetings.enableReachabilityChecks = {tcp: true, tls: false};
|
|
1813
|
+
|
|
1798
1814
|
const getClustersResult = {
|
|
1799
1815
|
clusters: {
|
|
1800
1816
|
'cluster name': {
|
|
@@ -1866,10 +1882,7 @@ describe('gatherReachability', () => {
|
|
|
1866
1882
|
};
|
|
1867
1883
|
|
|
1868
1884
|
beforeEach(() => {
|
|
1869
|
-
webex.config.meetings.
|
|
1870
|
-
enableTcpReachability: true,
|
|
1871
|
-
enableTlsReachability: true,
|
|
1872
|
-
};
|
|
1885
|
+
webex.config.meetings.enableReachabilityChecks = true;
|
|
1873
1886
|
|
|
1874
1887
|
receivedEvents = {
|
|
1875
1888
|
done: 0,
|
|
@@ -2133,7 +2146,7 @@ describe('gatherReachability', () => {
|
|
|
2133
2146
|
receivedEvents[event] = receivedEvents[event] + 1 || 1;
|
|
2134
2147
|
});
|
|
2135
2148
|
};
|
|
2136
|
-
|
|
2149
|
+
|
|
2137
2150
|
it('works as expected', async () => {
|
|
2138
2151
|
setListener('reachability:stopped');
|
|
2139
2152
|
setListener('reachability:done');
|
|
@@ -2948,4 +2961,4 @@ describe('isSubnetReachable', () => {
|
|
|
2948
2961
|
it(`returns false if the subnet is unreachable`, () => {
|
|
2949
2962
|
assert(!reachability.isSubnetReachable('11'));
|
|
2950
2963
|
});
|
|
2951
|
-
});
|
|
2964
|
+
});
|
|
@@ -3,9 +3,40 @@ import {assert} from '@webex/test-helper-chai';
|
|
|
3
3
|
import {
|
|
4
4
|
convertStunUrlToTurn,
|
|
5
5
|
convertStunUrlToTurnTls,
|
|
6
|
+
isReachabilityEnabled,
|
|
7
|
+
resolveReachabilityProtocols,
|
|
6
8
|
} from '@webex/plugin-meetings/src/reachability/util';
|
|
7
9
|
|
|
8
10
|
describe('plugin-meetings/src/reachability/util', () => {
|
|
11
|
+
describe('#resolveReachabilityProtocols()', () => {
|
|
12
|
+
[
|
|
13
|
+
{title: 'undefined defaults to all enabled', config: undefined, expected: {udp: true, tcp: true, tls: true}},
|
|
14
|
+
{title: 'true enables all protocols', config: true, expected: {udp: true, tcp: true, tls: true}},
|
|
15
|
+
{title: 'false disables all protocols', config: false, expected: {udp: false, tcp: false, tls: false}},
|
|
16
|
+
{title: 'empty object keeps udp on and defaults tcp/tls to enabled', config: {}, expected: {udp: true, tcp: true, tls: true}},
|
|
17
|
+
{title: 'object can disable tcp', config: {tcp: false}, expected: {udp: true, tcp: false, tls: true}},
|
|
18
|
+
{title: 'object can disable tls', config: {tls: false}, expected: {udp: true, tcp: true, tls: false}},
|
|
19
|
+
{title: 'object can disable both tcp and tls but udp stays on', config: {tcp: false, tls: false}, expected: {udp: true, tcp: false, tls: false}},
|
|
20
|
+
].forEach(({title, config, expected}) => {
|
|
21
|
+
it(`resolves: ${title}`, () => {
|
|
22
|
+
assert.deepEqual(resolveReachabilityProtocols(config as any), expected);
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
describe('#isReachabilityEnabled()', () => {
|
|
28
|
+
[
|
|
29
|
+
{title: 'undefined', config: undefined, expected: true},
|
|
30
|
+
{title: 'true', config: true, expected: true},
|
|
31
|
+
{title: 'false', config: false, expected: false},
|
|
32
|
+
{title: 'object disabling tcp and tls (udp still on)', config: {tcp: false, tls: false}, expected: true},
|
|
33
|
+
].forEach(({title, config, expected}) => {
|
|
34
|
+
it(`returns ${expected} for ${title}`, () => {
|
|
35
|
+
assert.equal(isReachabilityEnabled(config as any), expected);
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
|
|
9
40
|
describe('#convertStunUrlToTurn()', () => {
|
|
10
41
|
[
|
|
11
42
|
{
|