@microsoft/vscode-azext-azureauth 3.0.0 → 3.0.1
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
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 3.0.1 - 2024-11-19
|
|
4
|
+
* [#1819](https://github.com/microsoft/vscode-azuretools/pull/1819) Add account parameter to `AzureSubscriptionProvider.isSignedIn()` function to fix a multi-account issue [#1809](https://github.com/microsoft/vscode-azuretools/issues/1809)
|
|
5
|
+
* [#1822](https://github.com/microsoft/vscode-azuretools/pull/1822) Add check in `VSCodeAzureSubscriptionProvider.getTenants()` to fix a multi-account issue [#1809](https://github.com/microsoft/vscode-azuretools/issues/1809)
|
|
6
|
+
|
|
3
7
|
## 3.0.0 - 2024-09-19
|
|
4
8
|
* [#1789](https://github.com/microsoft/vscode-azuretools/pull/1789) Change `getTenants` to be compatible with the new Azure Resources tenants view. This also includes a possible breaking change where an optional parameter `account` which when passed in `getTenants` will return the tenants associated with that single account. Otherwise `getTenants` will return the tenants for all authenticated accounts.
|
|
5
9
|
|
|
@@ -34,7 +34,7 @@ export interface AzureSubscriptionProvider {
|
|
|
34
34
|
*
|
|
35
35
|
* @returns True if the user is signed in, false otherwise.
|
|
36
36
|
*/
|
|
37
|
-
isSignedIn(tenantId?: string): Promise<boolean>;
|
|
37
|
+
isSignedIn(tenantId?: string, account?: vscode.AuthenticationSessionAccountInformation): Promise<boolean>;
|
|
38
38
|
/**
|
|
39
39
|
* Asks the user to sign in or pick an account to use.
|
|
40
40
|
*
|
|
@@ -42,7 +42,7 @@ export declare class VSCodeAzureSubscriptionProvider extends vscode.Disposable i
|
|
|
42
42
|
*
|
|
43
43
|
* @returns True if the user is signed in, false otherwise.
|
|
44
44
|
*/
|
|
45
|
-
isSignedIn(tenantId?: string): Promise<boolean>;
|
|
45
|
+
isSignedIn(tenantId?: string, account?: vscode.AuthenticationSessionAccountInformation): Promise<boolean>;
|
|
46
46
|
/**
|
|
47
47
|
* Asks the user to sign in or pick an account to use.
|
|
48
48
|
*
|
|
@@ -85,26 +85,29 @@ class VSCodeAzureSubscriptionProvider extends vscode.Disposable {
|
|
|
85
85
|
_g = false;
|
|
86
86
|
try {
|
|
87
87
|
account = _c;
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
_k =
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
88
|
+
// Added check. Without this the getSubscriptionClient function throws the NotSignedInError
|
|
89
|
+
if (yield this.isSignedIn(undefined, account)) {
|
|
90
|
+
const { client } = yield this.getSubscriptionClient(account, undefined, undefined);
|
|
91
|
+
try {
|
|
92
|
+
for (var _k = true, _l = (e_2 = void 0, __asyncValues(client.tenants.list())), _m; _m = yield _l.next(), _d = _m.done, !_d;) {
|
|
93
|
+
_f = _m.value;
|
|
94
|
+
_k = false;
|
|
95
|
+
try {
|
|
96
|
+
const tenant = _f;
|
|
97
|
+
results.push(tenant);
|
|
98
|
+
}
|
|
99
|
+
finally {
|
|
100
|
+
_k = true;
|
|
101
|
+
}
|
|
99
102
|
}
|
|
100
103
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
105
|
+
finally {
|
|
106
|
+
try {
|
|
107
|
+
if (!_k && !_d && (_e = _l.return)) yield _e.call(_l);
|
|
108
|
+
}
|
|
109
|
+
finally { if (e_2) throw e_2.error; }
|
|
106
110
|
}
|
|
107
|
-
finally { if (e_2) throw e_2.error; }
|
|
108
111
|
}
|
|
109
112
|
}
|
|
110
113
|
finally {
|
|
@@ -152,7 +155,7 @@ class VSCodeAzureSubscriptionProvider extends vscode.Disposable {
|
|
|
152
155
|
continue;
|
|
153
156
|
}
|
|
154
157
|
// If the user is not signed in to this tenant, then skip it
|
|
155
|
-
if (!(yield this.isSignedIn(tenantId))) {
|
|
158
|
+
if (!(yield this.isSignedIn(tenantId, account))) {
|
|
156
159
|
continue;
|
|
157
160
|
}
|
|
158
161
|
// For each tenant, get the list of subscriptions
|
|
@@ -178,9 +181,9 @@ class VSCodeAzureSubscriptionProvider extends vscode.Disposable {
|
|
|
178
181
|
*
|
|
179
182
|
* @returns True if the user is signed in, false otherwise.
|
|
180
183
|
*/
|
|
181
|
-
isSignedIn(tenantId) {
|
|
184
|
+
isSignedIn(tenantId, account) {
|
|
182
185
|
return __awaiter(this, void 0, void 0, function* () {
|
|
183
|
-
const session = yield (0, getSessionFromVSCode_1.getSessionFromVSCode)([], tenantId, { createIfNone: false, silent: true });
|
|
186
|
+
const session = yield (0, getSessionFromVSCode_1.getSessionFromVSCode)([], tenantId, { createIfNone: false, silent: true, account });
|
|
184
187
|
return !!session;
|
|
185
188
|
});
|
|
186
189
|
}
|