Skip to content

Commit 1314c51

Browse files
authored
rename authority tunneling -> tunnel & simplify code (microsoft#167154)
1 parent c816a6b commit 1314c51

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/vs/platform/telemetry/common/telemetryUtils.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { URI } from 'vs/base/common/uri';
1010
import { ConfigurationTarget, ConfigurationTargetToString, IConfigurationService } from 'vs/platform/configuration/common/configuration';
1111
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
1212
import { IProductService } from 'vs/platform/product/common/productService';
13+
import { getRemoteName } from 'vs/platform/remote/common/remoteHosts';
1314
import { verifyMicrosoftInternalDomain } from 'vs/platform/telemetry/common/commonProperties';
1415
import { ClassifiedEvent, IGDPRProperty, OmitMetadata, StrictPropertyCheck } from 'vs/platform/telemetry/common/gdprTypings';
1516
import { ICustomEndpointTelemetryService, ITelemetryData, ITelemetryEndpoint, ITelemetryInfo, ITelemetryService, TelemetryConfiguration, TelemetryLevel, TELEMETRY_OLD_SETTING_ID, TELEMETRY_SETTING_ID } from 'vs/platform/telemetry/common/telemetry';
@@ -227,20 +228,14 @@ export function validateTelemetryData(data?: any): { properties: Properties; mea
227228
};
228229
}
229230

230-
const telemetryAllowedAuthorities: readonly string[] = ['ssh-remote', 'dev-container', 'attached-container', 'wsl', 'tunneling', 'codespaces'];
231+
const telemetryAllowedAuthorities = new Set(['ssh-remote', 'dev-container', 'attached-container', 'wsl', 'tunnel', 'codespaces']);
231232

232233
export function cleanRemoteAuthority(remoteAuthority?: string): string {
233234
if (!remoteAuthority) {
234235
return 'none';
235236
}
236-
237-
for (const authority of telemetryAllowedAuthorities) {
238-
if (remoteAuthority.startsWith(`${authority}+`)) {
239-
return authority;
240-
}
241-
}
242-
243-
return 'other';
237+
const remoteName = getRemoteName(remoteAuthority);
238+
return telemetryAllowedAuthorities.has(remoteName) ? remoteName : 'other';
244239
}
245240

246241
function flatten(obj: any, result: { [key: string]: any }, order: number = 0, prefix?: string): void {

0 commit comments

Comments
 (0)