From a33c0982dbaa3131bdc1e1a32ce97ff6dc1c4510 Mon Sep 17 00:00:00 2001 From: alexweininger Date: Thu, 26 Oct 2023 15:49:43 -0400 Subject: [PATCH] auth: Use built-in fetch instead of cross-fetch --- auth/package-lock.json | 72 +++++---------------- auth/package.json | 7 +- auth/src/VSCodeAzureSubscriptionProvider.ts | 1 - 3 files changed, 20 insertions(+), 60 deletions(-) diff --git a/auth/package-lock.json b/auth/package-lock.json index 4524928cdb..54659fda71 100644 --- a/auth/package-lock.json +++ b/auth/package-lock.json @@ -1,17 +1,16 @@ { "name": "@microsoft/vscode-azext-azureauth", - "version": "1.3.0", + "version": "1.3.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@microsoft/vscode-azext-azureauth", - "version": "1.3.0", + "version": "1.3.1", "license": "MIT", "dependencies": { "@azure/arm-subscriptions": "^5.1.0", - "@azure/ms-rest-azure-env": "^2.0.0", - "cross-fetch": "^4.0.0" + "@azure/ms-rest-azure-env": "^2.0.0" }, "devDependencies": { "@azure/core-auth": "^1.4.0", @@ -19,7 +18,7 @@ "@types/glob": "^8.1.0", "@types/html-to-text": "^8.1.0", "@types/mocha": "^7.0.2", - "@types/node": "^16.0.0", + "@types/node": "^18.18.7", "@types/semver": "^7.3.9", "@types/uuid": "^9.0.1", "@types/vscode": "1.76.0", @@ -433,10 +432,13 @@ "dev": true }, "node_modules/@types/node": { - "version": "16.18.21", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.21.tgz", - "integrity": "sha512-TassPGd0AEZWA10qcNnXnSNwHlLfSth8XwUaWc3gTSDmBz/rKb613Qw5qRf6o2fdRBrLbsgeC9PMZshobkuUqg==", - "dev": true + "version": "18.18.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.7.tgz", + "integrity": "sha512-bw+lEsxis6eqJYW8Ql6+yTqkE6RuFtsQPSe5JxXbqYRFQEER5aJA9a5UH9igqDWm3X4iLHIKOHlnAXLM4mi7uQ==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } }, "node_modules/@types/semver": { "version": "7.3.13", @@ -1052,14 +1054,6 @@ "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", "dev": true }, - "node_modules/cross-fetch": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", - "integrity": "sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==", - "dependencies": { - "node-fetch": "^2.6.12" - } - }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -2812,25 +2806,6 @@ "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", "dev": true }, - "node_modules/node-fetch": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", - "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -3438,11 +3413,6 @@ "node": ">=8.0" } }, - "node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" - }, "node_modules/tsconfig-paths": { "version": "3.14.2", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.2.tgz", @@ -3542,6 +3512,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -3565,20 +3541,6 @@ "uuid": "dist/bin/uuid" } }, - "node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" - }, - "node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", diff --git a/auth/package.json b/auth/package.json index 9276a5c646..008f7d3c8a 100644 --- a/auth/package.json +++ b/auth/package.json @@ -1,7 +1,7 @@ { "name": "@microsoft/vscode-azext-azureauth", "author": "Microsoft Corporation", - "version": "1.3.0", + "version": "1.3.1", "description": "Azure authentication helpers for Visual Studio Code", "tags": [ "azure", @@ -36,7 +36,7 @@ "@types/glob": "^8.1.0", "@types/html-to-text": "^8.1.0", "@types/mocha": "^7.0.2", - "@types/node": "^16.0.0", + "@types/node": "^18.18.7", "@types/semver": "^7.3.9", "@types/uuid": "^9.0.1", "@types/vscode": "1.76.0", @@ -52,7 +52,6 @@ }, "dependencies": { "@azure/arm-subscriptions": "^5.1.0", - "@azure/ms-rest-azure-env": "^2.0.0", - "cross-fetch": "^4.0.0" + "@azure/ms-rest-azure-env": "^2.0.0" } } diff --git a/auth/src/VSCodeAzureSubscriptionProvider.ts b/auth/src/VSCodeAzureSubscriptionProvider.ts index 7ccb17e86a..037aef19fa 100644 --- a/auth/src/VSCodeAzureSubscriptionProvider.ts +++ b/auth/src/VSCodeAzureSubscriptionProvider.ts @@ -5,7 +5,6 @@ import type { SubscriptionClient, TenantIdDescription } from '@azure/arm-subscriptions'; // Keep this as `import type` to avoid actually loading the package before necessary import type { TokenCredential } from '@azure/core-auth'; // Keep this as `import type` to avoid actually loading the package (at all, this one is dev-only) -import fetch from 'cross-fetch'; import * as vscode from 'vscode'; import type { AzureAuthentication } from './AzureAuthentication'; import type { AzureSubscription, SubscriptionId, TenantId } from './AzureSubscription';