@azure/identity-vscode 1.0.1-alpha.20241203.2 → 1.0.1-alpha.20241206.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{types/identity-vscode.d.ts → dist/browser/index.d.ts} +31 -33
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/package.json +3 -0
- package/dist/commonjs/index.d.ts +31 -0
- package/dist/commonjs/index.d.ts.map +1 -0
- package/dist/commonjs/index.js +42 -0
- package/dist/commonjs/index.js.map +1 -0
- package/dist/commonjs/package.json +3 -0
- package/dist/commonjs/tsdoc-metadata.json +11 -0
- package/dist/esm/index.d.ts +31 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/{index.js → esm/index.js} +3 -10
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/react-native/index.d.ts +31 -0
- package/dist/react-native/index.d.ts.map +1 -0
- package/dist/react-native/index.js +37 -0
- package/dist/react-native/index.js.map +1 -0
- package/dist/react-native/package.json +3 -0
- package/package.json +53 -25
- package/dist/index.js.map +0 -1
- /package/{dist-esm/src → dist/browser}/index.js +0 -0
- /package/{dist-esm/src → dist/browser}/index.js.map +0 -0
|
@@ -1,33 +1,31 @@
|
|
|
1
|
-
import type { IdentityPlugin } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* `
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* import {
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
export { }
|
|
1
|
+
import type { IdentityPlugin } from "@azure/identity";
|
|
2
|
+
/**
|
|
3
|
+
* A plugin that provides the dependencies of `VisualStudioCodeCredential`
|
|
4
|
+
* and enables it within `@azure/identity`. The plugin API is compatible with
|
|
5
|
+
* `@azure/identity` versions 2.0.0 and later. Load this plugin using the
|
|
6
|
+
* `useIdentityPlugin` function, imported from `@azure/identity`.
|
|
7
|
+
*
|
|
8
|
+
* `VisualStudioCodeCredential` uses the authentication session from the "Azure
|
|
9
|
+
* Account" extension in VS Code.
|
|
10
|
+
*
|
|
11
|
+
* To use this functionality, import `VisualStudioCodeCredential` or
|
|
12
|
+
* `DefaultAzureCredential` from `@azure/identity`. If this plugin is not
|
|
13
|
+
* enabled, then `VisualStudioCodeCredential` will throw a
|
|
14
|
+
* `CredentialUnavailableError`, and `DefaultAzureCredential` will not be able
|
|
15
|
+
* to use authentication through Visual Studio Code.
|
|
16
|
+
*
|
|
17
|
+
* Example:
|
|
18
|
+
*
|
|
19
|
+
* ```javascript
|
|
20
|
+
* import { useIdentityPlugin, VisualStudioCodeCredential } from "@azure/identity";
|
|
21
|
+
* import { vsCodePlugin } from "@azure/identity-vscode";
|
|
22
|
+
*
|
|
23
|
+
* // Load the plugin
|
|
24
|
+
* useIdentityPlugin(vsCodePlugin);
|
|
25
|
+
*
|
|
26
|
+
* // Now that the plugin is loaded, this credential may be used
|
|
27
|
+
* const credential = new VisualStudioCodeCredential();
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare const vsCodePlugin: IdentityPlugin;
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AA+BtD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,YAAY,EAAE,cAM1B,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { IdentityPlugin } from "@azure/identity";
|
|
2
|
+
/**
|
|
3
|
+
* A plugin that provides the dependencies of `VisualStudioCodeCredential`
|
|
4
|
+
* and enables it within `@azure/identity`. The plugin API is compatible with
|
|
5
|
+
* `@azure/identity` versions 2.0.0 and later. Load this plugin using the
|
|
6
|
+
* `useIdentityPlugin` function, imported from `@azure/identity`.
|
|
7
|
+
*
|
|
8
|
+
* `VisualStudioCodeCredential` uses the authentication session from the "Azure
|
|
9
|
+
* Account" extension in VS Code.
|
|
10
|
+
*
|
|
11
|
+
* To use this functionality, import `VisualStudioCodeCredential` or
|
|
12
|
+
* `DefaultAzureCredential` from `@azure/identity`. If this plugin is not
|
|
13
|
+
* enabled, then `VisualStudioCodeCredential` will throw a
|
|
14
|
+
* `CredentialUnavailableError`, and `DefaultAzureCredential` will not be able
|
|
15
|
+
* to use authentication through Visual Studio Code.
|
|
16
|
+
*
|
|
17
|
+
* Example:
|
|
18
|
+
*
|
|
19
|
+
* ```javascript
|
|
20
|
+
* import { useIdentityPlugin, VisualStudioCodeCredential } from "@azure/identity";
|
|
21
|
+
* import { vsCodePlugin } from "@azure/identity-vscode";
|
|
22
|
+
*
|
|
23
|
+
* // Load the plugin
|
|
24
|
+
* useIdentityPlugin(vsCodePlugin);
|
|
25
|
+
*
|
|
26
|
+
* // Now that the plugin is loaded, this credential may be used
|
|
27
|
+
* const credential = new VisualStudioCodeCredential();
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare const vsCodePlugin: IdentityPlugin;
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AA+BtD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,YAAY,EAAE,cAM1B,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.vsCodePlugin = void 0;
|
|
6
|
+
const tslib_1 = require("tslib");
|
|
7
|
+
const keytar_1 = tslib_1.__importDefault(require("keytar"));
|
|
8
|
+
const VSCodeServiceName = "VS Code Azure";
|
|
9
|
+
/**
|
|
10
|
+
* A plugin that provides the dependencies of `VisualStudioCodeCredential`
|
|
11
|
+
* and enables it within `@azure/identity`. The plugin API is compatible with
|
|
12
|
+
* `@azure/identity` versions 2.0.0 and later. Load this plugin using the
|
|
13
|
+
* `useIdentityPlugin` function, imported from `@azure/identity`.
|
|
14
|
+
*
|
|
15
|
+
* `VisualStudioCodeCredential` uses the authentication session from the "Azure
|
|
16
|
+
* Account" extension in VS Code.
|
|
17
|
+
*
|
|
18
|
+
* To use this functionality, import `VisualStudioCodeCredential` or
|
|
19
|
+
* `DefaultAzureCredential` from `@azure/identity`. If this plugin is not
|
|
20
|
+
* enabled, then `VisualStudioCodeCredential` will throw a
|
|
21
|
+
* `CredentialUnavailableError`, and `DefaultAzureCredential` will not be able
|
|
22
|
+
* to use authentication through Visual Studio Code.
|
|
23
|
+
*
|
|
24
|
+
* Example:
|
|
25
|
+
*
|
|
26
|
+
* ```javascript
|
|
27
|
+
* import { useIdentityPlugin, VisualStudioCodeCredential } from "@azure/identity";
|
|
28
|
+
* import { vsCodePlugin } from "@azure/identity-vscode";
|
|
29
|
+
*
|
|
30
|
+
* // Load the plugin
|
|
31
|
+
* useIdentityPlugin(vsCodePlugin);
|
|
32
|
+
*
|
|
33
|
+
* // Now that the plugin is loaded, this credential may be used
|
|
34
|
+
* const credential = new VisualStudioCodeCredential();
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
const vsCodePlugin = (context) => {
|
|
38
|
+
const { vsCodeCredentialControl } = context;
|
|
39
|
+
vsCodeCredentialControl.setVsCodeCredentialFinder(() => keytar_1.default.findCredentials(VSCodeServiceName));
|
|
40
|
+
};
|
|
41
|
+
exports.vsCodePlugin = vsCodePlugin;
|
|
42
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAGlC,4DAA4B;AAE5B,MAAM,iBAAiB,GAAG,eAAe,CAAC;AA4B1C;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACI,MAAM,YAAY,GAAmB,CAAC,OAAO,EAAE,EAAE;IACtD,MAAM,EAAE,uBAAuB,EAAE,GAAG,OAA6B,CAAC;IAElE,uBAAuB,CAAC,yBAAyB,CAAC,GAAG,EAAE,CACrD,gBAAM,CAAC,eAAe,CAAC,iBAAiB,CAAC,CAC1C,CAAC;AACJ,CAAC,CAAC;AANW,QAAA,YAAY,gBAMvB","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { IdentityPlugin } from \"@azure/identity\";\nimport keytar from \"keytar\";\n\nconst VSCodeServiceName = \"VS Code Azure\";\n\n/**\n * A function that searches for credentials in the Visual Studio Code credential store.\n *\n * @returns an array of credentials (username and password)\n */\ntype VSCodeCredentialFinder = () => Promise<Array<{ account: string; password: string }>>;\n\n/**\n * Plugin context entries for controlling VisualStudioCodeCredential.\n */\ninterface VisualStudioCodeCredentialControl {\n setVsCodeCredentialFinder(finder: VSCodeCredentialFinder): void;\n}\n\n/**\n * Context options passed to a plugin during initialization.\n *\n * Plugin authors are responsible for casting their plugin context values\n * to this type.\n *\n * @internal\n */\ninterface AzurePluginContext {\n vsCodeCredentialControl: VisualStudioCodeCredentialControl;\n}\n\n/**\n * A plugin that provides the dependencies of `VisualStudioCodeCredential`\n * and enables it within `@azure/identity`. The plugin API is compatible with\n * `@azure/identity` versions 2.0.0 and later. Load this plugin using the\n * `useIdentityPlugin` function, imported from `@azure/identity`.\n *\n * `VisualStudioCodeCredential` uses the authentication session from the \"Azure\n * Account\" extension in VS Code.\n *\n * To use this functionality, import `VisualStudioCodeCredential` or\n * `DefaultAzureCredential` from `@azure/identity`. If this plugin is not\n * enabled, then `VisualStudioCodeCredential` will throw a\n * `CredentialUnavailableError`, and `DefaultAzureCredential` will not be able\n * to use authentication through Visual Studio Code.\n *\n * Example:\n *\n * ```javascript\n * import { useIdentityPlugin, VisualStudioCodeCredential } from \"@azure/identity\";\n * import { vsCodePlugin } from \"@azure/identity-vscode\";\n *\n * // Load the plugin\n * useIdentityPlugin(vsCodePlugin);\n *\n * // Now that the plugin is loaded, this credential may be used\n * const credential = new VisualStudioCodeCredential();\n * ```\n */\nexport const vsCodePlugin: IdentityPlugin = (context) => {\n const { vsCodeCredentialControl } = context as AzurePluginContext;\n\n vsCodeCredentialControl.setVsCodeCredentialFinder(() =>\n keytar.findCredentials(VSCodeServiceName),\n );\n};\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
|
|
2
|
+
// It should be published with your NPM package. It should not be tracked by Git.
|
|
3
|
+
{
|
|
4
|
+
"tsdocVersion": "0.12",
|
|
5
|
+
"toolPackages": [
|
|
6
|
+
{
|
|
7
|
+
"packageName": "@microsoft/api-extractor",
|
|
8
|
+
"packageVersion": "7.48.0"
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { IdentityPlugin } from "@azure/identity";
|
|
2
|
+
/**
|
|
3
|
+
* A plugin that provides the dependencies of `VisualStudioCodeCredential`
|
|
4
|
+
* and enables it within `@azure/identity`. The plugin API is compatible with
|
|
5
|
+
* `@azure/identity` versions 2.0.0 and later. Load this plugin using the
|
|
6
|
+
* `useIdentityPlugin` function, imported from `@azure/identity`.
|
|
7
|
+
*
|
|
8
|
+
* `VisualStudioCodeCredential` uses the authentication session from the "Azure
|
|
9
|
+
* Account" extension in VS Code.
|
|
10
|
+
*
|
|
11
|
+
* To use this functionality, import `VisualStudioCodeCredential` or
|
|
12
|
+
* `DefaultAzureCredential` from `@azure/identity`. If this plugin is not
|
|
13
|
+
* enabled, then `VisualStudioCodeCredential` will throw a
|
|
14
|
+
* `CredentialUnavailableError`, and `DefaultAzureCredential` will not be able
|
|
15
|
+
* to use authentication through Visual Studio Code.
|
|
16
|
+
*
|
|
17
|
+
* Example:
|
|
18
|
+
*
|
|
19
|
+
* ```javascript
|
|
20
|
+
* import { useIdentityPlugin, VisualStudioCodeCredential } from "@azure/identity";
|
|
21
|
+
* import { vsCodePlugin } from "@azure/identity-vscode";
|
|
22
|
+
*
|
|
23
|
+
* // Load the plugin
|
|
24
|
+
* useIdentityPlugin(vsCodePlugin);
|
|
25
|
+
*
|
|
26
|
+
* // Now that the plugin is loaded, this credential may be used
|
|
27
|
+
* const credential = new VisualStudioCodeCredential();
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare const vsCodePlugin: IdentityPlugin;
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AA+BtD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,YAAY,EAAE,cAM1B,CAAC"}
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var keytar = require('keytar');
|
|
6
|
-
|
|
7
1
|
// Copyright (c) Microsoft Corporation.
|
|
8
2
|
// Licensed under the MIT License.
|
|
3
|
+
import keytar from "keytar";
|
|
9
4
|
const VSCodeServiceName = "VS Code Azure";
|
|
10
5
|
/**
|
|
11
6
|
* A plugin that provides the dependencies of `VisualStudioCodeCredential`
|
|
@@ -35,10 +30,8 @@ const VSCodeServiceName = "VS Code Azure";
|
|
|
35
30
|
* const credential = new VisualStudioCodeCredential();
|
|
36
31
|
* ```
|
|
37
32
|
*/
|
|
38
|
-
const vsCodePlugin = (context) => {
|
|
33
|
+
export const vsCodePlugin = (context) => {
|
|
39
34
|
const { vsCodeCredentialControl } = context;
|
|
40
35
|
vsCodeCredentialControl.setVsCodeCredentialFinder(() => keytar.findCredentials(VSCodeServiceName));
|
|
41
36
|
};
|
|
42
|
-
|
|
43
|
-
exports.vsCodePlugin = vsCodePlugin;
|
|
44
|
-
//# sourceMappingURL=index.js.map
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,MAAM,iBAAiB,GAAG,eAAe,CAAC;AA4B1C;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,CAAC,MAAM,YAAY,GAAmB,CAAC,OAAO,EAAE,EAAE;IACtD,MAAM,EAAE,uBAAuB,EAAE,GAAG,OAA6B,CAAC;IAElE,uBAAuB,CAAC,yBAAyB,CAAC,GAAG,EAAE,CACrD,MAAM,CAAC,eAAe,CAAC,iBAAiB,CAAC,CAC1C,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { IdentityPlugin } from \"@azure/identity\";\nimport keytar from \"keytar\";\n\nconst VSCodeServiceName = \"VS Code Azure\";\n\n/**\n * A function that searches for credentials in the Visual Studio Code credential store.\n *\n * @returns an array of credentials (username and password)\n */\ntype VSCodeCredentialFinder = () => Promise<Array<{ account: string; password: string }>>;\n\n/**\n * Plugin context entries for controlling VisualStudioCodeCredential.\n */\ninterface VisualStudioCodeCredentialControl {\n setVsCodeCredentialFinder(finder: VSCodeCredentialFinder): void;\n}\n\n/**\n * Context options passed to a plugin during initialization.\n *\n * Plugin authors are responsible for casting their plugin context values\n * to this type.\n *\n * @internal\n */\ninterface AzurePluginContext {\n vsCodeCredentialControl: VisualStudioCodeCredentialControl;\n}\n\n/**\n * A plugin that provides the dependencies of `VisualStudioCodeCredential`\n * and enables it within `@azure/identity`. The plugin API is compatible with\n * `@azure/identity` versions 2.0.0 and later. Load this plugin using the\n * `useIdentityPlugin` function, imported from `@azure/identity`.\n *\n * `VisualStudioCodeCredential` uses the authentication session from the \"Azure\n * Account\" extension in VS Code.\n *\n * To use this functionality, import `VisualStudioCodeCredential` or\n * `DefaultAzureCredential` from `@azure/identity`. If this plugin is not\n * enabled, then `VisualStudioCodeCredential` will throw a\n * `CredentialUnavailableError`, and `DefaultAzureCredential` will not be able\n * to use authentication through Visual Studio Code.\n *\n * Example:\n *\n * ```javascript\n * import { useIdentityPlugin, VisualStudioCodeCredential } from \"@azure/identity\";\n * import { vsCodePlugin } from \"@azure/identity-vscode\";\n *\n * // Load the plugin\n * useIdentityPlugin(vsCodePlugin);\n *\n * // Now that the plugin is loaded, this credential may be used\n * const credential = new VisualStudioCodeCredential();\n * ```\n */\nexport const vsCodePlugin: IdentityPlugin = (context) => {\n const { vsCodeCredentialControl } = context as AzurePluginContext;\n\n vsCodeCredentialControl.setVsCodeCredentialFinder(() =>\n keytar.findCredentials(VSCodeServiceName),\n );\n};\n"]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { IdentityPlugin } from "@azure/identity";
|
|
2
|
+
/**
|
|
3
|
+
* A plugin that provides the dependencies of `VisualStudioCodeCredential`
|
|
4
|
+
* and enables it within `@azure/identity`. The plugin API is compatible with
|
|
5
|
+
* `@azure/identity` versions 2.0.0 and later. Load this plugin using the
|
|
6
|
+
* `useIdentityPlugin` function, imported from `@azure/identity`.
|
|
7
|
+
*
|
|
8
|
+
* `VisualStudioCodeCredential` uses the authentication session from the "Azure
|
|
9
|
+
* Account" extension in VS Code.
|
|
10
|
+
*
|
|
11
|
+
* To use this functionality, import `VisualStudioCodeCredential` or
|
|
12
|
+
* `DefaultAzureCredential` from `@azure/identity`. If this plugin is not
|
|
13
|
+
* enabled, then `VisualStudioCodeCredential` will throw a
|
|
14
|
+
* `CredentialUnavailableError`, and `DefaultAzureCredential` will not be able
|
|
15
|
+
* to use authentication through Visual Studio Code.
|
|
16
|
+
*
|
|
17
|
+
* Example:
|
|
18
|
+
*
|
|
19
|
+
* ```javascript
|
|
20
|
+
* import { useIdentityPlugin, VisualStudioCodeCredential } from "@azure/identity";
|
|
21
|
+
* import { vsCodePlugin } from "@azure/identity-vscode";
|
|
22
|
+
*
|
|
23
|
+
* // Load the plugin
|
|
24
|
+
* useIdentityPlugin(vsCodePlugin);
|
|
25
|
+
*
|
|
26
|
+
* // Now that the plugin is loaded, this credential may be used
|
|
27
|
+
* const credential = new VisualStudioCodeCredential();
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare const vsCodePlugin: IdentityPlugin;
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AA+BtD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,YAAY,EAAE,cAM1B,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
import keytar from "keytar";
|
|
4
|
+
const VSCodeServiceName = "VS Code Azure";
|
|
5
|
+
/**
|
|
6
|
+
* A plugin that provides the dependencies of `VisualStudioCodeCredential`
|
|
7
|
+
* and enables it within `@azure/identity`. The plugin API is compatible with
|
|
8
|
+
* `@azure/identity` versions 2.0.0 and later. Load this plugin using the
|
|
9
|
+
* `useIdentityPlugin` function, imported from `@azure/identity`.
|
|
10
|
+
*
|
|
11
|
+
* `VisualStudioCodeCredential` uses the authentication session from the "Azure
|
|
12
|
+
* Account" extension in VS Code.
|
|
13
|
+
*
|
|
14
|
+
* To use this functionality, import `VisualStudioCodeCredential` or
|
|
15
|
+
* `DefaultAzureCredential` from `@azure/identity`. If this plugin is not
|
|
16
|
+
* enabled, then `VisualStudioCodeCredential` will throw a
|
|
17
|
+
* `CredentialUnavailableError`, and `DefaultAzureCredential` will not be able
|
|
18
|
+
* to use authentication through Visual Studio Code.
|
|
19
|
+
*
|
|
20
|
+
* Example:
|
|
21
|
+
*
|
|
22
|
+
* ```javascript
|
|
23
|
+
* import { useIdentityPlugin, VisualStudioCodeCredential } from "@azure/identity";
|
|
24
|
+
* import { vsCodePlugin } from "@azure/identity-vscode";
|
|
25
|
+
*
|
|
26
|
+
* // Load the plugin
|
|
27
|
+
* useIdentityPlugin(vsCodePlugin);
|
|
28
|
+
*
|
|
29
|
+
* // Now that the plugin is loaded, this credential may be used
|
|
30
|
+
* const credential = new VisualStudioCodeCredential();
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export const vsCodePlugin = (context) => {
|
|
34
|
+
const { vsCodeCredentialControl } = context;
|
|
35
|
+
vsCodeCredentialControl.setVsCodeCredentialFinder(() => keytar.findCredentials(VSCodeServiceName));
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,MAAM,iBAAiB,GAAG,eAAe,CAAC;AA4B1C;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,CAAC,MAAM,YAAY,GAAmB,CAAC,OAAO,EAAE,EAAE;IACtD,MAAM,EAAE,uBAAuB,EAAE,GAAG,OAA6B,CAAC;IAElE,uBAAuB,CAAC,yBAAyB,CAAC,GAAG,EAAE,CACrD,MAAM,CAAC,eAAe,CAAC,iBAAiB,CAAC,CAC1C,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { IdentityPlugin } from \"@azure/identity\";\nimport keytar from \"keytar\";\n\nconst VSCodeServiceName = \"VS Code Azure\";\n\n/**\n * A function that searches for credentials in the Visual Studio Code credential store.\n *\n * @returns an array of credentials (username and password)\n */\ntype VSCodeCredentialFinder = () => Promise<Array<{ account: string; password: string }>>;\n\n/**\n * Plugin context entries for controlling VisualStudioCodeCredential.\n */\ninterface VisualStudioCodeCredentialControl {\n setVsCodeCredentialFinder(finder: VSCodeCredentialFinder): void;\n}\n\n/**\n * Context options passed to a plugin during initialization.\n *\n * Plugin authors are responsible for casting their plugin context values\n * to this type.\n *\n * @internal\n */\ninterface AzurePluginContext {\n vsCodeCredentialControl: VisualStudioCodeCredentialControl;\n}\n\n/**\n * A plugin that provides the dependencies of `VisualStudioCodeCredential`\n * and enables it within `@azure/identity`. The plugin API is compatible with\n * `@azure/identity` versions 2.0.0 and later. Load this plugin using the\n * `useIdentityPlugin` function, imported from `@azure/identity`.\n *\n * `VisualStudioCodeCredential` uses the authentication session from the \"Azure\n * Account\" extension in VS Code.\n *\n * To use this functionality, import `VisualStudioCodeCredential` or\n * `DefaultAzureCredential` from `@azure/identity`. If this plugin is not\n * enabled, then `VisualStudioCodeCredential` will throw a\n * `CredentialUnavailableError`, and `DefaultAzureCredential` will not be able\n * to use authentication through Visual Studio Code.\n *\n * Example:\n *\n * ```javascript\n * import { useIdentityPlugin, VisualStudioCodeCredential } from \"@azure/identity\";\n * import { vsCodePlugin } from \"@azure/identity-vscode\";\n *\n * // Load the plugin\n * useIdentityPlugin(vsCodePlugin);\n *\n * // Now that the plugin is loaded, this credential may be used\n * const credential = new VisualStudioCodeCredential();\n * ```\n */\nexport const vsCodePlugin: IdentityPlugin = (context) => {\n const { vsCodeCredentialControl } = context as AzurePluginContext;\n\n vsCodeCredentialControl.setVsCodeCredentialFinder(() =>\n keytar.findCredentials(VSCodeServiceName),\n );\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azure/identity-vscode",
|
|
3
|
-
"version": "1.0.1-alpha.
|
|
3
|
+
"version": "1.0.1-alpha.20241206.3",
|
|
4
4
|
"sdk-type": "client",
|
|
5
5
|
"description": "Use the Azure Account extension for Visual Studio Code to authenticate with Azure Identity",
|
|
6
|
-
"main": "dist/index.js",
|
|
7
|
-
"module": "dist
|
|
8
|
-
"types": "./
|
|
6
|
+
"main": "./dist/commonjs/index.js",
|
|
7
|
+
"module": "./dist/esm/index.js",
|
|
8
|
+
"types": "./dist/commonjs/index.d.ts",
|
|
9
9
|
"scripts": {
|
|
10
|
-
"build": "npm run clean &&
|
|
10
|
+
"build": "npm run clean && dev-tool run build-package && dev-tool run extract-api",
|
|
11
11
|
"build:samples": "echo skipped",
|
|
12
|
-
"build:test": "
|
|
12
|
+
"build:test": "echo skipped",
|
|
13
13
|
"check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\" \"samples-dev/**/*.ts\"",
|
|
14
14
|
"clean": "dev-tool run vendored rimraf --glob dist dist-* types *.tgz *.log",
|
|
15
15
|
"execute:samples": "echo skipped",
|
|
16
|
-
"extract-api": "
|
|
16
|
+
"extract-api": "dev-tool run build-package && dev-tool run extract-api",
|
|
17
17
|
"format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\" \"samples-dev/**/*.ts\"",
|
|
18
18
|
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
|
|
19
19
|
"integration-test:browser": "echo skipped",
|
|
@@ -26,13 +26,11 @@
|
|
|
26
26
|
"test:node": "npm run clean && npm run build:test && npm run unit-test:node && npm run integration-test:node",
|
|
27
27
|
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
|
|
28
28
|
"unit-test:browser": "echo skipped",
|
|
29
|
-
"unit-test:node": "
|
|
29
|
+
"unit-test:node": "echo skipped",
|
|
30
30
|
"update-snippets": "echo skipped"
|
|
31
31
|
},
|
|
32
32
|
"files": [
|
|
33
33
|
"dist/",
|
|
34
|
-
"dist-esm/src",
|
|
35
|
-
"types/identity-vscode.d.ts",
|
|
36
34
|
"README.md",
|
|
37
35
|
"LICENSE"
|
|
38
36
|
],
|
|
@@ -58,30 +56,60 @@
|
|
|
58
56
|
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity-vscode/README.md",
|
|
59
57
|
"sideEffects": false,
|
|
60
58
|
"dependencies": {
|
|
61
|
-
"@azure/identity": "^4.0
|
|
59
|
+
"@azure/identity": "^4.5.0",
|
|
62
60
|
"keytar": "^7.6.0",
|
|
63
|
-
"tslib": "^2.
|
|
61
|
+
"tslib": "^2.8.1"
|
|
64
62
|
},
|
|
65
63
|
"devDependencies": {
|
|
66
|
-
"@azure-tools/test-recorder": "
|
|
67
|
-
"@azure-tools/test-utils": "
|
|
64
|
+
"@azure-tools/test-recorder": ">=4.1.0-alpha <4.1.0-alphb",
|
|
65
|
+
"@azure-tools/test-utils-vitest": ">=1.0.0-alpha <1.0.0-alphb",
|
|
68
66
|
"@azure/core-client": "^1.7.0",
|
|
69
67
|
"@azure/dev-tool": ">=1.0.0-alpha <1.0.0-alphb",
|
|
70
68
|
"@azure/eslint-plugin-azure-sdk": ">=3.0.0-alpha <3.0.0-alphb",
|
|
71
|
-
"@types/jws": "^3.2.2",
|
|
72
|
-
"@types/mocha": "^10.0.0",
|
|
73
69
|
"@types/node": "^18.0.0",
|
|
74
|
-
"@
|
|
75
|
-
"@types/sinon": "^17.0.0",
|
|
76
|
-
"@types/uuid": "^8.0.0",
|
|
70
|
+
"@vitest/coverage-istanbul": "^2.1.8",
|
|
77
71
|
"dotenv": "^16.0.0",
|
|
78
72
|
"eslint": "^9.9.0",
|
|
79
|
-
"
|
|
80
|
-
"mocha": "^10.0.0",
|
|
81
|
-
"puppeteer": "^23.0.2",
|
|
82
|
-
"sinon": "^17.0.0",
|
|
83
|
-
"ts-node": "^10.0.0",
|
|
73
|
+
"playwright": "^1.49.0",
|
|
84
74
|
"typescript": "~5.6.2",
|
|
85
|
-
"
|
|
75
|
+
"vitest": "^2.1.8"
|
|
76
|
+
},
|
|
77
|
+
"type": "module",
|
|
78
|
+
"tshy": {
|
|
79
|
+
"exports": {
|
|
80
|
+
"./package.json": "./package.json",
|
|
81
|
+
".": "./src/index.ts"
|
|
82
|
+
},
|
|
83
|
+
"dialects": [
|
|
84
|
+
"esm",
|
|
85
|
+
"commonjs"
|
|
86
|
+
],
|
|
87
|
+
"esmDialects": [
|
|
88
|
+
"browser",
|
|
89
|
+
"react-native"
|
|
90
|
+
],
|
|
91
|
+
"selfLink": false
|
|
92
|
+
},
|
|
93
|
+
"browser": "./dist/browser/index.js",
|
|
94
|
+
"exports": {
|
|
95
|
+
"./package.json": "./package.json",
|
|
96
|
+
".": {
|
|
97
|
+
"browser": {
|
|
98
|
+
"types": "./dist/browser/index.d.ts",
|
|
99
|
+
"default": "./dist/browser/index.js"
|
|
100
|
+
},
|
|
101
|
+
"react-native": {
|
|
102
|
+
"types": "./dist/react-native/index.d.ts",
|
|
103
|
+
"default": "./dist/react-native/index.js"
|
|
104
|
+
},
|
|
105
|
+
"import": {
|
|
106
|
+
"types": "./dist/esm/index.d.ts",
|
|
107
|
+
"default": "./dist/esm/index.js"
|
|
108
|
+
},
|
|
109
|
+
"require": {
|
|
110
|
+
"types": "./dist/commonjs/index.d.ts",
|
|
111
|
+
"default": "./dist/commonjs/index.js"
|
|
112
|
+
}
|
|
113
|
+
}
|
|
86
114
|
}
|
|
87
115
|
}
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { IdentityPlugin } from \"@azure/identity\";\nimport keytar from \"keytar\";\n\nconst VSCodeServiceName = \"VS Code Azure\";\n\n/**\n * A function that searches for credentials in the Visual Studio Code credential store.\n *\n * @returns an array of credentials (username and password)\n */\ntype VSCodeCredentialFinder = () => Promise<Array<{ account: string; password: string }>>;\n\n/**\n * Plugin context entries for controlling VisualStudioCodeCredential.\n */\ninterface VisualStudioCodeCredentialControl {\n setVsCodeCredentialFinder(finder: VSCodeCredentialFinder): void;\n}\n\n/**\n * Context options passed to a plugin during initialization.\n *\n * Plugin authors are responsible for casting their plugin context values\n * to this type.\n *\n * @internal\n */\ninterface AzurePluginContext {\n vsCodeCredentialControl: VisualStudioCodeCredentialControl;\n}\n\n/**\n * A plugin that provides the dependencies of `VisualStudioCodeCredential`\n * and enables it within `@azure/identity`. The plugin API is compatible with\n * `@azure/identity` versions 2.0.0 and later. Load this plugin using the\n * `useIdentityPlugin` function, imported from `@azure/identity`.\n *\n * `VisualStudioCodeCredential` uses the authentication session from the \"Azure\n * Account\" extension in VS Code.\n *\n * To use this functionality, import `VisualStudioCodeCredential` or\n * `DefaultAzureCredential` from `@azure/identity`. If this plugin is not\n * enabled, then `VisualStudioCodeCredential` will throw a\n * `CredentialUnavailableError`, and `DefaultAzureCredential` will not be able\n * to use authentication through Visual Studio Code.\n *\n * Example:\n *\n * ```javascript\n * import { useIdentityPlugin, VisualStudioCodeCredential } from \"@azure/identity\";\n * import { vsCodePlugin } from \"@azure/identity-vscode\";\n *\n * // Load the plugin\n * useIdentityPlugin(vsCodePlugin);\n *\n * // Now that the plugin is loaded, this credential may be used\n * const credential = new VisualStudioCodeCredential();\n * ```\n */\nexport const vsCodePlugin: IdentityPlugin = (context) => {\n const { vsCodeCredentialControl } = context as AzurePluginContext;\n\n vsCodeCredentialControl.setVsCodeCredentialFinder(() =>\n keytar.findCredentials(VSCodeServiceName),\n );\n};\n"],"names":[],"mappings":";;;;;;AAAA;AACA;AAKA,MAAM,iBAAiB,GAAG,eAAe;AA4BzC;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BG;AACU,MAAA,YAAY,GAAmB,CAAC,OAAO,KAAI;AACtD,IAAA,MAAM,EAAE,uBAAuB,EAAE,GAAG,OAA6B;AAEjE,IAAA,uBAAuB,CAAC,yBAAyB,CAAC,MAChD,MAAM,CAAC,eAAe,CAAC,iBAAiB,CAAC,CAC1C;AACH;;;;"}
|
|
File without changes
|
|
File without changes
|