Files
vscode/extensions/microsoft-authentication/package.json
Tyler James Leonhardt 305134296c Adopt the MSAL broker to talk to the OS for Microsoft auth (#233739)
This adopts the `NativeBrokerPlugin` provided by `@azure/msal-node-extensions` to provide the ability to use auth state from the OS, and show native auth dialogs instead of going to the browser.

This has several pieces:
* The adoption of the broker in the microsoft-authentication extension:
  * Adding `NativeBrokerPlugin` to our PCAs
  * Using the proposed handle API to pass the native window handle down to MSAL calls (btw, this API will change in a follow up PR)
  * Adopting an AccountAccess layer to handle:
    * giving the user control of which accounts VS Code uses
    * an eventing layer so that auth state can be updated across multiple windows
* Getting the extension to build properly and only build what it really needs. This required several package.json/webpack hacks:
  * Use a fake keytar since we don't use the feature in `@azure/msal-node-extensions` that uses keytar
  * Use a fake dpapi layer since we don't use the feature in  `@azure/msal-node-extensions` that uses it
  * Ensure the msal runtime `.node` and `.dll` files are included in the bundle
* Get the VS Code build to allow a native node module in an extension: by having a list of native extensions that will be built in the "ci" part of the build - in other words when VS Code is building on the target platform

There are a couple of followups:
* Refactor the `handle` API to handle (heh) Auxiliary Windows https://github.com/microsoft/vscode/issues/233106
* Separate the call to `acquireTokenSilent` and `acquireTokenInteractive` and all the usage of this native node module into a separate process or maybe in Core... we'll see. Something to experiment with after we have something working. NEEDS FOLLOW UP ISSUE

Fixes https://github.com/microsoft/vscode/issues/229431
2024-11-15 20:53:28 +09:00

145 lines
4.6 KiB
JSON

{
"name": "microsoft-authentication",
"publisher": "vscode",
"license": "MIT",
"displayName": "%displayName%",
"description": "%description%",
"version": "0.0.1",
"engines": {
"vscode": "^1.42.0"
},
"icon": "media/icon.png",
"categories": [
"Other"
],
"activationEvents": [],
"enabledApiProposals": [
"idToken",
"nativeWindowHandle"
],
"capabilities": {
"virtualWorkspaces": true,
"untrustedWorkspaces": {
"supported": true
}
},
"extensionKind": [
"ui",
"workspace"
],
"contributes": {
"authentication": [
{
"label": "Microsoft",
"id": "microsoft"
},
{
"label": "Microsoft Sovereign Cloud",
"id": "microsoft-sovereign-cloud"
}
],
"configuration": [
{
"title": "Microsoft Sovereign Cloud",
"properties": {
"microsoft-sovereign-cloud.environment": {
"type": "string",
"markdownDescription": "%microsoft-sovereign-cloud.environment.description%",
"enum": [
"ChinaCloud",
"USGovernment",
"custom"
],
"enumDescriptions": [
"%microsoft-sovereign-cloud.environment.enumDescriptions.AzureChinaCloud%",
"%microsoft-sovereign-cloud.environment.enumDescriptions.AzureUSGovernment%",
"%microsoft-sovereign-cloud.environment.enumDescriptions.custom%"
]
},
"microsoft-sovereign-cloud.customEnvironment": {
"type": "object",
"additionalProperties": true,
"markdownDescription": "%microsoft-sovereign-cloud.customEnvironment.description%",
"properties": {
"name": {
"type": "string",
"description": "%microsoft-sovereign-cloud.customEnvironment.name.description%"
},
"portalUrl": {
"type": "string",
"description": "%microsoft-sovereign-cloud.customEnvironment.portalUrl.description%"
},
"managementEndpointUrl": {
"type": "string",
"description": "%microsoft-sovereign-cloud.customEnvironment.managementEndpointUrl.description%"
},
"resourceManagerEndpointUrl": {
"type": "string",
"description": "%microsoft-sovereign-cloud.customEnvironment.resourceManagerEndpointUrl.description%"
},
"activeDirectoryEndpointUrl": {
"type": "string",
"description": "%microsoft-sovereign-cloud.customEnvironment.activeDirectoryEndpointUrl.description%"
},
"activeDirectoryResourceId": {
"type": "string",
"description": "%microsoft-sovereign-cloud.customEnvironment.activeDirectoryResourceId.description%"
}
},
"required": [
"name",
"portalUrl",
"managementEndpointUrl",
"resourceManagerEndpointUrl",
"activeDirectoryEndpointUrl",
"activeDirectoryResourceId"
]
}
}
},
{
"title": "Microsoft",
"properties": {
"microsoft.useMsal": {
"type": "boolean",
"description": "%useMsal.description%",
"tags": [
"onExP",
"preview"
]
}
}
}
]
},
"aiKey": "0c6ae279ed8443289764825290e4f9e2-1a736e7c-1324-4338-be46-fc2a58ae4d14-7255",
"main": "./out/extension.js",
"browser": "./dist/browser/extension.js",
"scripts": {
"vscode:prepublish": "npm run compile",
"compile": "gulp compile-extension:microsoft-authentication",
"compile-web": "npx webpack-cli --config extension-browser.webpack.config --mode none",
"watch": "gulp watch-extension:microsoft-authentication",
"watch-web": "npx webpack-cli --config extension-browser.webpack.config --mode none --watch --info-verbosity verbose"
},
"devDependencies": {
"@types/node": "20.x",
"@types/node-fetch": "^2.5.7",
"@types/randombytes": "^2.0.0",
"@types/sha.js": "^2.4.0",
"@types/uuid": "8.0.0"
},
"dependencies": {
"@azure/ms-rest-azure-env": "^2.0.0",
"@azure/msal-node": "^2.13.1",
"@azure/msal-node-extensions": "^1.3.0",
"@vscode/extension-telemetry": "^0.9.0",
"keytar": "file:./packageMocks/keytar",
"vscode-tas-client": "^0.1.84"
},
"repository": {
"type": "git",
"url": "https://github.com/microsoft/vscode.git"
}
}