dd-trace 5.131.0 → 5.131.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dd-trace",
3
- "version": "5.131.0",
3
+ "version": "5.131.1",
4
4
  "description": "Datadog APM tracing client for JavaScript",
5
5
  "main": "index.js",
6
6
  "typings": "index.d.ts",
@@ -41,7 +41,7 @@
41
41
  "test:debugger": "mocha \"packages/dd-trace/test/debugger/**/*.spec.js\"",
42
42
  "test:debugger:ci": "node scripts/c8-ci.js test:debugger",
43
43
  "test:eslint-rules": "node scripts/run-eslint-rule-tests.mjs eslint-rules/*.test.mjs",
44
- "test:trace:core": "node scripts/mocha-parallel-files.js --expose-gc --timeout 30000 -- \"packages/dd-trace/test/*.spec.js\" \"packages/dd-trace/test/{agent,ci-visibility,config,crashtracking,datastreams,encode,exporters,log-submission,msgpack,opentelemetry,opentracing,payload-tagging,plugins,remote_config,service-naming,standalone,telemetry,external-logger}/**/*.spec.js\"",
44
+ "test:trace:core": "node scripts/mocha-parallel-files.js --expose-gc --timeout 30000 -- \"packages/dd-trace/test/*.spec.js\" \"packages/dd-trace/test/{agent,ci-visibility,config,crashtracking,datastreams,encode,exporters,log-submission,msgpack,opentelemetry,opentracing,payload-tagging,plugins,remote_config,service-naming,setup,standalone,telemetry,external-logger}/**/*.spec.js\"",
45
45
  "test:trace:core:ci": "node scripts/c8-ci.js test:trace:core",
46
46
  "test:trace:guardrails": "mocha \"packages/dd-trace/test/guardrails/**/*.spec.js\"",
47
47
  "test:trace:guardrails:ci": "node scripts/c8-ci.js test:trace:guardrails",
@@ -216,7 +216,6 @@
216
216
  "@types/sinon": "^22.0.0",
217
217
  "@vercel/nft": "^1.11.0",
218
218
  "@yarnpkg/lockfile": "^1.1.0",
219
- "axios": "^1.20.0",
220
219
  "benchmark": "^2.1.4",
221
220
  "body-parser": "^2.3.0",
222
221
  "bun": "1.4.2",
@@ -227,14 +226,14 @@
227
226
  "eslint-plugin-import-x": "^4.16.2",
228
227
  "eslint-plugin-jsdoc": "^64.5.4",
229
228
  "eslint-plugin-mocha": "^12.0.2",
230
- "eslint-plugin-n": "^18.3.0",
229
+ "eslint-plugin-n": "^18.4.0",
231
230
  "eslint-plugin-promise": "^7.3.0",
232
231
  "eslint-plugin-regexp": "^3.3.1",
233
- "eslint-plugin-sonarjs": "^4.2.1",
232
+ "eslint-plugin-sonarjs": "^4.2.2",
234
233
  "eslint-plugin-unicorn": "^74.0.0",
235
234
  "express": "^5.1.0",
236
235
  "glob": "^10.4.5",
237
- "globals": "^17.12.0",
236
+ "globals": "^17.13.0",
238
237
  "graphql": "*",
239
238
  "husky": "^9.1.7",
240
239
  "istanbul-lib-coverage": "^3.2.2",
@@ -3655,9 +3655,9 @@
3655
3655
  ],
