From ceca7662f9332d2ba68b686b6cfd1bb5c8d04766 Mon Sep 17 00:00:00 2001 From: Nathan Turinski Date: Thu, 26 Oct 2023 14:46:09 -0700 Subject: [PATCH] Add node-fetch and use it for tenant list step --- auth/package-lock.json | 45 +++++++++++++++++++-- auth/package.json | 5 ++- auth/src/VSCodeAzureSubscriptionProvider.ts | 1 + 3 files changed, 46 insertions(+), 5 deletions(-) diff --git a/auth/package-lock.json b/auth/package-lock.json index 54659fda71..2807e78bfa 100644 --- a/auth/package-lock.json +++ b/auth/package-lock.json @@ -1,16 +1,17 @@ { "name": "@microsoft/vscode-azext-azureauth", - "version": "1.3.1", + "version": "1.3.1-beta", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@microsoft/vscode-azext-azureauth", - "version": "1.3.1", + "version": "1.3.1-beta", "license": "MIT", "dependencies": { "@azure/arm-subscriptions": "^5.1.0", - "@azure/ms-rest-azure-env": "^2.0.0" + "@azure/ms-rest-azure-env": "^2.0.0", + "node-fetch": "2.6.7" }, "devDependencies": { "@azure/core-auth": "^1.4.0", @@ -2806,6 +2807,25 @@ "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", "dev": true }, + "node_modules/node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "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", @@ -3413,6 +3433,11 @@ "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", @@ -3541,6 +3566,20 @@ "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 008f7d3c8a..984d5c383b 100644 --- a/auth/package.json +++ b/auth/package.json @@ -1,7 +1,7 @@ { "name": "@microsoft/vscode-azext-azureauth", "author": "Microsoft Corporation", - "version": "1.3.1", + "version": "1.3.1-beta", "description": "Azure authentication helpers for Visual Studio Code", "tags": [ "azure", @@ -52,6 +52,7 @@ }, "dependencies": { "@azure/arm-subscriptions": "^5.1.0", - "@azure/ms-rest-azure-env": "^2.0.0" + "@azure/ms-rest-azure-env": "^2.0.0", + "node-fetch": "2.6.7" } } diff --git a/auth/src/VSCodeAzureSubscriptionProvider.ts b/auth/src/VSCodeAzureSubscriptionProvider.ts index 037aef19fa..5f0a371d02 100644 --- a/auth/src/VSCodeAzureSubscriptionProvider.ts +++ b/auth/src/VSCodeAzureSubscriptionProvider.ts @@ -5,6 +5,7 @@ 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 'node-fetch'; import * as vscode from 'vscode'; import type { AzureAuthentication } from './AzureAuthentication'; import type { AzureSubscription, SubscriptionId, TenantId } from './AzureSubscription';