diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 1e3324070..a9572562e 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,7 +1,6 @@ { "recommendations": [ "dbaeumer.vscode-eslint", - "ms-vscode.azure-account", "ms-azuretools.vscode-azureresourcegroups" ] } diff --git a/package-lock.json b/package-lock.json index 37b5d7a29..7a3174708 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,10 +11,10 @@ "dependencies": { "@azure/arm-appservice": "^11.0.0", "@azure/arm-resources": "^5.0.0", - "@microsoft/vscode-azext-azureappsettings": "^0.2.0", - "@microsoft/vscode-azext-azureutils": "^3.1.2", - "@microsoft/vscode-azext-utils": "^2.6.3", - "@microsoft/vscode-azureresources-api": "^2.0.3", + "@microsoft/vscode-azext-azureappsettings": "^0.2.11", + "@microsoft/vscode-azext-azureutils": "^3.5.2", + "@microsoft/vscode-azext-utils": "^3.5.1", + "@microsoft/vscode-azureresources-api": "^2.6.3", "@octokit/rest": "^18.5.2", "buffer": "^6.0.3", "dayjs": "^1.11.0", @@ -34,7 +34,7 @@ "@types/mocha": "^8.2.2", "@types/node": "^16.18.36", "@types/semver": "^7.3.8", - "@types/vscode": "^1.95.0", + "@types/vscode": "1.104.0", "@typescript-eslint/eslint-plugin": "^5.59.11", "@vscode/test-electron": "^2.3.8", "@vscode/vsce": "^2.19.0", @@ -54,7 +54,7 @@ "webpack-cli": "^4.6.0" }, "engines": { - "vscode": "^1.95.0" + "vscode": "^1.104.0" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -608,71 +608,71 @@ } }, "node_modules/@microsoft/1ds-core-js": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@microsoft/1ds-core-js/-/1ds-core-js-4.3.0.tgz", - "integrity": "sha512-0aP0ko4j0E2HfMNG1TdctGxcX74c4nQMMMV2JyaBYRRlbg1qYSVCUTZO4Ap6Qf65cBjJUCoIzgDMXNSquANwDA==", + "version": "4.3.10", + "resolved": "https://registry.npmjs.org/@microsoft/1ds-core-js/-/1ds-core-js-4.3.10.tgz", + "integrity": "sha512-5fSZmkGwWkH+mrIA5M1GYPZdPM+SjXwCCl2Am7VhFoVwOBJNhRnwvIpAdzw6sFjiebN/rz+/YH0NdxztGZSa9Q==", "dependencies": { - "@microsoft/applicationinsights-core-js": "3.3.0", + "@microsoft/applicationinsights-core-js": "3.3.10", "@microsoft/applicationinsights-shims": "3.0.1", "@microsoft/dynamicproto-js": "^2.0.3", - "@nevware21/ts-async": ">= 0.5.2 < 2.x", - "@nevware21/ts-utils": ">= 0.11.3 < 2.x" + "@nevware21/ts-async": ">= 0.5.4 < 2.x", + "@nevware21/ts-utils": ">= 0.11.8 < 2.x" } }, "node_modules/@microsoft/1ds-post-js": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@microsoft/1ds-post-js/-/1ds-post-js-4.3.0.tgz", - "integrity": "sha512-a1AflEuB313mfRiNNqkoVYDi4zxnG57zR8KotudtVoov6hiByBIS0KSuf3oE5/woDHWi9ZJjiCDvFwNqNH0YYw==", + "version": "4.3.10", + "resolved": "https://registry.npmjs.org/@microsoft/1ds-post-js/-/1ds-post-js-4.3.10.tgz", + "integrity": "sha512-VSLjc9cT+Y+eTiSfYltJHJCejn8oYr0E6Pq2BMhOEO7F6IyLGYIxzKKvo78ze9x+iHX7KPTATcZ+PFgjGXuNqg==", "dependencies": { - "@microsoft/1ds-core-js": "4.3.0", + "@microsoft/1ds-core-js": "4.3.10", "@microsoft/applicationinsights-shims": "3.0.1", "@microsoft/dynamicproto-js": "^2.0.3", - "@nevware21/ts-async": ">= 0.5.2 < 2.x", - "@nevware21/ts-utils": ">= 0.11.3 < 2.x" + "@nevware21/ts-async": ">= 0.5.4 < 2.x", + "@nevware21/ts-utils": ">= 0.11.8 < 2.x" } }, "node_modules/@microsoft/applicationinsights-channel-js": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-channel-js/-/applicationinsights-channel-js-3.3.0.tgz", - "integrity": "sha512-xlxcfwgFgvHoY/STVgtRoUSvAKOMNbe4CIBeY8zTHsjE9x3/kY9R9kpRkTBectuD7xVm1/FmzrzqaxcJO7R/sw==", + "version": "3.3.10", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-channel-js/-/applicationinsights-channel-js-3.3.10.tgz", + "integrity": "sha512-iolFLz1ocWAzIQqHIEjjov3gNTPkgFQ4ArHnBcJEYoffOGWlJt6copaevS5YPI5rHzmbySsengZ8cLJJBBrXzQ==", "dependencies": { - "@microsoft/applicationinsights-common": "3.3.0", - "@microsoft/applicationinsights-core-js": "3.3.0", + "@microsoft/applicationinsights-common": "3.3.10", + "@microsoft/applicationinsights-core-js": "3.3.10", "@microsoft/applicationinsights-shims": "3.0.1", "@microsoft/dynamicproto-js": "^2.0.3", - "@nevware21/ts-async": ">= 0.5.2 < 2.x", - "@nevware21/ts-utils": ">= 0.11.3 < 2.x" + "@nevware21/ts-async": ">= 0.5.4 < 2.x", + "@nevware21/ts-utils": ">= 0.11.8 < 2.x" }, "peerDependencies": { - "tslib": "*" + "tslib": ">= 1.0.0" } }, "node_modules/@microsoft/applicationinsights-common": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-common/-/applicationinsights-common-3.3.0.tgz", - "integrity": "sha512-5t6WtL9wCQUA06sioaTenz5qWgrCk7QRm99pDuP+vyjcAiT6//f+Qn1K9KXtEX5WfEMHx3vBIDGLl6ppnF1YAQ==", + "version": "3.3.10", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-common/-/applicationinsights-common-3.3.10.tgz", + "integrity": "sha512-RVIenPIvNgZCbjJdALvLM4rNHgAFuHI7faFzHCgnI6S2WCUNGHeXlQTs9EUUrL+n2TPp9/cd0KKMILU5VVyYiA==", "dependencies": { - "@microsoft/applicationinsights-core-js": "3.3.0", + "@microsoft/applicationinsights-core-js": "3.3.10", "@microsoft/applicationinsights-shims": "3.0.1", "@microsoft/dynamicproto-js": "^2.0.3", - "@nevware21/ts-utils": ">= 0.11.3 < 2.x" + "@nevware21/ts-utils": ">= 0.11.8 < 2.x" }, "peerDependencies": { - "tslib": "*" + "tslib": ">= 1.0.0" } }, "node_modules/@microsoft/applicationinsights-core-js": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-3.3.0.tgz", - "integrity": "sha512-so0fFTqgZMjClH+MsiRYGspo5fpgwHEUYNMjyzpf9rjrY7FaUH8kkWzrQ3V0Cs4axZwf+WuIndtDOAws7aBmGQ==", + "version": "3.3.10", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-3.3.10.tgz", + "integrity": "sha512-5yKeyassZTq2l+SAO4npu6LPnbS++UD+M+Ghjm9uRzoBwD8tumFx0/F8AkSVqbniSREd+ztH/2q2foewa2RZyg==", "dependencies": { "@microsoft/applicationinsights-shims": "3.0.1", "@microsoft/dynamicproto-js": "^2.0.3", - "@nevware21/ts-async": ">= 0.5.2 < 2.x", - "@nevware21/ts-utils": ">= 0.11.3 < 2.x" + "@nevware21/ts-async": ">= 0.5.4 < 2.x", + "@nevware21/ts-utils": ">= 0.11.8 < 2.x" }, "peerDependencies": { - "tslib": "*" + "tslib": ">= 1.0.0" } }, "node_modules/@microsoft/applicationinsights-shims": { @@ -684,20 +684,20 @@ } }, "node_modules/@microsoft/applicationinsights-web-basic": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-web-basic/-/applicationinsights-web-basic-3.3.0.tgz", - "integrity": "sha512-8+QcrgensCK44XuHMkW+zQXYchM6/f5gg0go/REVj5DpbE03L3jXNajSlBIALH8MzhGgcyPDlGmIt2OYztUMNQ==", + "version": "3.3.10", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-web-basic/-/applicationinsights-web-basic-3.3.10.tgz", + "integrity": "sha512-AZib5DAT3NU0VT0nLWEwXrnoMDDgZ/5S4dso01CNU5ELNxLdg+1fvchstlVdMy4FrAnxzs8Wf/GIQNFYOVgpAw==", "dependencies": { - "@microsoft/applicationinsights-channel-js": "3.3.0", - "@microsoft/applicationinsights-common": "3.3.0", - "@microsoft/applicationinsights-core-js": "3.3.0", + "@microsoft/applicationinsights-channel-js": "3.3.10", + "@microsoft/applicationinsights-common": "3.3.10", + "@microsoft/applicationinsights-core-js": "3.3.10", "@microsoft/applicationinsights-shims": "3.0.1", "@microsoft/dynamicproto-js": "^2.0.3", - "@nevware21/ts-async": ">= 0.5.2 < 2.x", - "@nevware21/ts-utils": ">= 0.11.3 < 2.x" + "@nevware21/ts-async": ">= 0.5.4 < 2.x", + "@nevware21/ts-utils": ">= 0.11.8 < 2.x" }, "peerDependencies": { - "tslib": "*" + "tslib": ">= 1.0.0" } }, "node_modules/@microsoft/dynamicproto-js": { @@ -723,17 +723,17 @@ } }, "node_modules/@microsoft/vscode-azext-azureappsettings": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@microsoft/vscode-azext-azureappsettings/-/vscode-azext-azureappsettings-0.2.0.tgz", - "integrity": "sha512-fHv+m+dOluuYgPCQ7Mt8HoDgguWy8zHWofP3T6uxkuDF8VAJbjl9LFYHwV0frVcK4Qgxcj95QDjw5AMSUMHtqw==", + "version": "0.2.11", + "resolved": "https://registry.npmjs.org/@microsoft/vscode-azext-azureappsettings/-/vscode-azext-azureappsettings-0.2.11.tgz", + "integrity": "sha512-zu6RedxoVEgOTyTqyeo5HHPowK3aEYyD9if96b3TF3fkiuxuRlR/19V0qmoKxF6w8nYYhuUDScL2i+zlcu9+xQ==", "dependencies": { - "@microsoft/vscode-azext-utils": "^2.0.0" + "@microsoft/vscode-azext-utils": "^3.4.2" } }, "node_modules/@microsoft/vscode-azext-azureutils": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@microsoft/vscode-azext-azureutils/-/vscode-azext-azureutils-3.1.2.tgz", - "integrity": "sha512-d0L063tEwByViMFMUyVW2wXO7E+ejSMN8b1P32qiNZkAV7vUELcgQCSvC1wUEV8ilWnarGPlBsbJX3J93NnM+g==", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/@microsoft/vscode-azext-azureutils/-/vscode-azext-azureutils-3.5.2.tgz", + "integrity": "sha512-0jAkM2jAdrVq+lR5yNNQnL/O7Vp6yQo5l0oAyVcddp6WB2bUQrWUUZo1YeTaWl/23MMadWtFmhM4RRJPGWoYoQ==", "dependencies": { "@azure/arm-authorization": "^9.0.0", "@azure/arm-authorization-profile-2020-09-01-hybrid": "^2.1.0", @@ -746,7 +746,7 @@ "@azure/core-client": "^1.6.0", "@azure/core-rest-pipeline": "^1.9.0", "@azure/logger": "^1.0.4", - "@microsoft/vscode-azext-utils": "^2.5.7", + "@microsoft/vscode-azext-utils": "^3.4.2", "semver": "^7.3.7", "uuid": "^9.0.0" }, @@ -754,14 +754,6 @@ "@azure/ms-rest-azure-env": "^2.0.0" } }, - "node_modules/@microsoft/vscode-azext-azureutils/node_modules/uuid": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", - "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", - "bin": { - "uuid": "dist/bin/uuid" - } - }, "node_modules/@microsoft/vscode-azext-dev": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@microsoft/vscode-azext-dev/-/vscode-azext-dev-2.0.4.tgz", @@ -859,12 +851,11 @@ } }, "node_modules/@microsoft/vscode-azext-utils": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/@microsoft/vscode-azext-utils/-/vscode-azext-utils-2.6.3.tgz", - "integrity": "sha512-eogbgZH1KQkGWstl9qb1Tq4DQH+JJCHLHZelIbnzIKE8JKxr8Et/byn3OuL5nL1qeITQQn3+AYVsbj2hbljM7w==", - "license": "MIT", + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/@microsoft/vscode-azext-utils/-/vscode-azext-utils-3.5.1.tgz", + "integrity": "sha512-+HGxhaPZrNg6eHUxMSVJSwxHV5q+DGnHdKYUneMkHVCG6JJYMf67S2ll6Uhvts1ItSBNOASUNy0MVm7nnIN98w==", "dependencies": { - "@microsoft/vscode-azureresources-api": "^2.3.1", + "@microsoft/vscode-azureresources-api": "^2.6.2", "@vscode/extension-telemetry": "^0.9.6", "dayjs": "^1.11.2", "escape-string-regexp": "^2.0.0", @@ -878,34 +869,26 @@ "@azure/ms-rest-azure-env": "^2.0.0" } }, - "node_modules/@microsoft/vscode-azext-utils/node_modules/uuid": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", - "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", - "bin": { - "uuid": "dist/bin/uuid" - } - }, "node_modules/@microsoft/vscode-azureresources-api": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/@microsoft/vscode-azureresources-api/-/vscode-azureresources-api-2.3.2.tgz", - "integrity": "sha512-hwG8Q1ywk7faPIyKLRT5Lfk9usl5i0mIxqyVEWxs4gBi5Jfq4d90WEJbHJLX72v6HS+4KQCKJ0h0XhNS7y4OZg==", + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/@microsoft/vscode-azureresources-api/-/vscode-azureresources-api-2.6.3.tgz", + "integrity": "sha512-uwFHLc9fsbuBPKC/WOU+p5JMj9VyNyU1k+3T1uFp00l4OMmazqBqiJYKao6jc/d525hy9FW6EzniGPHdocKApA==", "peerDependencies": { "@azure/ms-rest-azure-env": "^2.0.0" } }, "node_modules/@nevware21/ts-async": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/@nevware21/ts-async/-/ts-async-0.5.2.tgz", - "integrity": "sha512-Zf2vUNjCw2vJsiVKhWXA9hCNHsn59AOSGa5jGP4tWrp/vTH9XrI4eG/65khuoAgrS83migj0Xv5/j6fUAz69Zw==", + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/@nevware21/ts-async/-/ts-async-0.5.4.tgz", + "integrity": "sha512-IBTyj29GwGlxfzXw2NPnzty+w0Adx61Eze1/lknH/XIVdxtF9UnOpk76tnrHXWa6j84a1RR9hsOcHQPFv9qJjA==", "dependencies": { - "@nevware21/ts-utils": ">= 0.11.3 < 2.x" + "@nevware21/ts-utils": ">= 0.11.6 < 2.x" } }, "node_modules/@nevware21/ts-utils": { - "version": "0.11.3", - "resolved": "https://registry.npmjs.org/@nevware21/ts-utils/-/ts-utils-0.11.3.tgz", - "integrity": "sha512-oipW+tyKN68bREjoESYAzOZiatM+1LF+ez1TX3BaeinhCkI18xsLgmpH9tvwHaVgKf1Tsth25sdbXVtYmgRYvQ==" + "version": "0.12.5", + "resolved": "https://registry.npmjs.org/@nevware21/ts-utils/-/ts-utils-0.12.5.tgz", + "integrity": "sha512-JPQZWPKQJjj7kAftdEZL0XDFfbMgXCGiUAZe0d7EhLC3QlXTlZdSckGqqRIQ2QNl0VTEZyZUvRBw6Ednw089Fw==" }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", @@ -1286,9 +1269,9 @@ } }, "node_modules/@types/vscode": { - "version": "1.98.0", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.98.0.tgz", - "integrity": "sha512-+KuiWhpbKBaG2egF+51KjbGWatTH5BbmWQjSLMDCssb4xF8FJnW4nGH4nuAdOOfMbpD0QlHtI+C3tPq+DoKElg==", + "version": "1.104.0", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.104.0.tgz", + "integrity": "sha512-0KwoU2rZ2ecsTGFxo4K1+f+AErRsYW0fsp6A0zufzGuhyczc2IoKqYqcwXidKXmy2u8YB2GsYsOtiI9Izx3Tig==", "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { @@ -1480,13 +1463,13 @@ } }, "node_modules/@vscode/extension-telemetry": { - "version": "0.9.6", - "resolved": "https://registry.npmjs.org/@vscode/extension-telemetry/-/extension-telemetry-0.9.6.tgz", - "integrity": "sha512-qWK2GNw+b69QRYpjuNM9g3JKToMICoNIdc0rQMtvb4gIG9vKKCZCVCz+ZOx6XM/YlfWAyuPiyxcjIY0xyF+Djg==", + "version": "0.9.9", + "resolved": "https://registry.npmjs.org/@vscode/extension-telemetry/-/extension-telemetry-0.9.9.tgz", + "integrity": "sha512-WG/H+H/JRMPnpbXMufXgXlaeJwKszXfAanOERV/nkXBbYyNw0KR84JjUjSg+TgkzYEF/ttRoHTP6fFZWkXdoDQ==", "dependencies": { - "@microsoft/1ds-core-js": "^4.1.2", - "@microsoft/1ds-post-js": "^4.1.2", - "@microsoft/applicationinsights-web-basic": "^3.1.2" + "@microsoft/1ds-core-js": "^4.3.4", + "@microsoft/1ds-post-js": "^4.3.4", + "@microsoft/applicationinsights-web-basic": "^3.3.4" }, "engines": { "vscode": "^1.75.0" @@ -8267,6 +8250,18 @@ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "dev": true }, + "node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/v8-compile-cache-lib": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", diff --git a/package.json b/package.json index 09cd196f8..8ac3696f7 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "icon": "resources/azure-staticwebapps.png", "aiKey": "0c6ae279ed8443289764825290e4f9e2-1a736e7c-1324-4338-be46-fc2a58ae4d14-7255", "engines": { - "vscode": "^1.95.0" + "vscode": "^1.104.0" }, "repository": { "type": "git", @@ -474,7 +474,7 @@ "@types/mocha": "^8.2.2", "@types/node": "^16.18.36", "@types/semver": "^7.3.8", - "@types/vscode": "^1.95.0", + "@types/vscode": "1.104.0", "@typescript-eslint/eslint-plugin": "^5.59.11", "@vscode/test-electron": "^2.3.8", "@vscode/vsce": "^2.19.0", @@ -496,10 +496,10 @@ "dependencies": { "@azure/arm-appservice": "^11.0.0", "@azure/arm-resources": "^5.0.0", - "@microsoft/vscode-azext-azureappsettings": "^0.2.0", - "@microsoft/vscode-azext-azureutils": "^3.1.2", - "@microsoft/vscode-azext-utils": "^2.6.3", - "@microsoft/vscode-azureresources-api": "^2.0.3", + "@microsoft/vscode-azext-azureappsettings": "^0.2.11", + "@microsoft/vscode-azext-azureutils": "^3.5.2", + "@microsoft/vscode-azext-utils": "^3.5.1", + "@microsoft/vscode-azureresources-api": "^2.6.3", "@octokit/rest": "^18.5.2", "buffer": "^6.0.3", "dayjs": "^1.11.0", diff --git a/src/vscode.proposed.authLearnMore.d.ts b/src/vscode.proposed.authLearnMore.d.ts new file mode 100644 index 000000000..d943819da --- /dev/null +++ b/src/vscode.proposed.authLearnMore.d.ts @@ -0,0 +1,18 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +declare module 'vscode' { + + // https://github.com/microsoft/vscode/issues/206587 + + export interface AuthenticationGetSessionPresentationOptions { + /** + * An optional Uri to open in the browser to learn more about this authentication request. + */ + learnMore?: Uri; + } +} + +// this proposed api is only included because vscode.proposed.authenticationChallenges.d.ts depends on it diff --git a/src/vscode.proposed.authenticationChallenges.d.ts b/src/vscode.proposed.authenticationChallenges.d.ts new file mode 100644 index 000000000..71729a6df --- /dev/null +++ b/src/vscode.proposed.authenticationChallenges.d.ts @@ -0,0 +1,178 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +declare module 'vscode' { + + // https://github.com/microsoft/vscode/issues/260156 + + /********** + * "Extension asking for auth" API + *******/ + + /** + * Represents parameters for creating a session based on a WWW-Authenticate header value. + * This is used when an API returns a 401 with a WWW-Authenticate header indicating + * that additional authentication is required. The details of which will be passed down + * to the authentication provider to create a session. + * + * @note The authorization provider must support handling challenges and specifically + * the challenges in this WWW-Authenticate value. + * @note For more information on WWW-Authenticate please see https://developer.mozilla.org/docs/Web/HTTP/Reference/Headers/WWW-Authenticate + */ + export interface AuthenticationWwwAuthenticateRequest { + /** + * The raw WWW-Authenticate header value that triggered this challenge. + * This will be parsed by the authentication provider to extract the necessary + * challenge information. + */ + readonly wwwAuthenticate: string; + + /** + * The fallback scopes to use if no scopes are found in the WWW-Authenticate header. + */ + readonly fallbackScopes?: readonly string[]; + + /** + * @deprecated Use `fallbackScopes` instead. + */ + readonly scopes?: readonly string[]; + } + + export namespace authentication { + /** + * Get an authentication session matching the desired scopes or satisfying the WWW-Authenticate request. Rejects if + * a provider with providerId is not registered, or if the user does not consent to sharing authentication information + * with the extension. If there are multiple sessions with the same scopes, the user will be shown a quickpick to + * select which account they would like to use. + * + * Built-in auth providers include: + * * 'github' - For GitHub.com + * * 'microsoft' For both personal & organizational Microsoft accounts + * * (less common) 'github-enterprise' - for alternative GitHub hostings, GHE.com, GitHub Enterprise Server + * * (less common) 'microsoft-sovereign-cloud' - for alternative Microsoft clouds + * + * @param providerId The id of the provider to use + * @param scopeListOrRequest A scope list of permissions requested or a WWW-Authenticate request. These are dependent on the authentication provider. + * @param options The {@link AuthenticationGetSessionOptions} to use + * @returns A thenable that resolves to an authentication session + */ + export function getSession(providerId: string, scopeListOrRequest: ReadonlyArray | AuthenticationWwwAuthenticateRequest, options: AuthenticationGetSessionOptions & { /** */createIfNone: true | AuthenticationGetSessionPresentationOptions }): Thenable; + + /** + * Get an authentication session matching the desired scopes or request. Rejects if a provider with providerId is not + * registered, or if the user does not consent to sharing authentication information with the extension. If there + * are multiple sessions with the same scopes, the user will be shown a quickpick to select which account they would like to use. + * + * Built-in auth providers include: + * * 'github' - For GitHub.com + * * 'microsoft' For both personal & organizational Microsoft accounts + * * (less common) 'github-enterprise' - for alternative GitHub hostings, GHE.com, GitHub Enterprise Server + * * (less common) 'microsoft-sovereign-cloud' - for alternative Microsoft clouds + * + * @param providerId The id of the provider to use + * @param scopeListOrRequest A scope list of permissions requested or a WWW-Authenticate request. These are dependent on the authentication provider. + * @param options The {@link AuthenticationGetSessionOptions} to use + * @returns A thenable that resolves to an authentication session + */ + export function getSession(providerId: string, scopeListOrRequest: ReadonlyArray | AuthenticationWwwAuthenticateRequest, options: AuthenticationGetSessionOptions & { /** literal-type defines return type */forceNewSession: true | AuthenticationGetSessionPresentationOptions | AuthenticationForceNewSessionOptions }): Thenable; + + /** + * Get an authentication session matching the desired scopes or request. Rejects if a provider with providerId is not + * registered, or if the user does not consent to sharing authentication information with the extension. If there + * are multiple sessions with the same scopes, the user will be shown a quickpick to select which account they would like to use. + * + * Built-in auth providers include: + * * 'github' - For GitHub.com + * * 'microsoft' For both personal & organizational Microsoft accounts + * * (less common) 'github-enterprise' - for alternative GitHub hostings, GHE.com, GitHub Enterprise Server + * * (less common) 'microsoft-sovereign-cloud' - for alternative Microsoft clouds + * + * @param providerId The id of the provider to use + * @param scopeListOrRequest A scope list of permissions requested or a WWW-Authenticate request. These are dependent on the authentication provider. + * @param options The {@link AuthenticationGetSessionOptions} to use + * @returns A thenable that resolves to an authentication session or undefined if a silent flow was used and no session was found + */ + export function getSession(providerId: string, scopeListOrRequest: ReadonlyArray | AuthenticationWwwAuthenticateRequest, options?: AuthenticationGetSessionOptions): Thenable; + } + + + /********** + * "Extension providing auth" API + * NOTE: This doesn't need to be finalized with the above + *******/ + + /** + * Represents an authentication challenge from a WWW-Authenticate header. + * This is used to handle cases where additional authentication steps are required, + * such as when mandatory multi-factor authentication (MFA) is enforced. + * + * @note For more information on WWW-Authenticate please see https://developer.mozilla.org/docs/Web/HTTP/Reference/Headers/WWW-Authenticate + */ + export interface AuthenticationChallenge { + /** + * The authentication scheme (e.g., 'Bearer'). + */ + readonly scheme: string; + + /** + * Parameters for the authentication challenge. + * For Bearer challenges, this may include 'claims', 'scope', 'realm', etc. + */ + readonly params: Record; + } + + /** + * Represents constraints for authentication, including challenges and optional scopes. + * This is used when creating or retrieving sessions that must satisfy specific authentication + * requirements from WWW-Authenticate headers. + * + * @note For more information on WWW-Authenticate please see https://developer.mozilla.org/docs/Web/HTTP/Reference/Headers/WWW-Authenticate + */ + export interface AuthenticationConstraint { + /** + * Array of authentication challenges parsed from WWW-Authenticate headers. + */ + readonly challenges: readonly AuthenticationChallenge[]; + + /** + * Optional scopes for the session. If not provided, the authentication provider + * may extract scopes from the challenges or use default scopes. + */ + readonly fallbackScopes?: readonly string[]; + } + + /** + * An authentication provider that supports challenge-based authentication. + * This extends the base AuthenticationProvider with methods to handle authentication + * challenges from WWW-Authenticate headers. + * + * TODO: Enforce that both of these functions should be defined by creating a new AuthenticationProviderWithChallenges interface. + * But this can be done later since this part doesn't need finalization. + */ + export interface AuthenticationProvider { + /** + * Get existing sessions that match the given authentication constraints. + * + * @param constraint The authentication constraint containing challenges and optional scopes + * @param options Options for the session request + * @returns A thenable that resolves to an array of existing authentication sessions + */ + getSessionsFromChallenges?(constraint: AuthenticationConstraint, options: AuthenticationProviderSessionOptions): Thenable; + + /** + * Create a new session based on authentication constraints. + * This is called when no existing session matches the constraint requirements. + * + * @param constraint The authentication constraint containing challenges and optional scopes + * @param options Options for the session creation + * @returns A thenable that resolves to a new authentication session + */ + createSessionFromChallenges?(constraint: AuthenticationConstraint, options: AuthenticationProviderSessionOptions): Thenable; + } + + export interface AuthenticationProviderOptions { + supportsChallenges?: boolean; + } +} diff --git a/test/runTest.ts b/test/runTest.ts index 5361bd04d..beb406f60 100644 --- a/test/runTest.ts +++ b/test/runTest.ts @@ -9,14 +9,13 @@ import * as path from 'path'; async function main(): Promise { try { - const vscodeExecutablePath = await downloadAndUnzipVSCode('stable'); + const vscodeExecutablePath = await downloadAndUnzipVSCode('insiders'); const [cli, ...args] = resolveCliArgsFromVSCodeExecutablePath(vscodeExecutablePath); cp.spawnSync( cli, [ ...args, - '--install-extension', 'ms-vscode.azure-account', '--install-extension', 'ms-azuretools.vscode-azureresourcegroups', '--install-extension', 'ms-azuretools.vscode-azurefunctions', ],