@microsoft/vscode-azext-azureauth 2.3.0 → 2.4.0
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/CHANGELOG.md +34 -34
- package/LICENSE.md +21 -21
- package/README.md +111 -111
- package/out/src/AzureAuthentication.d.ts +14 -14
- package/out/src/AzureAuthentication.js +6 -6
- package/out/src/AzureDevOpsSubscriptionProvider.d.ts +52 -0
- package/out/src/AzureDevOpsSubscriptionProvider.js +249 -0
- package/out/src/AzureSubscription.d.ts +44 -44
- package/out/src/AzureSubscription.js +6 -6
- package/out/src/AzureSubscriptionProvider.d.ts +60 -60
- package/out/src/AzureSubscriptionProvider.js +6 -6
- package/out/src/NotSignedInError.d.ts +15 -15
- package/out/src/NotSignedInError.js +29 -29
- package/out/src/VSCodeAzureSubscriptionProvider.d.ts +102 -102
- package/out/src/VSCodeAzureSubscriptionProvider.js +296 -296
- package/out/src/getSessionFromVSCode.d.ts +12 -12
- package/out/src/getSessionFromVSCode.js +64 -64
- package/out/src/index.d.ts +9 -8
- package/out/src/index.js +29 -28
- package/out/src/signInToTenant.d.ts +6 -6
- package/out/src/signInToTenant.js +56 -56
- package/out/src/utils/configuredAzureEnv.d.ts +24 -24
- package/out/src/utils/configuredAzureEnv.js +94 -94
- package/out/src/utils/getUnauthenticatedTenants.d.ts +6 -6
- package/out/src/utils/getUnauthenticatedTenants.js +57 -57
- package/package.json +61 -58
|
@@ -1,102 +1,102 @@
|
|
|
1
|
-
import type { TenantIdDescription } from '@azure/arm-resources-subscriptions';
|
|
2
|
-
import * as vscode from 'vscode';
|
|
3
|
-
import type { AzureSubscription, SubscriptionId, TenantId } from './AzureSubscription';
|
|
4
|
-
import type { AzureSubscriptionProvider } from './AzureSubscriptionProvider';
|
|
5
|
-
/**
|
|
6
|
-
* A class for obtaining Azure subscription information using VSCode's built-in authentication
|
|
7
|
-
* provider.
|
|
8
|
-
*/
|
|
9
|
-
export declare class VSCodeAzureSubscriptionProvider extends vscode.Disposable implements AzureSubscriptionProvider {
|
|
10
|
-
private readonly onDidSignInEmitter;
|
|
11
|
-
private lastSignInEventFired;
|
|
12
|
-
private suppressSignInEvents;
|
|
13
|
-
private readonly onDidSignOutEmitter;
|
|
14
|
-
private lastSignOutEventFired;
|
|
15
|
-
constructor();
|
|
16
|
-
/**
|
|
17
|
-
* Gets a list of tenants available to the user.
|
|
18
|
-
* Use {@link isSignedIn} to check if the user is signed in to a particular tenant.
|
|
19
|
-
*
|
|
20
|
-
* @returns A list of tenants.
|
|
21
|
-
*/
|
|
22
|
-
getTenants(): Promise<TenantIdDescription[]>;
|
|
23
|
-
/**
|
|
24
|
-
* Gets a list of Azure subscriptions available to the user.
|
|
25
|
-
*
|
|
26
|
-
* @param filter - Whether to filter the list returned, according to the list returned
|
|
27
|
-
* by `getTenantFilters()` and `getSubscriptionFilters()`. Optional, default true.
|
|
28
|
-
*
|
|
29
|
-
* @returns A list of Azure subscriptions.
|
|
30
|
-
*
|
|
31
|
-
* @throws A {@link NotSignedInError} If the user is not signed in to Azure.
|
|
32
|
-
* Use {@link isSignedIn} and/or {@link signIn} before this method to ensure
|
|
33
|
-
* the user is signed in.
|
|
34
|
-
*/
|
|
35
|
-
getSubscriptions(filter?: boolean): Promise<AzureSubscription[]>;
|
|
36
|
-
/**
|
|
37
|
-
* Checks to see if a user is signed in.
|
|
38
|
-
*
|
|
39
|
-
* @param tenantId (Optional) Provide to check if a user is signed in to a specific tenant.
|
|
40
|
-
*
|
|
41
|
-
* @returns True if the user is signed in, false otherwise.
|
|
42
|
-
*/
|
|
43
|
-
isSignedIn(tenantId?: string): Promise<boolean>;
|
|
44
|
-
/**
|
|
45
|
-
* Asks the user to sign in or pick an account to use.
|
|
46
|
-
*
|
|
47
|
-
* @param tenantId (Optional) Provide to sign in to a specific tenant.
|
|
48
|
-
*
|
|
49
|
-
* @returns True if the user is signed in, false otherwise.
|
|
50
|
-
*/
|
|
51
|
-
signIn(tenantId?: string): Promise<boolean>;
|
|
52
|
-
/**
|
|
53
|
-
* An event that is fired when the user signs in. Debounced to fire at most once every 5 seconds.
|
|
54
|
-
*/
|
|
55
|
-
readonly onDidSignIn: vscode.Event<void>;
|
|
56
|
-
/**
|
|
57
|
-
* Signs the user out
|
|
58
|
-
*
|
|
59
|
-
* @deprecated Not currently supported by VS Code auth providers
|
|
60
|
-
*/
|
|
61
|
-
signOut(): Promise<void>;
|
|
62
|
-
/**
|
|
63
|
-
* An event that is fired when the user signs out. Debounced to fire at most once every 5 seconds.
|
|
64
|
-
*/
|
|
65
|
-
readonly onDidSignOut: vscode.Event<void>;
|
|
66
|
-
/**
|
|
67
|
-
* Gets the tenant filters that are configured in `azureResourceGroups.selectedSubscriptions`. To
|
|
68
|
-
* override the settings with a custom filter, implement a child class with `getSubscriptionFilters()`
|
|
69
|
-
* and/or `getTenantFilters()` overridden.
|
|
70
|
-
*
|
|
71
|
-
* If no values are returned by `getTenantFilters()`, then all tenants will be scanned for subscriptions.
|
|
72
|
-
*
|
|
73
|
-
* @returns A list of tenant IDs that are configured in `azureResourceGroups.selectedSubscriptions`.
|
|
74
|
-
*/
|
|
75
|
-
protected getTenantFilters(): Promise<TenantId[]>;
|
|
76
|
-
/**
|
|
77
|
-
* Gets the subscription filters that are configured in `azureResourceGroups.selectedSubscriptions`. To
|
|
78
|
-
* override the settings with a custom filter, implement a child class with `getSubscriptionFilters()`
|
|
79
|
-
* and/or `getTenantFilters()` overridden.
|
|
80
|
-
*
|
|
81
|
-
* If no values are returned by `getSubscriptionFilters()`, then all subscriptions will be returned.
|
|
82
|
-
*
|
|
83
|
-
* @returns A list of subscription IDs that are configured in `azureResourceGroups.selectedSubscriptions`.
|
|
84
|
-
*/
|
|
85
|
-
protected getSubscriptionFilters(): Promise<SubscriptionId[]>;
|
|
86
|
-
/**
|
|
87
|
-
* Gets the subscriptions for a given tenant.
|
|
88
|
-
*
|
|
89
|
-
* @param tenantId The tenant ID to get subscriptions for.
|
|
90
|
-
*
|
|
91
|
-
* @returns The list of subscriptions for the tenant.
|
|
92
|
-
*/
|
|
93
|
-
private getSubscriptionsForTenant;
|
|
94
|
-
/**
|
|
95
|
-
* Gets a fully-configured subscription client for a given tenant ID
|
|
96
|
-
*
|
|
97
|
-
* @param tenantId (Optional) The tenant ID to get a client for
|
|
98
|
-
*
|
|
99
|
-
* @returns A client, the credential used by the client, and the authentication function
|
|
100
|
-
*/
|
|
101
|
-
private getSubscriptionClient;
|
|
102
|
-
}
|
|
1
|
+
import type { TenantIdDescription } from '@azure/arm-resources-subscriptions';
|
|
2
|
+
import * as vscode from 'vscode';
|
|
3
|
+
import type { AzureSubscription, SubscriptionId, TenantId } from './AzureSubscription';
|
|
4
|
+
import type { AzureSubscriptionProvider } from './AzureSubscriptionProvider';
|
|
5
|
+
/**
|
|
6
|
+
* A class for obtaining Azure subscription information using VSCode's built-in authentication
|
|
7
|
+
* provider.
|
|
8
|
+
*/
|
|
9
|
+
export declare class VSCodeAzureSubscriptionProvider extends vscode.Disposable implements AzureSubscriptionProvider {
|
|
10
|
+
private readonly onDidSignInEmitter;
|
|
11
|
+
private lastSignInEventFired;
|
|
12
|
+
private suppressSignInEvents;
|
|
13
|
+
private readonly onDidSignOutEmitter;
|
|
14
|
+
private lastSignOutEventFired;
|
|
15
|
+
constructor();
|
|
16
|
+
/**
|
|
17
|
+
* Gets a list of tenants available to the user.
|
|
18
|
+
* Use {@link isSignedIn} to check if the user is signed in to a particular tenant.
|
|
19
|
+
*
|
|
20
|
+
* @returns A list of tenants.
|
|
21
|
+
*/
|
|
22
|
+
getTenants(): Promise<TenantIdDescription[]>;
|
|
23
|
+
/**
|
|
24
|
+
* Gets a list of Azure subscriptions available to the user.
|
|
25
|
+
*
|
|
26
|
+
* @param filter - Whether to filter the list returned, according to the list returned
|
|
27
|
+
* by `getTenantFilters()` and `getSubscriptionFilters()`. Optional, default true.
|
|
28
|
+
*
|
|
29
|
+
* @returns A list of Azure subscriptions.
|
|
30
|
+
*
|
|
31
|
+
* @throws A {@link NotSignedInError} If the user is not signed in to Azure.
|
|
32
|
+
* Use {@link isSignedIn} and/or {@link signIn} before this method to ensure
|
|
33
|
+
* the user is signed in.
|
|
34
|
+
*/
|
|
35
|
+
getSubscriptions(filter?: boolean): Promise<AzureSubscription[]>;
|
|
36
|
+
/**
|
|
37
|
+
* Checks to see if a user is signed in.
|
|
38
|
+
*
|
|
39
|
+
* @param tenantId (Optional) Provide to check if a user is signed in to a specific tenant.
|
|
40
|
+
*
|
|
41
|
+
* @returns True if the user is signed in, false otherwise.
|
|
42
|
+
*/
|
|
43
|
+
isSignedIn(tenantId?: string): Promise<boolean>;
|
|
44
|
+
/**
|
|
45
|
+
* Asks the user to sign in or pick an account to use.
|
|
46
|
+
*
|
|
47
|
+
* @param tenantId (Optional) Provide to sign in to a specific tenant.
|
|
48
|
+
*
|
|
49
|
+
* @returns True if the user is signed in, false otherwise.
|
|
50
|
+
*/
|
|
51
|
+
signIn(tenantId?: string): Promise<boolean>;
|
|
52
|
+
/**
|
|
53
|
+
* An event that is fired when the user signs in. Debounced to fire at most once every 5 seconds.
|
|
54
|
+
*/
|
|
55
|
+
readonly onDidSignIn: vscode.Event<void>;
|
|
56
|
+
/**
|
|
57
|
+
* Signs the user out
|
|
58
|
+
*
|
|
59
|
+
* @deprecated Not currently supported by VS Code auth providers
|
|
60
|
+
*/
|
|
61
|
+
signOut(): Promise<void>;
|
|
62
|
+
/**
|
|
63
|
+
* An event that is fired when the user signs out. Debounced to fire at most once every 5 seconds.
|
|
64
|
+
*/
|
|
65
|
+
readonly onDidSignOut: vscode.Event<void>;
|
|
66
|
+
/**
|
|
67
|
+
* Gets the tenant filters that are configured in `azureResourceGroups.selectedSubscriptions`. To
|
|
68
|
+
* override the settings with a custom filter, implement a child class with `getSubscriptionFilters()`
|
|
69
|
+
* and/or `getTenantFilters()` overridden.
|
|
70
|
+
*
|
|
71
|
+
* If no values are returned by `getTenantFilters()`, then all tenants will be scanned for subscriptions.
|
|
72
|
+
*
|
|
73
|
+
* @returns A list of tenant IDs that are configured in `azureResourceGroups.selectedSubscriptions`.
|
|
74
|
+
*/
|
|
75
|
+
protected getTenantFilters(): Promise<TenantId[]>;
|
|
76
|
+
/**
|
|
77
|
+
* Gets the subscription filters that are configured in `azureResourceGroups.selectedSubscriptions`. To
|
|
78
|
+
* override the settings with a custom filter, implement a child class with `getSubscriptionFilters()`
|
|
79
|
+
* and/or `getTenantFilters()` overridden.
|
|
80
|
+
*
|
|
81
|
+
* If no values are returned by `getSubscriptionFilters()`, then all subscriptions will be returned.
|
|
82
|
+
*
|
|
83
|
+
* @returns A list of subscription IDs that are configured in `azureResourceGroups.selectedSubscriptions`.
|
|
84
|
+
*/
|
|
85
|
+
protected getSubscriptionFilters(): Promise<SubscriptionId[]>;
|
|
86
|
+
/**
|
|
87
|
+
* Gets the subscriptions for a given tenant.
|
|
88
|
+
*
|
|
89
|
+
* @param tenantId The tenant ID to get subscriptions for.
|
|
90
|
+
*
|
|
91
|
+
* @returns The list of subscriptions for the tenant.
|
|
92
|
+
*/
|
|
93
|
+
private getSubscriptionsForTenant;
|
|
94
|
+
/**
|
|
95
|
+
* Gets a fully-configured subscription client for a given tenant ID
|
|
96
|
+
*
|
|
97
|
+
* @param tenantId (Optional) The tenant ID to get a client for
|
|
98
|
+
*
|
|
99
|
+
* @returns A client, the credential used by the client, and the authentication function
|
|
100
|
+
*/
|
|
101
|
+
private getSubscriptionClient;
|
|
102
|
+
}
|