From eceee3691300ee778f9d3e8428397897b1a9d337 Mon Sep 17 00:00:00 2001 From: jawelton74 <103591340+jawelton74@users.noreply.github.com> Date: Tue, 21 Jan 2025 07:07:18 -0800 Subject: [PATCH] Use azure identity package for e2e test credentials (#2032) * Update identity package, remove ms-rest-nodeauth package. * Test changes to use identity package. --- package-lock.json | 516 ++++++++------------------------- package.json | 3 +- test/fx.ts | 10 +- test/sql/resourceToken.spec.ts | 2 +- test/testData.ts | 2 +- 5 files changed, 121 insertions(+), 412 deletions(-) diff --git a/package-lock.json b/package-lock.json index 30e5adc90..97106a145 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,8 +12,7 @@ "@azure/arm-cosmosdb": "9.1.0", "@azure/cosmos": "4.2.0-beta.1", "@azure/cosmos-language-service": "0.0.5", - "@azure/identity": "1.5.2", - "@azure/ms-rest-nodeauth": "3.1.1", + "@azure/identity": "4.5.0", "@azure/msal-browser": "2.14.2", "@babel/plugin-proposal-class-properties": "7.12.1", "@babel/plugin-proposal-decorators": "7.12.12", @@ -428,47 +427,68 @@ "license": "0BSD" }, "node_modules/@azure/identity": { - "version": "1.5.2", - "license": "MIT", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/@azure/identity/-/identity-4.5.0.tgz", + "integrity": "sha512-EknvVmtBuSIic47xkOqyNabAme0RYTw52BTMz8eBgU1ysTyMrD1uOoM+JdS0J/4Yfp98IBT3osqq3BfwSaNaGQ==", "dependencies": { - "@azure/core-auth": "^1.3.0", - "@azure/core-client": "^1.0.0", - "@azure/core-rest-pipeline": "^1.1.0", - "@azure/core-tracing": "1.0.0-preview.12", + "@azure/abort-controller": "^2.0.0", + "@azure/core-auth": "^1.9.0", + "@azure/core-client": "^1.9.2", + "@azure/core-rest-pipeline": "^1.17.0", + "@azure/core-tracing": "^1.0.0", + "@azure/core-util": "^1.11.0", "@azure/logger": "^1.0.0", - "@azure/msal-node": "1.0.0-beta.6", - "@types/stoppable": "^1.1.0", - "axios": "^0.21.1", + "@azure/msal-browser": "^3.26.1", + "@azure/msal-node": "^2.15.0", "events": "^3.0.0", "jws": "^4.0.0", - "msal": "^1.0.2", - "open": "^7.0.0", - "qs": "^6.7.0", + "open": "^8.0.0", "stoppable": "^1.1.0", - "tslib": "^2.0.0", - "uuid": "^8.3.0" - }, - "engines": { - "node": ">=12.0.0" - }, - "optionalDependencies": { - "keytar": "^7.3.0" - } - }, - "node_modules/@azure/identity/node_modules/@azure/core-tracing": { - "version": "1.0.0-preview.12", - "license": "MIT", - "dependencies": { - "@opentelemetry/api": "^1.0.0", "tslib": "^2.2.0" }, "engines": { - "node": ">=12.0.0" + "node": ">=18.0.0" + } + }, + "node_modules/@azure/identity/node_modules/@azure/msal-browser": { + "version": "3.28.1", + "resolved": "https://registry.npmjs.org/@azure/msal-browser/-/msal-browser-3.28.1.tgz", + "integrity": "sha512-OHHEWMB5+Zrix8yKvLVzU3rKDFvh7SOzAzXfICD7YgUXLxfHpTPX2pzOotrri1kskwhHqIj4a5LvhZlIqE7C7g==", + "dependencies": { + "@azure/msal-common": "14.16.0" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@azure/identity/node_modules/@azure/msal-common": { + "version": "14.16.0", + "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-14.16.0.tgz", + "integrity": "sha512-1KOZj9IpcDSwpNiQNjt0jDYZpQvNZay7QAEi/5DLubay40iGYtLzya/jbjRPLyOTZhEKyL1MzPuw2HqBCjceYA==", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@azure/identity/node_modules/open": { + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/open/-/open-8.4.2.tgz", + "integrity": "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==", + "dependencies": { + "define-lazy-prop": "^2.0.0", + "is-docker": "^2.1.1", + "is-wsl": "^2.2.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/@azure/identity/node_modules/tslib": { - "version": "2.6.2", - "license": "0BSD" + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==" }, "node_modules/@azure/logger": { "version": "1.0.4", @@ -484,10 +504,6 @@ "version": "2.6.2", "license": "0BSD" }, - "node_modules/@azure/ms-rest-azure-env": { - "version": "2.0.0", - "license": "MIT" - }, "node_modules/@azure/ms-rest-azure-js": { "version": "2.1.0", "license": "MIT", @@ -559,15 +575,6 @@ "node": ">=4.0" } }, - "node_modules/@azure/ms-rest-nodeauth": { - "version": "3.1.1", - "license": "MIT", - "dependencies": { - "@azure/ms-rest-azure-env": "^2.0.0", - "@azure/ms-rest-js": "^2.0.4", - "adal-node": "^0.2.2" - } - }, "node_modules/@azure/msal-browser": { "version": "2.14.2", "license": "MIT", @@ -589,13 +596,24 @@ } }, "node_modules/@azure/msal-node": { - "version": "1.0.0-beta.6", - "license": "MIT", + "version": "2.16.2", + "resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-2.16.2.tgz", + "integrity": "sha512-An7l1hEr0w1HMMh1LU+rtDtqL7/jw74ORlc9Wnh06v7TU/xpG39/Zdr1ZJu3QpjUfKJ+E0/OXMW8DRSWTlh7qQ==", "dependencies": { - "@azure/msal-common": "^4.0.0", - "axios": "^0.21.1", - "jsonwebtoken": "^8.5.1", + "@azure/msal-common": "14.16.0", + "jsonwebtoken": "^9.0.0", "uuid": "^8.3.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@azure/msal-node/node_modules/@azure/msal-common": { + "version": "14.16.0", + "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-14.16.0.tgz", + "integrity": "sha512-1KOZj9IpcDSwpNiQNjt0jDYZpQvNZay7QAEi/5DLubay40iGYtLzya/jbjRPLyOTZhEKyL1MzPuw2HqBCjceYA==", + "engines": { + "node": ">=0.8.0" } }, "node_modules/@babel/code-frame": { @@ -10073,13 +10091,6 @@ "@octokit/openapi-types": "^19.0.2" } }, - "node_modules/@opentelemetry/api": { - "version": "1.8.0", - "license": "Apache-2.0", - "engines": { - "node": ">=8.0.0" - } - }, "node_modules/@phosphor/algorithm": { "version": "1.2.0", "license": "BSD-3-Clause" @@ -12725,13 +12736,6 @@ "devOptional": true, "license": "MIT" }, - "node_modules/@types/stoppable": { - "version": "1.1.3", - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/styled-components": { "version": "5.1.1", "dev": true, @@ -13334,61 +13338,6 @@ "node": ">=0.4.0" } }, - "node_modules/adal-node": { - "version": "0.2.4", - "license": "Apache-2.0", - "dependencies": { - "@xmldom/xmldom": "^0.8.3", - "async": "^2.6.3", - "axios": "^0.21.1", - "date-utils": "*", - "jws": "3.x.x", - "underscore": ">= 1.3.1", - "uuid": "^3.1.0", - "xpath.js": "~1.1.0" - }, - "engines": { - "node": ">= 0.6.15" - } - }, - "node_modules/adal-node/node_modules/@xmldom/xmldom": { - "version": "0.8.10", - "license": "MIT", - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/adal-node/node_modules/async": { - "version": "2.6.4", - "license": "MIT", - "dependencies": { - "lodash": "^4.17.14" - } - }, - "node_modules/adal-node/node_modules/jwa": { - "version": "1.4.1", - "license": "MIT", - "dependencies": { - "buffer-equal-constant-time": "1.0.1", - "ecdsa-sig-formatter": "1.0.11", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/adal-node/node_modules/jws": { - "version": "3.2.2", - "license": "MIT", - "dependencies": { - "jwa": "^1.4.1", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/adal-node/node_modules/uuid": { - "version": "3.4.0", - "license": "MIT", - "bin": { - "uuid": "bin/uuid" - } - }, "node_modules/address": { "version": "1.1.2", "dev": true, @@ -14021,13 +13970,6 @@ "version": "1.12.0", "license": "MIT" }, - "node_modules/axios": { - "version": "0.21.4", - "license": "MIT", - "dependencies": { - "follow-redirects": "^1.14.0" - } - }, "node_modules/babel-core": { "version": "7.0.0-bridge.0", "dev": true, @@ -14731,7 +14673,7 @@ }, "node_modules/base64-js": { "version": "1.5.1", - "devOptional": true, + "dev": true, "funding": [ { "type": "github", @@ -14803,8 +14745,9 @@ }, "node_modules/bl": { "version": "4.1.0", - "devOptional": true, + "dev": true, "license": "MIT", + "peer": true, "dependencies": { "buffer": "^5.5.0", "inherits": "^2.0.4", @@ -14813,7 +14756,7 @@ }, "node_modules/bl/node_modules/buffer": { "version": "5.7.1", - "devOptional": true, + "dev": true, "funding": [ { "type": "github", @@ -14829,6 +14772,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" @@ -14836,8 +14780,9 @@ }, "node_modules/bl/node_modules/readable-stream": { "version": "3.6.2", - "devOptional": true, + "dev": true, "license": "MIT", + "peer": true, "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -15407,11 +15352,6 @@ "node": ">=8.0" } }, - "node_modules/chownr": { - "version": "1.1.4", - "license": "ISC", - "optional": true - }, "node_modules/chrome-trace-event": { "version": "1.0.3", "license": "MIT", @@ -17175,13 +17115,6 @@ "version": "1.29.0", "license": "MIT" }, - "node_modules/date-utils": { - "version": "1.2.21", - "license": "MIT", - "engines": { - "node": ">0.4.0" - } - }, "node_modules/dayjs": { "version": "1.8.19", "license": "MIT" @@ -17276,14 +17209,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/deep-extend": { - "version": "0.6.0", - "license": "MIT", - "optional": true, - "engines": { - "node": ">=4.0.0" - } - }, "node_modules/deep-is": { "version": "0.1.4", "license": "MIT" @@ -17344,7 +17269,6 @@ }, "node_modules/define-lazy-prop": { "version": "2.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -18976,14 +18900,6 @@ "version": "2.0.0", "license": "MIT" }, - "node_modules/expand-template": { - "version": "2.0.3", - "license": "(MIT OR WTFPL)", - "optional": true, - "engines": { - "node": ">=6" - } - }, "node_modules/expect": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", @@ -19671,6 +19587,7 @@ }, "node_modules/follow-redirects": { "version": "1.15.3", + "dev": true, "funding": [ { "type": "individual", @@ -19978,11 +19895,6 @@ "node": ">= 0.6" } }, - "node_modules/fs-constants": { - "version": "1.0.0", - "license": "MIT", - "optional": true - }, "node_modules/fs-extra": { "version": "7.0.0", "dev": true, @@ -20197,11 +20109,6 @@ "assert-plus": "^1.0.0" } }, - "node_modules/github-from-package": { - "version": "0.0.0", - "license": "MIT", - "optional": true - }, "node_modules/glob": { "version": "7.2.3", "license": "ISC", @@ -21333,7 +21240,7 @@ }, "node_modules/ieee754": { "version": "1.2.1", - "devOptional": true, + "dev": true, "funding": [ { "type": "github", @@ -21522,7 +21429,7 @@ }, "node_modules/ini": { "version": "1.3.8", - "devOptional": true, + "dev": true, "license": "ISC" }, "node_modules/internal-slot": { @@ -27558,8 +27465,9 @@ } }, "node_modules/jsonwebtoken": { - "version": "8.5.1", - "license": "MIT", + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz", + "integrity": "sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==", "dependencies": { "jws": "^3.2.2", "lodash.includes": "^4.3.0", @@ -27570,16 +27478,17 @@ "lodash.isstring": "^4.0.1", "lodash.once": "^4.0.0", "ms": "^2.1.1", - "semver": "^5.6.0" + "semver": "^7.5.4" }, "engines": { - "node": ">=4", - "npm": ">=1.4.28" + "node": ">=12", + "npm": ">=6" } }, "node_modules/jsonwebtoken/node_modules/jwa": { "version": "1.4.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", + "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", "dependencies": { "buffer-equal-constant-time": "1.0.1", "ecdsa-sig-formatter": "1.0.11", @@ -27588,12 +27497,24 @@ }, "node_modules/jsonwebtoken/node_modules/jws": { "version": "3.2.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", + "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", "dependencies": { "jwa": "^1.4.1", "safe-buffer": "^5.0.1" } }, + "node_modules/jsonwebtoken/node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/jsprim": { "version": "1.4.2", "license": "MIT", @@ -27646,16 +27567,6 @@ "version": "2.6.0", "license": "MIT" }, - "node_modules/keytar": { - "version": "7.9.0", - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "dependencies": { - "node-addon-api": "^4.3.0", - "prebuild-install": "^7.0.1" - } - }, "node_modules/keyv": { "version": "4.5.4", "license": "MIT", @@ -27972,7 +27883,8 @@ }, "node_modules/lodash.includes": { "version": "4.3.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==" }, "node_modules/lodash.invokemap": { "version": "4.6.0", @@ -27981,7 +27893,8 @@ }, "node_modules/lodash.isboolean": { "version": "3.0.3", - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==" }, "node_modules/lodash.isequal": { "version": "4.5.0", @@ -27989,19 +27902,23 @@ }, "node_modules/lodash.isinteger": { "version": "4.0.4", - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==" }, "node_modules/lodash.isnumber": { "version": "3.0.3", - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==" }, "node_modules/lodash.isplainobject": { "version": "4.0.6", - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==" }, "node_modules/lodash.isstring": { "version": "4.0.1", - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==" }, "node_modules/lodash.memoize": { "version": "4.1.2", @@ -28013,7 +27930,8 @@ }, "node_modules/lodash.once": { "version": "4.1.1", - "license": "MIT" + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==" }, "node_modules/lodash.pullall": { "version": "4.2.0", @@ -29526,11 +29444,6 @@ "node": ">=10" } }, - "node_modules/mkdirp-classic": { - "version": "0.5.3", - "license": "MIT", - "optional": true - }, "node_modules/moment": { "version": "2.29.4", "license": "MIT", @@ -29597,16 +29510,6 @@ "version": "2.1.3", "license": "MIT" }, - "node_modules/msal": { - "version": "1.4.18", - "license": "MIT", - "dependencies": { - "tslib": "^1.9.3" - }, - "engines": { - "node": ">=0.8.0" - } - }, "node_modules/multicast-dns": { "version": "7.2.5", "dev": true, @@ -29667,11 +29570,6 @@ "node": ">=0.10.0" } }, - "node_modules/napi-build-utils": { - "version": "1.0.2", - "license": "MIT", - "optional": true - }, "node_modules/native-promise-only": { "version": "0.8.1", "dev": true, @@ -29756,58 +29654,12 @@ "node": ">=12.0.0" } }, - "node_modules/node-abi": { - "version": "3.60.0", - "license": "MIT", - "optional": true, - "dependencies": { - "semver": "^7.3.5" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/node-abi/node_modules/lru-cache": { - "version": "6.0.0", - "license": "ISC", - "optional": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/node-abi/node_modules/semver": { - "version": "7.6.0", - "license": "ISC", - "optional": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/node-abi/node_modules/yallist": { - "version": "4.0.0", - "license": "ISC", - "optional": true - }, "node_modules/node-abort-controller": { "version": "3.1.1", "dev": true, "license": "MIT", "peer": true }, - "node_modules/node-addon-api": { - "version": "4.3.0", - "license": "MIT", - "optional": true - }, "node_modules/node-dir": { "version": "0.1.17", "dev": true, @@ -31006,80 +30858,6 @@ "version": "4.2.0", "license": "MIT" }, - "node_modules/prebuild-install": { - "version": "7.1.2", - "license": "MIT", - "optional": true, - "dependencies": { - "detect-libc": "^2.0.0", - "expand-template": "^2.0.3", - "github-from-package": "0.0.0", - "minimist": "^1.2.3", - "mkdirp-classic": "^0.5.3", - "napi-build-utils": "^1.0.1", - "node-abi": "^3.3.0", - "pump": "^3.0.0", - "rc": "^1.2.7", - "simple-get": "^4.0.0", - "tar-fs": "^2.0.0", - "tunnel-agent": "^0.6.0" - }, - "bin": { - "prebuild-install": "bin.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/prebuild-install/node_modules/decompress-response": { - "version": "6.0.0", - "license": "MIT", - "optional": true, - "dependencies": { - "mimic-response": "^3.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/prebuild-install/node_modules/mimic-response": { - "version": "3.1.0", - "license": "MIT", - "optional": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/prebuild-install/node_modules/simple-get": { - "version": "4.0.1", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT", - "optional": true, - "dependencies": { - "decompress-response": "^6.0.0", - "once": "^1.3.1", - "simple-concat": "^1.0.0" - } - }, "node_modules/prelude-ls": { "version": "1.2.1", "license": "MIT", @@ -31509,28 +31287,6 @@ "version": "0.5.1", "dev": true }, - "node_modules/rc": { - "version": "1.2.8", - "license": "(BSD-2-Clause OR MIT OR Apache-2.0)", - "optional": true, - "dependencies": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "bin": { - "rc": "cli.js" - } - }, - "node_modules/rc/node_modules/strip-json-comments": { - "version": "2.0.1", - "license": "MIT", - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/re-resizable": { "version": "6.9.11", "license": "MIT", @@ -34439,45 +34195,6 @@ "node": ">=10" } }, - "node_modules/tar-fs": { - "version": "2.1.1", - "license": "MIT", - "optional": true, - "dependencies": { - "chownr": "^1.1.1", - "mkdirp-classic": "^0.5.2", - "pump": "^3.0.0", - "tar-stream": "^2.1.4" - } - }, - "node_modules/tar-stream": { - "version": "2.2.0", - "license": "MIT", - "optional": true, - "dependencies": { - "bl": "^4.0.3", - "end-of-stream": "^1.4.1", - "fs-constants": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^3.1.1" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/tar-stream/node_modules/readable-stream": { - "version": "3.6.2", - "license": "MIT", - "optional": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/tar/node_modules/chownr": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", @@ -36815,13 +36532,6 @@ "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", "dev": true }, - "node_modules/xpath.js": { - "version": "1.1.0", - "license": "MIT", - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/xtend": { "version": "4.0.2", "license": "MIT", diff --git a/package.json b/package.json index 16e80c5e5..2b984ca47 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,7 @@ "@azure/arm-cosmosdb": "9.1.0", "@azure/cosmos": "4.2.0-beta.1", "@azure/cosmos-language-service": "0.0.5", - "@azure/identity": "1.5.2", - "@azure/ms-rest-nodeauth": "3.1.1", + "@azure/identity": "4.5.0", "@azure/msal-browser": "2.14.2", "@babel/plugin-proposal-class-properties": "7.12.1", "@babel/plugin-proposal-decorators": "7.12.12", diff --git a/test/fx.ts b/test/fx.ts index b44028dc8..661d55897 100644 --- a/test/fx.ts +++ b/test/fx.ts @@ -1,4 +1,4 @@ -import { AzureCliCredentials } from "@azure/ms-rest-nodeauth"; +import { AzureCliCredential } from "@azure/identity"; import { expect, Frame, Locator, Page } from "@playwright/test"; import crypto from "crypto"; @@ -20,13 +20,13 @@ export function generateUniqueName(baseName, options?: TestNameOptions): string return `${prefix}${baseName}${crypto.randomBytes(length).toString("hex")}${suffix}`; } -export async function getAzureCLICredentials(): Promise { - return await AzureCliCredentials.create(); +export function getAzureCLICredentials(): AzureCliCredential { + return new AzureCliCredential(); } export async function getAzureCLICredentialsToken(): Promise { - const credentials = await getAzureCLICredentials(); - const token = (await credentials.getToken()).accessToken; + const credentials = getAzureCLICredentials(); + const token = (await credentials.getToken("https://management.core.windows.net//.default")).token; return token; } diff --git a/test/sql/resourceToken.spec.ts b/test/sql/resourceToken.spec.ts index f274ce85c..1fc75a58b 100644 --- a/test/sql/resourceToken.spec.ts +++ b/test/sql/resourceToken.spec.ts @@ -13,7 +13,7 @@ import { } from "../fx"; test("SQL account using Resource token", async ({ page }) => { - const credentials = await getAzureCLICredentials(); + const credentials = getAzureCLICredentials(); const armClient = new CosmosDBManagementClient(credentials, subscriptionId); const accountName = getAccountName(TestAccount.SQL); const account = await armClient.databaseAccounts.get(resourceGroupName, accountName); diff --git a/test/testData.ts b/test/testData.ts index cf8ca6f20..543796894 100644 --- a/test/testData.ts +++ b/test/testData.ts @@ -56,7 +56,7 @@ export class TestContainerContext { export async function createTestSQLContainer(includeTestData?: boolean) { const databaseId = generateUniqueName("db"); const containerId = "testcontainer"; // A unique container name isn't needed because the database is unique - const credentials = await getAzureCLICredentials(); + const credentials = getAzureCLICredentials(); const armClient = new CosmosDBManagementClient(credentials, subscriptionId); const accountName = getAccountName(TestAccount.SQL); const account = await armClient.databaseAccounts.get(resourceGroupName, accountName);