3656
3656
  "DD_TRACE_OBFUSCATION_QUERY_STRING_REGEXP": [
3657
3657
  {
3658
- "implementation": "F",
3658
+ "implementation": "I",
3659
3659
  "type": "string",
3660
- "default": "(?:p(?:ass)?w(?:or)?d|pass(?:_?phrase)?|secret|(?:api_?|private_?|public_?|access_?|secret_?)key(?:_?id)?|token|consumer_?(?:id|key|secret)|sign(?:ed|ature)?|auth(?:entication|orization)?)(?:(?:\\s|%20)*(?:=|%3D)[^&]+|(?:\"|%22)(?:\\s|%20)*(?::|%3A)(?:\\s|%20)*(?:\"|%22)(?:%2[^2]|%[^2]|[^\"%])+(?:\"|%22))|bearer(?:\\s|%20)+[a-z0-9\\._\\-]+|token(?::|%3A)[a-z0-9]{13}|gh[opsu]_[0-9a-zA-Z]{36}|ey[I-L](?:[\\w=-]|%3D)+\\.ey[I-L](?:[\\w=-]|%3D)+(?:\\.(?:[\\w.+\\/=-]|%3D|%2F|%2B)+)?|[\\-]{5}BEGIN(?:[a-z\\s]|%20)+PRIVATE(?:\\s|%20)KEY[\\-]{5}[^\\-]+[\\-]{5}END(?:[a-z\\s]|%20)+PRIVATE(?:\\s|%20)KEY|ssh-rsa(?:\\s|%20)*(?:[a-z0-9\\/\\.+]|%2F|%5C|%2B){100,}"
3660
+ "default": "(?:(?:\"|%22)?)(?:(?:old[-_]?|new[-_]?)?p(?:ass)?w(?:or)?d(?:1|2)?|pass(?:[-_]?phrase)?|secret|(?:api[-_]?|private[-_]?|public[-_]?|access[-_]?|secret[-_]?|app(?:lication)?[-_]?)key(?:[-_]?id)?|token|consumer[-_]?(?:id|key|secret)|sign(?:ed|ature)?|auth(?:entication|orization)?)(?:(?:\\s|%20)*(?:=|%3D)[^&]+|(?:\"|%22)(?:\\s|%20)*(?::|%3A)(?:\\s|%20)*(?:\"|%22)(?:%2[^2]|%[^2]|[^\"%])+(?:\"|%22))|(?:bearer(?:\\s|%20)+[a-z0-9._\\-]+|token(?::|%3A)[a-z0-9]{13}|gh[opsu]_[0-9a-zA-Z]{36}|(^|[^\\w%-]|%[0-9a-f]{2})ey[I-L][\\w-]+(?:=|%3D)*\\.ey[I-L][\\w-]+(?:=|%3D)*(?:\\.(?:[\\w.+/=-]|%3D|%2F|%2B)+)?|-{5}BEGIN(?:[a-z\\s]|%20)+PRIVATE(?:\\s|%20)KEY-{5}[^\\-]+-{5}END(?:[a-z\\s]|%20)+PRIVATE(?:\\s|%20)KEY(?:-{5})?(?:\\n|%0A)?|(?:ssh-(?:rsa|dss)|ecdsa-[a-z0-9]+-[a-z0-9]+)(?:\\s|%20|%09)+(?:[a-z0-9/.+]|%2F|%5C|%2B){100,}(?:=|%3D)*(?:(?:\\s|%20|%09)+[a-z0-9._-]+)?)"
3661
3661
  }
3662
3662
  ],
3663
3663
  "DD_TRACE_OPENAI_ENABLED": [
@@ -2,6 +2,7 @@
2
2
 
3
3
  const { URL } = require('url')
4
4
 
5
+ const { defaults } = require('../../config/defaults')
5
6
  const log = require('../../log')
6
7
 
7
8
  const HTTP2_HEADER_AUTHORITY = ':authority'
@@ -55,12 +56,15 @@ function obfuscateQs (config, url) {
55
56
 
56
57
  let qs = url.slice(i + 1)
57
58
 
58
- qs = qs.replace(queryStringObfuscation, '<redacted>')
59
+ // Group 1 of the default regex is the delimiter in front of a JWT. A user-provided regex may capture the secret.
60
+ const replacement = queryStringObfuscation === defaultQsObfuscator ? '$1<redacted>' : '<redacted>'
61
+ qs = qs.replace(queryStringObfuscation, replacement)
59
62
 
60
63
  return `${path}?${qs}`
61
64
  }
62
65
 
63
66
  const qsObfuscatorCache = new Map()
67
+ let defaultQsObfuscator
64
68
 
65
69
  /**
66
70
  * Compile the configured query-string obfuscator (a regex string, or a boolean)
@@ -85,6 +89,7 @@ function getQsObfuscator (config) {
85
89
  } else if (obfuscator !== '.*') { // '.*' optimizes to a full redact (true)
86
90
  try {
87
91
  compiled = new RegExp(obfuscator, 'gi')
92
+ if (obfuscator === defaults.DD_TRACE_OBFUSCATION_QUERY_STRING_REGEXP) defaultQsObfuscator = compiled
88
93
  } catch (err) {
89
94
  log.error('Error getting qs obfuscator', err)
90
95
  }