Skip to content

Commit

Permalink
Lower node target + better cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
lramos15 committed Aug 27, 2021
1 parent e55b109 commit d9b8bd8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .esbuild.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ esbuild.build({
external: ['vscode'],
sourcemap: true,
platform: 'node',
target: ['node12'],
outfile: 'lib/telemetryReporter.node.js',
}).catch(() => process.exit(1))

Expand All @@ -30,6 +31,7 @@ esbuild.build({
external: ['vscode'],
minify: true,
platform: 'node',
target: ['node12'],
outfile: 'lib/telemetryReporter.node.min.js',
}).catch(() => process.exit(1))

Expand Down
7 changes: 3 additions & 4 deletions src/common/baseTelemetryReporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,11 @@ export class BaseTelemtryReporter {

// Regex which matches @*.site
const emailRegex = /@[a-zA-Z0-9-.]+/;
const secretRegex = /\S*(key|token|sig|password|passwd|pwd)[="':\s]+\S*/;

// Check for common user data in the telemetry events
if (value.toLowerCase().indexOf("token=") !== -1) {
cleanedObject[key] = "<REDACTED: token>";
} else if (value.toLowerCase().indexOf("ssword=") !== -1 || value.toLowerCase().indexOf("sswd=") !== -1) {
cleanedObject[key] = "<REDACTED: password>";
if (secretRegex.test(value.toLowerCase())) {
cleanedObject[key] = "<REDACTED: secret>";
} else if (emailRegex.test(value)) {
cleanedObject[key] = "<REDACTED: email>";
} else {
Expand Down

0 comments on commit d9b8bd8

Please sign in to comment.