From e8426c9ac9e801b17977c385402ec0c3c5072c70 Mon Sep 17 00:00:00 2001 From: simon-id Date: Tue, 30 Jan 2024 11:49:03 +0100 Subject: [PATCH 1/8] remove crypto-randomuuid --- LICENSE-3rdparty.csv | 1 - package.json | 1 - packages/dd-trace/src/appsec/remote_config/manager.js | 2 +- packages/dd-trace/src/config.js | 2 +- packages/dd-trace/test/appsec/remote_config/manager.spec.js | 6 +++--- yarn.lock | 5 ----- 6 files changed, 5 insertions(+), 12 deletions(-) diff --git a/LICENSE-3rdparty.csv b/LICENSE-3rdparty.csv index 467bc7a4feb..c156861ca89 100644 --- a/LICENSE-3rdparty.csv +++ b/LICENSE-3rdparty.csv @@ -7,7 +7,6 @@ require,@datadog/pprof,Apache license 2.0,Copyright 2019 Google Inc. require,@datadog/sketches-js,Apache license 2.0,Copyright 2020 Datadog Inc. require,@opentelemetry/api,Apache license 2.0,Copyright OpenTelemetry Authors require,@opentelemetry/core,Apache license 2.0,Copyright OpenTelemetry Authors -require,crypto-randomuuid,MIT,Copyright 2021 Node.js Foundation and contributors require,dc-polyfill,MIT,Copyright 2023 Datadog Inc. require,ignore,MIT,Copyright 2013 Kael Zhang and contributors require,import-in-the-middle,Apache license 2.0,Copyright 2021 Datadog Inc. diff --git a/package.json b/package.json index 210572ce113..17ff51a015a 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,6 @@ "@datadog/sketches-js": "^2.1.0", "@opentelemetry/api": "^1.0.0", "@opentelemetry/core": "^1.14.0", - "crypto-randomuuid": "^1.0.0", "dc-polyfill": "^0.1.2", "ignore": "^5.2.4", "import-in-the-middle": "^1.7.3", diff --git a/packages/dd-trace/src/appsec/remote_config/manager.js b/packages/dd-trace/src/appsec/remote_config/manager.js index 9cc636cd302..53e011563e8 100644 --- a/packages/dd-trace/src/appsec/remote_config/manager.js +++ b/packages/dd-trace/src/appsec/remote_config/manager.js @@ -1,7 +1,7 @@ 'use strict' const { URL, format } = require('url') -const uuid = require('crypto-randomuuid') +const { randomUUID: uuid } = require('crypto') const { EventEmitter } = require('events') const tracerVersion = require('../../../../../package.json').version const request = require('../../exporters/common/request') diff --git a/packages/dd-trace/src/config.js b/packages/dd-trace/src/config.js index 7b992e31194..d7fafaa61f9 100644 --- a/packages/dd-trace/src/config.js +++ b/packages/dd-trace/src/config.js @@ -2,7 +2,7 @@ const fs = require('fs') const os = require('os') -const uuid = require('crypto-randomuuid') +const { randomUUID: uuid } = require('crypto') const URL = require('url').URL const log = require('./log') const pkg = require('./pkg') diff --git a/packages/dd-trace/test/appsec/remote_config/manager.spec.js b/packages/dd-trace/test/appsec/remote_config/manager.spec.js index 4c4d2ad1ccd..b0bc710b028 100644 --- a/packages/dd-trace/test/appsec/remote_config/manager.spec.js +++ b/packages/dd-trace/test/appsec/remote_config/manager.spec.js @@ -6,7 +6,7 @@ const { UNACKNOWLEDGED, ACKNOWLEDGED, ERROR } = require('../../../src/appsec/rem const noop = () => {} describe('RemoteConfigManager', () => { - let uuid + let randomUUID let scheduler let Scheduler let request @@ -17,7 +17,7 @@ describe('RemoteConfigManager', () => { let rc beforeEach(() => { - uuid = sinon.stub().returns('1234-5678') + randomUUID = sinon.stub().returns('1234-5678') scheduler = { start: sinon.spy(), @@ -35,7 +35,7 @@ describe('RemoteConfigManager', () => { extraServices = [] RemoteConfigManager = proxyquire('../src/appsec/remote_config/manager', { - 'crypto-randomuuid': uuid, + 'crypto': { randomUUID }, './scheduler': Scheduler, '../../../../../package.json': { version: '3.0.0' }, '../../exporters/common/request': request, diff --git a/yarn.lock b/yarn.lock index c0194b237bb..3a021a7b43b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1662,11 +1662,6 @@ cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3: shebang-command "^2.0.0" which "^2.0.1" -crypto-randomuuid@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/crypto-randomuuid/-/crypto-randomuuid-1.0.0.tgz" - integrity sha512-/RC5F4l1SCqD/jazwUF6+t34Cd8zTSAGZ7rvvZu1whZUhD2a5MOGKjSGowoGcpj/cbVZk1ZODIooJEQQq3nNAA== - csstype@^3.0.2: version "3.1.3" resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.3.tgz#d80ff294d114fb0e6ac500fbf85b60137d7eff81" From ab13604bfe839d3664eacbf38f30c3f17c08c669 Mon Sep 17 00:00:00 2001 From: simon-id Date: Tue, 30 Jan 2024 12:00:15 +0100 Subject: [PATCH 2/8] remove ipaddr.js --- LICENSE-3rdparty.csv | 1 - package.json | 1 - .../dd-trace/src/plugins/util/ip_blocklist.js | 51 ------------------- .../dd-trace/src/plugins/util/ip_extractor.js | 2 +- yarn.lock | 5 -- 5 files changed, 1 insertion(+), 59 deletions(-) delete mode 100644 packages/dd-trace/src/plugins/util/ip_blocklist.js diff --git a/LICENSE-3rdparty.csv b/LICENSE-3rdparty.csv index c156861ca89..1e58c9bcf36 100644 --- a/LICENSE-3rdparty.csv +++ b/LICENSE-3rdparty.csv @@ -11,7 +11,6 @@ require,dc-polyfill,MIT,Copyright 2023 Datadog Inc. require,ignore,MIT,Copyright 2013 Kael Zhang and contributors require,import-in-the-middle,Apache license 2.0,Copyright 2021 Datadog Inc. require,int64-buffer,MIT,Copyright 2015-2016 Yusuke Kawasaki -require,ipaddr.js,MIT,Copyright 2011-2017 whitequark require,istanbul-lib-coverage,BSD-3-Clause,Copyright 2012-2015 Yahoo! Inc. require,jest-docblock,MIT,Copyright Meta Platforms, Inc. and affiliates. require,koalas,MIT,Copyright 2013-2017 Brian Woodward diff --git a/package.json b/package.json index 17ff51a015a..9332d3c6b74 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,6 @@ "ignore": "^5.2.4", "import-in-the-middle": "^1.7.3", "int64-buffer": "^0.1.9", - "ipaddr.js": "^2.1.0", "istanbul-lib-coverage": "3.2.0", "jest-docblock": "^29.7.0", "koalas": "^1.0.2", diff --git a/packages/dd-trace/src/plugins/util/ip_blocklist.js b/packages/dd-trace/src/plugins/util/ip_blocklist.js deleted file mode 100644 index f346a1571b8..00000000000 --- a/packages/dd-trace/src/plugins/util/ip_blocklist.js +++ /dev/null @@ -1,51 +0,0 @@ -'use strict' - -const semver = require('semver') - -if (semver.satisfies(process.version, '>=14.18.0')) { - const net = require('net') - - module.exports = net.BlockList -} else { - const ipaddr = require('ipaddr.js') - - module.exports = class BlockList { - constructor () { - this.v4Ranges = [] - this.v6Ranges = [] - } - - addSubnet (net, prefix, type) { - this[type === 'ipv4' ? 'v4Ranges' : 'v6Ranges'].push(ipaddr.parseCIDR(`${net}/${prefix}`)) - } - - check (address, type) { - try { - let ip = ipaddr.parse(address) - - type = ip.kind() - - if (type === 'ipv6') { - for (const range of this.v6Ranges) { - if (ip.match(range)) return true - } - - if (ip.isIPv4MappedAddress()) { - ip = ip.toIPv4Address() - type = ip.kind() - } - } - - if (type === 'ipv4') { - for (const range of this.v4Ranges) { - if (ip.match(range)) return true - } - } - - return false - } catch { - return false - } - } - } -} diff --git a/packages/dd-trace/src/plugins/util/ip_extractor.js b/packages/dd-trace/src/plugins/util/ip_extractor.js index 14d87ec64c0..969b02746b5 100644 --- a/packages/dd-trace/src/plugins/util/ip_extractor.js +++ b/packages/dd-trace/src/plugins/util/ip_extractor.js @@ -1,6 +1,6 @@ 'use strict' -const BlockList = require('./ip_blocklist') +const { BlockList } = require('net') const net = require('net') const ipHeaderList = [ diff --git a/yarn.lock b/yarn.lock index 3a021a7b43b..faadb304332 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2941,11 +2941,6 @@ ipaddr.js@1.9.1: resolved "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz" integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== -ipaddr.js@^2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.1.0.tgz" - integrity sha512-LlbxQ7xKzfBusov6UMi4MFpEg0m+mAm9xyNGEduwXMEDuf4WfzB/RZwMVYEd7IKGvh4IUkEXYxtAVu9T3OelJQ== - is-arguments@^1.0.4, is-arguments@^1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz" From 924501ef74d6c1fecf60523a57cc12ded4a6512d Mon Sep 17 00:00:00 2001 From: simon-id Date: Tue, 30 Jan 2024 12:10:17 +0100 Subject: [PATCH 3/8] remove node-abort-controller --- LICENSE-3rdparty.csv | 1 - package.json | 1 - packages/datadog-instrumentations/src/apollo-server-core.js | 1 - packages/datadog-instrumentations/src/apollo-server.js | 1 - packages/datadog-instrumentations/src/body-parser.js | 1 - packages/datadog-instrumentations/src/cookie-parser.js | 1 - packages/datadog-instrumentations/src/express.js | 1 - packages/datadog-instrumentations/src/graphql.js | 2 -- packages/datadog-instrumentations/src/http/server.js | 1 - packages/datadog-plugin-http/test/server.spec.js | 1 - packages/dd-trace/test/appsec/blocking.spec.js | 2 -- yarn.lock | 5 ----- 12 files changed, 18 deletions(-) diff --git a/LICENSE-3rdparty.csv b/LICENSE-3rdparty.csv index 1e58c9bcf36..4d9e88cf060 100644 --- a/LICENSE-3rdparty.csv +++ b/LICENSE-3rdparty.csv @@ -20,7 +20,6 @@ require,lru-cache,ISC,Copyright (c) 2010-2022 Isaac Z. Schlueter and Contributor require,methods,MIT,Copyright 2013-2014 TJ Holowaychuk require,module-details-from-path,MIT,Copyright 2016 Thomas Watson Steen require,msgpack-lite,MIT,Copyright 2015 Yusuke Kawasaki -require,node-abort-controller,MIT,Copyright (c) 2019 Steve Faulkner require,opentracing,MIT,Copyright 2016 Resonance Labs Inc require,path-to-regexp,MIT,Copyright 2014 Blake Embrey require,pprof-format,MIT,Copyright 2022 Stephen Belanger diff --git a/package.json b/package.json index 9332d3c6b74..e563f6be6f9 100644 --- a/package.json +++ b/package.json @@ -90,7 +90,6 @@ "methods": "^1.1.2", "module-details-from-path": "^1.0.3", "msgpack-lite": "^0.1.26", - "node-abort-controller": "^3.1.1", "opentracing": ">=0.12.1", "path-to-regexp": "^0.1.2", "pprof-format": "^2.0.7", diff --git a/packages/datadog-instrumentations/src/apollo-server-core.js b/packages/datadog-instrumentations/src/apollo-server-core.js index 52db88973d7..3f075ab6938 100644 --- a/packages/datadog-instrumentations/src/apollo-server-core.js +++ b/packages/datadog-instrumentations/src/apollo-server-core.js @@ -1,6 +1,5 @@ 'use strict' -const { AbortController } = require('node-abort-controller') const { addHook } = require('./helpers/instrument') const shimmer = require('../../datadog-shimmer') const dc = require('dc-polyfill') diff --git a/packages/datadog-instrumentations/src/apollo-server.js b/packages/datadog-instrumentations/src/apollo-server.js index c0f4b2bbf69..35e26a64d47 100644 --- a/packages/datadog-instrumentations/src/apollo-server.js +++ b/packages/datadog-instrumentations/src/apollo-server.js @@ -1,6 +1,5 @@ 'use strict' -const { AbortController } = require('node-abort-controller') const dc = require('dc-polyfill') const { addHook } = require('./helpers/instrument') diff --git a/packages/datadog-instrumentations/src/body-parser.js b/packages/datadog-instrumentations/src/body-parser.js index a73c377ba9a..3e3d7503231 100644 --- a/packages/datadog-instrumentations/src/body-parser.js +++ b/packages/datadog-instrumentations/src/body-parser.js @@ -1,6 +1,5 @@ 'use strict' -const { AbortController } = require('node-abort-controller') // AbortController is not available in node <15 const shimmer = require('../../datadog-shimmer') const { channel, addHook } = require('./helpers/instrument') diff --git a/packages/datadog-instrumentations/src/cookie-parser.js b/packages/datadog-instrumentations/src/cookie-parser.js index 94a30818e23..7a13682e5b0 100644 --- a/packages/datadog-instrumentations/src/cookie-parser.js +++ b/packages/datadog-instrumentations/src/cookie-parser.js @@ -1,6 +1,5 @@ 'use strict' -const { AbortController } = require('node-abort-controller') // AbortController is not available in node <15 const shimmer = require('../../datadog-shimmer') const { channel, addHook } = require('./helpers/instrument') diff --git a/packages/datadog-instrumentations/src/express.js b/packages/datadog-instrumentations/src/express.js index b07c38a42fe..7dd1eaf6126 100644 --- a/packages/datadog-instrumentations/src/express.js +++ b/packages/datadog-instrumentations/src/express.js @@ -3,7 +3,6 @@ const { createWrapRouterMethod } = require('./router') const shimmer = require('../../datadog-shimmer') const { addHook, channel } = require('./helpers/instrument') -const { AbortController } = require('node-abort-controller') const handleChannel = channel('apm:express:request:handle') diff --git a/packages/datadog-instrumentations/src/graphql.js b/packages/datadog-instrumentations/src/graphql.js index 11e917a30a9..c776c4f4fa5 100644 --- a/packages/datadog-instrumentations/src/graphql.js +++ b/packages/datadog-instrumentations/src/graphql.js @@ -1,7 +1,5 @@ 'use strict' -const { AbortController } = require('node-abort-controller') - const { addHook, channel, diff --git a/packages/datadog-instrumentations/src/http/server.js b/packages/datadog-instrumentations/src/http/server.js index 680e6b8dcbf..14bccd88994 100644 --- a/packages/datadog-instrumentations/src/http/server.js +++ b/packages/datadog-instrumentations/src/http/server.js @@ -1,6 +1,5 @@ 'use strict' -const { AbortController } = require('node-abort-controller') // AbortController is not available in node <15 const { channel, addHook diff --git a/packages/datadog-plugin-http/test/server.spec.js b/packages/datadog-plugin-http/test/server.spec.js index 4f6f5a15ed3..91d98f92c9c 100644 --- a/packages/datadog-plugin-http/test/server.spec.js +++ b/packages/datadog-plugin-http/test/server.spec.js @@ -1,6 +1,5 @@ 'use strict' -const { AbortController } = require('node-abort-controller') // AbortController is not available in node <15 const getPort = require('get-port') const agent = require('../../dd-trace/test/plugins/agent') const axios = require('axios') diff --git a/packages/dd-trace/test/appsec/blocking.spec.js b/packages/dd-trace/test/appsec/blocking.spec.js index 0096a1938d4..023d575ef26 100644 --- a/packages/dd-trace/test/appsec/blocking.spec.js +++ b/packages/dd-trace/test/appsec/blocking.spec.js @@ -1,7 +1,5 @@ 'use strict' -const { AbortController } = require('node-abort-controller') - describe('blocking', () => { const defaultBlockedTemplate = { html: 'block test', diff --git a/yarn.lock b/yarn.lock index faadb304332..2d29badeb46 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3728,11 +3728,6 @@ nock@^11.3.3: mkdirp "^0.5.0" propagate "^2.0.0" -node-abort-controller@^3.1.1: - version "3.1.1" - resolved "https://registry.npmjs.org/node-abort-controller/-/node-abort-controller-3.1.1.tgz" - integrity sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ== - node-addon-api@^6.1.0: version "6.1.0" resolved "https://registry.npmjs.org/node-addon-api/-/node-addon-api-6.1.0.tgz" From eb1bcca4cabc095d8e33c4aad524dc38ab6424d1 Mon Sep 17 00:00:00 2001 From: simon-id Date: Tue, 30 Jan 2024 12:24:24 +0100 Subject: [PATCH 4/8] remove methods --- LICENSE-3rdparty.csv | 1 - package.json | 1 - packages/datadog-instrumentations/src/router.js | 2 +- yarn.lock | 2 +- 4 files changed, 2 insertions(+), 4 deletions(-) diff --git a/LICENSE-3rdparty.csv b/LICENSE-3rdparty.csv index 4d9e88cf060..9478a6966e4 100644 --- a/LICENSE-3rdparty.csv +++ b/LICENSE-3rdparty.csv @@ -17,7 +17,6 @@ require,koalas,MIT,Copyright 2013-2017 Brian Woodward require,limiter,MIT,Copyright 2011 John Hurliman require,lodash.sortby,MIT,Copyright JS Foundation and other contributors require,lru-cache,ISC,Copyright (c) 2010-2022 Isaac Z. Schlueter and Contributors -require,methods,MIT,Copyright 2013-2014 TJ Holowaychuk require,module-details-from-path,MIT,Copyright 2016 Thomas Watson Steen require,msgpack-lite,MIT,Copyright 2015 Yusuke Kawasaki require,opentracing,MIT,Copyright 2016 Resonance Labs Inc diff --git a/package.json b/package.json index e563f6be6f9..a1c4cb5346c 100644 --- a/package.json +++ b/package.json @@ -87,7 +87,6 @@ "limiter": "1.1.5", "lodash.sortby": "^4.7.0", "lru-cache": "^7.14.0", - "methods": "^1.1.2", "module-details-from-path": "^1.0.3", "msgpack-lite": "^0.1.26", "opentracing": ">=0.12.1", diff --git a/packages/datadog-instrumentations/src/router.js b/packages/datadog-instrumentations/src/router.js index 9ac38caf6c6..5768390e6cf 100644 --- a/packages/datadog-instrumentations/src/router.js +++ b/packages/datadog-instrumentations/src/router.js @@ -1,6 +1,6 @@ 'use strict' -const METHODS = require('methods').concat('all') +const METHODS = require('http').METHODS.map(v => v.toLowerCase()).concat('all') const pathToRegExp = require('path-to-regexp') const shimmer = require('../../datadog-shimmer') const { addHook, channel } = require('./helpers/instrument') diff --git a/yarn.lock b/yarn.lock index 2d29badeb46..fc0e342074d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3524,7 +3524,7 @@ merge2@^1.3.0, merge2@^1.4.1: resolved "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== -methods@^1.1.2, methods@~1.1.2: +methods@~1.1.2: version "1.1.2" resolved "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz" integrity sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w== From 133584130cf75a92ec9fefc0a24d0a46f0af9330 Mon Sep 17 00:00:00 2001 From: simon-id Date: Wed, 22 May 2024 16:32:23 +0200 Subject: [PATCH 5/8] Update packages/dd-trace/test/appsec/remote_config/manager.spec.js --- packages/dd-trace/test/appsec/remote_config/manager.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/dd-trace/test/appsec/remote_config/manager.spec.js b/packages/dd-trace/test/appsec/remote_config/manager.spec.js index b0bc710b028..354dc9d99e8 100644 --- a/packages/dd-trace/test/appsec/remote_config/manager.spec.js +++ b/packages/dd-trace/test/appsec/remote_config/manager.spec.js @@ -35,7 +35,7 @@ describe('RemoteConfigManager', () => { extraServices = [] RemoteConfigManager = proxyquire('../src/appsec/remote_config/manager', { - 'crypto': { randomUUID }, + crypto: { randomUUID }, './scheduler': Scheduler, '../../../../../package.json': { version: '3.0.0' }, '../../exporters/common/request': request, From 9983fd8b0f6477000eb6fdc9229471b7a5a90b87 Mon Sep 17 00:00:00 2001 From: simon-id Date: Thu, 23 May 2024 16:30:10 +0200 Subject: [PATCH 6/8] add crypto-randomuuid back for Cypress :/ --- LICENSE-3rdparty.csv | 1 + package.json | 1 + packages/dd-trace/src/config.js | 2 +- yarn.lock | 5 +++++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/LICENSE-3rdparty.csv b/LICENSE-3rdparty.csv index b2a16c1c8f2..eca2504caaa 100644 --- a/LICENSE-3rdparty.csv +++ b/LICENSE-3rdparty.csv @@ -7,6 +7,7 @@ require,@datadog/pprof,Apache license 2.0,Copyright 2019 Google Inc. require,@datadog/sketches-js,Apache license 2.0,Copyright 2020 Datadog Inc. require,@opentelemetry/api,Apache license 2.0,Copyright OpenTelemetry Authors require,@opentelemetry/core,Apache license 2.0,Copyright OpenTelemetry Authors +require,crypto-randomuuid,MIT,Copyright 2021 Node.js Foundation and contributors require,dc-polyfill,MIT,Copyright 2023 Datadog Inc. require,ignore,MIT,Copyright 2013 Kael Zhang and contributors require,import-in-the-middle,Apache license 2.0,Copyright 2021 Datadog Inc. diff --git a/package.json b/package.json index 6fe1c97bc91..5e23a8100c6 100644 --- a/package.json +++ b/package.json @@ -78,6 +78,7 @@ "@datadog/sketches-js": "^2.1.0", "@opentelemetry/api": ">=1.0.0 <1.9.0", "@opentelemetry/core": "^1.14.0", + "crypto-randomuuid": "^1.0.0", "dc-polyfill": "^0.1.4", "ignore": "^5.2.4", "import-in-the-middle": "^1.7.4", diff --git a/packages/dd-trace/src/config.js b/packages/dd-trace/src/config.js index 7a7a7708810..ecc4c8b0355 100644 --- a/packages/dd-trace/src/config.js +++ b/packages/dd-trace/src/config.js @@ -2,7 +2,7 @@ const fs = require('fs') const os = require('os') -const { randomUUID: uuid } = require('crypto') +const uuid = require('crypto-randomuuid') // we need to keep the old uuid dep because of cypress const URL = require('url').URL const log = require('./log') const pkg = require('./pkg') diff --git a/yarn.lock b/yarn.lock index f24535a2e0d..a517aaa4497 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1641,6 +1641,11 @@ cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3: shebang-command "^2.0.0" which "^2.0.1" +crypto-randomuuid@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/crypto-randomuuid/-/crypto-randomuuid-1.0.0.tgz" + integrity sha512-/RC5F4l1SCqD/jazwUF6+t34Cd8zTSAGZ7rvvZu1whZUhD2a5MOGKjSGowoGcpj/cbVZk1ZODIooJEQQq3nNAA== + csstype@^3.0.2: version "3.1.3" resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.3.tgz#d80ff294d114fb0e6ac500fbf85b60137d7eff81" From 0ffa2695ac8907e6dc3e311def7061bcf3d6cd94 Mon Sep 17 00:00:00 2001 From: simon-id Date: Thu, 23 May 2024 16:37:14 +0200 Subject: [PATCH 7/8] add crypto-randomuuid back for Cypress :/ --- packages/dd-trace/src/appsec/remote_config/manager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/dd-trace/src/appsec/remote_config/manager.js b/packages/dd-trace/src/appsec/remote_config/manager.js index 53e011563e8..9cc636cd302 100644 --- a/packages/dd-trace/src/appsec/remote_config/manager.js +++ b/packages/dd-trace/src/appsec/remote_config/manager.js @@ -1,7 +1,7 @@ 'use strict' const { URL, format } = require('url') -const { randomUUID: uuid } = require('crypto') +const uuid = require('crypto-randomuuid') const { EventEmitter } = require('events') const tracerVersion = require('../../../../../package.json').version const request = require('../../exporters/common/request') From ec32eaedb0932ef9213df2855cabf849397e4564 Mon Sep 17 00:00:00 2001 From: simon-id Date: Thu, 23 May 2024 17:05:37 +0200 Subject: [PATCH 8/8] test --- packages/dd-trace/test/appsec/remote_config/manager.spec.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/dd-trace/test/appsec/remote_config/manager.spec.js b/packages/dd-trace/test/appsec/remote_config/manager.spec.js index 354dc9d99e8..4c4d2ad1ccd 100644 --- a/packages/dd-trace/test/appsec/remote_config/manager.spec.js +++ b/packages/dd-trace/test/appsec/remote_config/manager.spec.js @@ -6,7 +6,7 @@ const { UNACKNOWLEDGED, ACKNOWLEDGED, ERROR } = require('../../../src/appsec/rem const noop = () => {} describe('RemoteConfigManager', () => { - let randomUUID + let uuid let scheduler let Scheduler let request @@ -17,7 +17,7 @@ describe('RemoteConfigManager', () => { let rc beforeEach(() => { - randomUUID = sinon.stub().returns('1234-5678') + uuid = sinon.stub().returns('1234-5678') scheduler = { start: sinon.spy(), @@ -35,7 +35,7 @@ describe('RemoteConfigManager', () => { extraServices = [] RemoteConfigManager = proxyquire('../src/appsec/remote_config/manager', { - crypto: { randomUUID }, + 'crypto-randomuuid': uuid, './scheduler': Scheduler, '../../../../../package.json': { version: '3.0.0' }, '../../exporters/common/request': request,