Skip to content

Commit 3ec901e

Browse files
mhassan1shivanee-ppearigee
authored
fix(deps): remove vulnerable dependency uuid (#8120)
* fix(deps): remove vulnerable dependency `uuid` * rollback bigquery package.json There is a genuine breakage in these test files that needs to be address. * rollback bigtable common.ts There is a real breakage in the bigtable tests from this change. --------- Co-authored-by: Shivanee <46910562+shivanee-p@users.noreply.github.com> Co-authored-by: Gabe Pearhill <86282859+pearigee@users.noreply.github.com>
1 parent 5293fbc commit 3ec901e

75 files changed

Lines changed: 141 additions & 191 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

core/packages/teeny-request/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
"@types/mocha": "^10.0.10",
5353
"@types/node-fetch": "^2.6.12",
5454
"@types/sinon": "^17.0.3",
55-
"@types/uuid": "^10.0.0",
5655
"c8": "^10.1.3",
5756
"codecov": "^3.8.3",
5857
"gts": "^6.0.2",

core/paginator/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
"@types/node": "^22.13.8",
3838
"@types/proxyquire": "^1.3.31",
3939
"@types/sinon": "^17.0.4",
40-
"@types/uuid": "^10.0.0",
4140
"c8": "^10.1.3",
4241
"codecov": "^3.8.3",
4342
"gts": "^6.0.2",
@@ -49,8 +48,7 @@
4948
"path-to-regexp": "^8.2.0",
5049
"proxyquire": "^2.1.3",
5150
"sinon": "^19.0.2",
52-
"typescript": "^5.8.2",
53-
"uuid": "^11.1.0"
51+
"typescript": "^5.8.2"
5452
},
5553
"dependencies": {
5654
"extend": "^3.0.2"

core/paginator/test/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {describe, it, beforeEach, afterEach} from 'mocha';
1717
import * as proxyquire from 'proxyquire';
1818
import * as sinon from 'sinon';
1919
import {PassThrough, Transform} from 'stream';
20-
import * as uuid from 'uuid';
20+
import * as crypto from 'crypto';
2121
import * as P from '../src';
2222
import {paginator, ParsedArguments} from '../src';
2323

@@ -53,7 +53,7 @@ function createFakeStream<T = any>() {
5353
}
5454

5555
describe('paginator', () => {
56-
const UUID = uuid.v1();
56+
const UUID = crypto.randomUUID();
5757
function FakeClass() {
5858
// do nothing
5959
}
@@ -124,7 +124,7 @@ describe('paginator', () => {
124124

125125
/* eslint-disable @typescript-eslint/no-explicit-any */
126126
const cls = new (FakeClass as any)();
127-
cls.uuid = uuid.v1();
127+
cls.uuid = crypto.randomUUID();
128128

129129
sandbox.stub(paginator, 'run_').callsFake((_, originalMethod) => {
130130
assert.strictEqual(originalMethod(), cls.uuid);

handwritten/bigquery-storage/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
"@types/mocha": "^10.0.10",
5151
"@types/node": "^22.13.14",
5252
"@types/sinon": "^21.0.0",
53-
"@types/uuid": "^10.0.0",
5453
"avsc": "^5.7.9",
5554
"c8": "^10.1.3",
5655
"gapic-tools": "^1.0.1",
@@ -67,7 +66,6 @@
6766
"sinon": "21.0.3",
6867
"ts-loader": "^9.5.2",
6968
"typescript": "^5.8.2",
70-
"uuid": "^11.1.0",
7169
"webpack": "^5.98.0",
7270
"webpack-cli": "^6.0.1"
7371
},

handwritten/bigquery-storage/system-test/managed_writer_client_test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import * as assert from 'assert';
1616
import {readFileSync} from 'fs';
1717
import * as path from 'path';
1818
import {describe, it} from 'mocha';
19-
import * as uuid from 'uuid';
19+
import * as crypto from 'crypto';
2020
import * as gax from 'google-gax';
2121
import * as sinon from 'sinon';
2222
import {BigQuery, TableSchema} from '@google-cloud/bigquery';
@@ -59,7 +59,7 @@ const FieldDescriptorProtoType =
5959
const GCLOUD_TESTS_PREFIX = 'nodejs_bqstorage_system_test';
6060
const bigquery = new BigQuery();
6161
const generateUuid = () =>
62-
`${GCLOUD_TESTS_PREFIX}_${uuid.v4()}`.replace(/-/gi, '_');
62+
`${GCLOUD_TESTS_PREFIX}_${crypto.randomUUID()}`.replace(/-/gi, '_');
6363
const datasetId = generateUuid();
6464

6565
const sleep = (ms: number) =>

handwritten/bigquery-storage/system-test/reader_client_test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import * as assert from 'assert';
1616
import {describe, it} from 'mocha';
1717
import * as gax from 'google-gax';
18-
import * as uuid from 'uuid';
18+
import * as crypto from 'crypto';
1919
import * as sinon from 'sinon';
2020
import {BigQuery, TableRow, TableSchema} from '@google-cloud/bigquery';
2121
import * as protos from '../protos/protos';
@@ -46,7 +46,7 @@ if (process.env.NODE_ENV === 'DEBUG') {
4646
const GCLOUD_TESTS_PREFIX = 'nodejs_bqstorage_system_test';
4747
const bigquery = new BigQuery();
4848
const generateUuid = () =>
49-
`${GCLOUD_TESTS_PREFIX}_${uuid.v4()}`.replace(/-/gi, '_');
49+
`${GCLOUD_TESTS_PREFIX}_${crypto.randomUUID()}`.replace(/-/gi, '_');
5050
const datasetId = generateUuid();
5151

5252
const sleep = (ms: number) =>

handwritten/error-reporting/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
"@types/once": "^1.4.5",
5252
"@types/proxyquire": "^1.3.31",
5353
"@types/restify": "^8.0.0",
54-
"@types/uuid": "^8.3.0",
5554
"boom": "^7.2.0",
5655
"c8": "^10.1.3",
5756
"codecov": "^3.6.2",
@@ -67,8 +66,7 @@
6766
"pack-n-play": "^2.0.0",
6867
"proxyquire": "^2.1.3",
6968
"restify": "^11.0.0",
70-
"typescript": "^5.9.3",
71-
"uuid": "^8.3.2"
69+
"typescript": "^5.9.3"
7270
},
7371
"overrides": {
7472
"undici": "5.28.4",

handwritten/error-reporting/system-test/error-reporting.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import {
2828
ErrorsApiTransport,
2929
} from '../utils/errors-api-transport';
3030

31-
import * as uuid from 'uuid';
31+
import * as crypto from 'crypto';
3232
import * as util from 'util';
3333
import * as path from 'path';
3434

@@ -446,7 +446,7 @@ describe('Expected Behavior', () => {
446446

447447
describe('error-reporting', () => {
448448
const SRC_ROOT = path.join(__dirname, '..', 'src');
449-
const UUID = uuid.v4();
449+
const UUID = crypto.randomUUID();
450450
const BASE_NAME = 'error-reporting-system-test';
451451
function buildName(suffix: string) {
452452
return [UUID, BASE_NAME, suffix].join('_');

handwritten/google-cloud-dns/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
"@types/proxyquire": "^1.3.31",
6565
"@types/request": "^2.48.12",
6666
"@types/tmp": "^0.2.6",
67-
"@types/uuid": "^11.0.0",
6867
"c8": "^10.1.3",
6968
"codecov": "^3.8.3",
7069
"gts": "^6.0.2",
@@ -76,8 +75,7 @@
7675
"mocha": "^11.1.0",
7776
"proxyquire": "^2.1.3",
7877
"tmp": "^0.2.3",
79-
"typescript": "^5.8.2",
80-
"uuid": "^11.1.0"
78+
"typescript": "^5.8.2"
8179
},
8280
"homepage": "https://github.com/googleapis/google-cloud-node/tree/main/handwritten/google-cloud-dns"
8381
}

handwritten/google-cloud-dns/samples/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
},
2020
"devDependencies": {
2121
"chai": "^4.2.0",
22-
"mocha": "^8.0.0",
23-
"uuid": "^9.0.0"
22+
"mocha": "^8.0.0"
2423
}
2524
}

0 commit comments

Comments
 (0)