@microsoft/vscode-azext-azureauth 2.5.0 → 3.0.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 +24 -0
- package/out/src/AzureAuthentication.d.ts +1 -1
- package/out/src/AzureDevOpsSubscriptionProvider.js +4 -0
- package/out/src/AzureSubscription.d.ts +6 -1
- package/out/src/AzureSubscriptionProvider.d.ts +4 -2
- package/out/src/VSCodeAzureSubscriptionProvider.d.ts +7 -3
- package/out/src/VSCodeAzureSubscriptionProvider.js +59 -32
- package/out/src/getSessionFromVSCode.js +1 -1
- package/package.json +2 -2
- package/out/src/signInToTenants.d.ts +0 -6
- package/out/src/signInToTenants.js +0 -57
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 3.0.0 - 2024-09-19
|
|
4
|
+
* [#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
|
+
|
|
6
|
+
## 2.5.0 - 2024-08-06
|
|
7
|
+
|
|
8
|
+
* Add `getSessionWithScopes` to get a session that has the proper scoping instead of always the default management plane
|
|
9
|
+
|
|
10
|
+
## 2.4.1 - 2024-05-15
|
|
11
|
+
|
|
12
|
+
* [#1729](https://github.com/microsoft/vscode-azuretools/pull/1729) Change AzureDevOpsSubscriptionProvider so that it accepts values as arguments
|
|
13
|
+
|
|
14
|
+
## 2.4.0 - 2024-05-07
|
|
15
|
+
|
|
16
|
+
* [#1723](https://github.com/microsoft/vscode-azuretools/pull/1723) Implementation fo AzureSub provider that leverages federated credentials
|
|
17
|
+
|
|
18
|
+
## 2.1.0 - 2023-12-13
|
|
19
|
+
|
|
20
|
+
* Use management endpoint for scope by default to fix deploying app service projects with sovereign clouds
|
|
21
|
+
|
|
22
|
+
## 2.0.0 - 2023-11-20
|
|
23
|
+
|
|
24
|
+
* Switches to use `@azure/arm-resources-subscriptions` instead of `@azure/arm-subscriptions`. Potentially a breaking change so I revved the major version.
|
|
25
|
+
* Fixes an issue where the `endpoint` wasn't set for the subscription client, breaking sovereign clouds
|
|
26
|
+
|
|
3
27
|
## 1.4.0 - 2023-11-03
|
|
4
28
|
* [#1619](https://github.com/microsoft/vscode-azuretools/pull/1619) Make `getSession` synchronous to fix an issue that broke app service deployments
|
|
5
29
|
|
|
@@ -5,7 +5,7 @@ import type * as vscode from 'vscode';
|
|
|
5
5
|
export interface AzureAuthentication {
|
|
6
6
|
/**
|
|
7
7
|
* Gets a VS Code authentication session for an Azure subscription.
|
|
8
|
-
* Always uses the default scope, `https://management.azure.com/.default
|
|
8
|
+
* Always uses the default scope, `https://management.azure.com/.default/` and respects `microsoft-sovereign-cloud.environment` setting.
|
|
9
9
|
*
|
|
10
10
|
* @returns A VS Code authentication session or undefined, if none could be obtained.
|
|
11
11
|
*/
|
|
@@ -119,6 +119,10 @@ class AzureDevOpsSubscriptionProvider {
|
|
|
119
119
|
subscriptionId: subscription.subscriptionId,
|
|
120
120
|
/* eslint-enable @typescript-eslint/no-non-null-assertion */
|
|
121
121
|
tenantId,
|
|
122
|
+
account: {
|
|
123
|
+
id: "test-account-id",
|
|
124
|
+
label: "test-account",
|
|
125
|
+
},
|
|
122
126
|
});
|
|
123
127
|
}
|
|
124
128
|
finally {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { TokenCredential } from '@azure/core-auth';
|
|
2
2
|
import type { Environment } from '@azure/ms-rest-azure-env';
|
|
3
|
-
import
|
|
3
|
+
import * as vscode from "vscode";
|
|
4
|
+
import { AzureAuthentication } from './AzureAuthentication';
|
|
4
5
|
/**
|
|
5
6
|
* A type representing an Azure subscription ID, not including the tenant ID.
|
|
6
7
|
*/
|
|
@@ -41,4 +42,8 @@ export interface AzureSubscription {
|
|
|
41
42
|
* The credential for authentication to this subscription. Compatible with Azure track 2 SDKs.
|
|
42
43
|
*/
|
|
43
44
|
readonly credential: TokenCredential;
|
|
45
|
+
/**
|
|
46
|
+
* The account associated with this subscription.
|
|
47
|
+
*/
|
|
48
|
+
readonly account: vscode.AuthenticationSessionAccountInformation;
|
|
44
49
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { TenantIdDescription } from '@azure/arm-resources-subscriptions';
|
|
1
2
|
import type * as vscode from 'vscode';
|
|
2
3
|
import type { AzureSubscription } from './AzureSubscription';
|
|
3
|
-
import type { TenantIdDescription } from '@azure/arm-resources-subscriptions';
|
|
4
4
|
/**
|
|
5
5
|
* An interface for obtaining Azure subscription information
|
|
6
6
|
*/
|
|
@@ -9,9 +9,11 @@ export interface AzureSubscriptionProvider {
|
|
|
9
9
|
* Gets a list of tenants available to the user.
|
|
10
10
|
* Use {@link isSignedIn} to check if the user is signed in to a particular tenant.
|
|
11
11
|
*
|
|
12
|
+
* @param account - Optionally pass in a specific account to get tenants for.
|
|
13
|
+
*
|
|
12
14
|
* @returns A list of tenants.
|
|
13
15
|
*/
|
|
14
|
-
getTenants(): Promise<TenantIdDescription[]>;
|
|
16
|
+
getTenants(account?: vscode.AuthenticationSessionAccountInformation): Promise<TenantIdDescription[]>;
|
|
15
17
|
/**
|
|
16
18
|
* Gets a list of Azure subscriptions available to the user.
|
|
17
19
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { TenantIdDescription } from '@azure/arm-resources-subscriptions';
|
|
2
2
|
import * as vscode from 'vscode';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import { AzureSubscription, SubscriptionId, TenantId } from './AzureSubscription';
|
|
4
|
+
import { AzureSubscriptionProvider } from './AzureSubscriptionProvider';
|
|
5
5
|
/**
|
|
6
6
|
* A class for obtaining Azure subscription information using VSCode's built-in authentication
|
|
7
7
|
* provider.
|
|
@@ -17,9 +17,11 @@ export declare class VSCodeAzureSubscriptionProvider extends vscode.Disposable i
|
|
|
17
17
|
* Gets a list of tenants available to the user.
|
|
18
18
|
* Use {@link isSignedIn} to check if the user is signed in to a particular tenant.
|
|
19
19
|
*
|
|
20
|
+
* @param account (Optional) A specific account to get tenants for. If not provided, all accounts will be used.
|
|
21
|
+
*
|
|
20
22
|
* @returns A list of tenants.
|
|
21
23
|
*/
|
|
22
|
-
getTenants(): Promise<TenantIdDescription[]>;
|
|
24
|
+
getTenants(account?: vscode.AuthenticationSessionAccountInformation): Promise<TenantIdDescription[]>;
|
|
23
25
|
/**
|
|
24
26
|
* Gets a list of Azure subscriptions available to the user.
|
|
25
27
|
*
|
|
@@ -87,6 +89,7 @@ export declare class VSCodeAzureSubscriptionProvider extends vscode.Disposable i
|
|
|
87
89
|
* Gets the subscriptions for a given tenant.
|
|
88
90
|
*
|
|
89
91
|
* @param tenantId The tenant ID to get subscriptions for.
|
|
92
|
+
* @param account The account to get the subscriptions for.
|
|
90
93
|
*
|
|
91
94
|
* @returns The list of subscriptions for the tenant.
|
|
92
95
|
*/
|
|
@@ -95,6 +98,7 @@ export declare class VSCodeAzureSubscriptionProvider extends vscode.Disposable i
|
|
|
95
98
|
* Gets a fully-configured subscription client for a given tenant ID
|
|
96
99
|
*
|
|
97
100
|
* @param tenantId (Optional) The tenant ID to get a client for
|
|
101
|
+
* @param account The account that you would like to get the session for
|
|
98
102
|
*
|
|
99
103
|
* @returns A client, the credential used by the client, and the authentication function
|
|
100
104
|
*/
|
|
@@ -22,8 +22,8 @@ var __asyncValues = (this && this.__asyncValues) || function (o) {
|
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
23
|
exports.VSCodeAzureSubscriptionProvider = void 0;
|
|
24
24
|
const vscode = require("vscode");
|
|
25
|
-
const NotSignedInError_1 = require("./NotSignedInError");
|
|
26
25
|
const getSessionFromVSCode_1 = require("./getSessionFromVSCode");
|
|
26
|
+
const NotSignedInError_1 = require("./NotSignedInError");
|
|
27
27
|
const configuredAzureEnv_1 = require("./utils/configuredAzureEnv");
|
|
28
28
|
const EventDebounce = 5 * 1000; // 5 seconds
|
|
29
29
|
/**
|
|
@@ -71,30 +71,51 @@ class VSCodeAzureSubscriptionProvider extends vscode.Disposable {
|
|
|
71
71
|
* Gets a list of tenants available to the user.
|
|
72
72
|
* Use {@link isSignedIn} to check if the user is signed in to a particular tenant.
|
|
73
73
|
*
|
|
74
|
+
* @param account (Optional) A specific account to get tenants for. If not provided, all accounts will be used.
|
|
75
|
+
*
|
|
74
76
|
* @returns A list of tenants.
|
|
75
77
|
*/
|
|
76
|
-
getTenants() {
|
|
77
|
-
var _a, e_1, _b, _c;
|
|
78
|
+
getTenants(account) {
|
|
79
|
+
var _a, e_1, _b, _c, _d, e_2, _e, _f;
|
|
78
80
|
return __awaiter(this, void 0, void 0, function* () {
|
|
79
|
-
const { client } = yield this.getSubscriptionClient();
|
|
80
81
|
const results = [];
|
|
81
82
|
try {
|
|
82
|
-
for (var
|
|
83
|
-
_c =
|
|
84
|
-
|
|
83
|
+
for (var _g = true, _h = __asyncValues(account ? [account] : yield vscode.authentication.getAccounts((0, configuredAzureEnv_1.getConfiguredAuthProviderId)())), _j; _j = yield _h.next(), _a = _j.done, !_a;) {
|
|
84
|
+
_c = _j.value;
|
|
85
|
+
_g = false;
|
|
85
86
|
try {
|
|
86
|
-
|
|
87
|
-
|
|
87
|
+
account = _c;
|
|
88
|
+
const { client } = yield this.getSubscriptionClient(account, undefined, undefined);
|
|
89
|
+
try {
|
|
90
|
+
for (var _k = true, _l = (e_2 = void 0, __asyncValues(client.tenants.list())), _m; _m = yield _l.next(), _d = _m.done, !_d;) {
|
|
91
|
+
_f = _m.value;
|
|
92
|
+
_k = false;
|
|
93
|
+
try {
|
|
94
|
+
const tenant = _f;
|
|
95
|
+
results.push(tenant);
|
|
96
|
+
}
|
|
97
|
+
finally {
|
|
98
|
+
_k = true;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
103
|
+
finally {
|
|
104
|
+
try {
|
|
105
|
+
if (!_k && !_d && (_e = _l.return)) yield _e.call(_l);
|
|
106
|
+
}
|
|
107
|
+
finally { if (e_2) throw e_2.error; }
|
|
108
|
+
}
|
|
88
109
|
}
|
|
89
110
|
finally {
|
|
90
|
-
|
|
111
|
+
_g = true;
|
|
91
112
|
}
|
|
92
113
|
}
|
|
93
114
|
}
|
|
94
115
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
95
116
|
finally {
|
|
96
117
|
try {
|
|
97
|
-
if (!
|
|
118
|
+
if (!_g && !_a && (_b = _h.return)) yield _b.call(_h);
|
|
98
119
|
}
|
|
99
120
|
finally { if (e_1) throw e_1.error; }
|
|
100
121
|
}
|
|
@@ -120,20 +141,23 @@ class VSCodeAzureSubscriptionProvider extends vscode.Disposable {
|
|
|
120
141
|
const results = [];
|
|
121
142
|
try {
|
|
122
143
|
this.suppressSignInEvents = true;
|
|
123
|
-
// Get the list of tenants
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
144
|
+
// Get the list of tenants from each account
|
|
145
|
+
const accounts = yield vscode.authentication.getAccounts((0, configuredAzureEnv_1.getConfiguredAuthProviderId)());
|
|
146
|
+
for (const account of accounts) {
|
|
147
|
+
for (const tenant of yield this.getTenants(account)) {
|
|
148
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
149
|
+
const tenantId = tenant.tenantId;
|
|
150
|
+
// If filtering is enabled, and the current tenant is not in that list, then skip it
|
|
151
|
+
if (shouldFilterTenants && !tenantIds.includes(tenantId)) {
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
// If the user is not signed in to this tenant, then skip it
|
|
155
|
+
if (!(yield this.isSignedIn(tenantId))) {
|
|
156
|
+
continue;
|
|
157
|
+
}
|
|
158
|
+
// For each tenant, get the list of subscriptions
|
|
159
|
+
results.push(...yield this.getSubscriptionsForTenant(tenantId, account));
|
|
134
160
|
}
|
|
135
|
-
// For each tenant, get the list of subscriptions
|
|
136
|
-
results.push(...yield this.getSubscriptionsForTenant(tenantId));
|
|
137
161
|
}
|
|
138
162
|
}
|
|
139
163
|
finally {
|
|
@@ -217,13 +241,14 @@ class VSCodeAzureSubscriptionProvider extends vscode.Disposable {
|
|
|
217
241
|
* Gets the subscriptions for a given tenant.
|
|
218
242
|
*
|
|
219
243
|
* @param tenantId The tenant ID to get subscriptions for.
|
|
244
|
+
* @param account The account to get the subscriptions for.
|
|
220
245
|
*
|
|
221
246
|
* @returns The list of subscriptions for the tenant.
|
|
222
247
|
*/
|
|
223
|
-
getSubscriptionsForTenant(tenantId) {
|
|
224
|
-
var _a,
|
|
248
|
+
getSubscriptionsForTenant(tenantId, account) {
|
|
249
|
+
var _a, e_3, _b, _c;
|
|
225
250
|
return __awaiter(this, void 0, void 0, function* () {
|
|
226
|
-
const { client, credential, authentication } = yield this.getSubscriptionClient(tenantId);
|
|
251
|
+
const { client, credential, authentication } = yield this.getSubscriptionClient(account, tenantId, undefined);
|
|
227
252
|
const environment = (0, configuredAzureEnv_1.getConfiguredAzureEnv)();
|
|
228
253
|
const subscriptions = [];
|
|
229
254
|
try {
|
|
@@ -242,6 +267,7 @@ class VSCodeAzureSubscriptionProvider extends vscode.Disposable {
|
|
|
242
267
|
subscriptionId: subscription.subscriptionId,
|
|
243
268
|
/* eslint-enable @typescript-eslint/no-non-null-assertion */
|
|
244
269
|
tenantId: tenantId,
|
|
270
|
+
account: account
|
|
245
271
|
});
|
|
246
272
|
}
|
|
247
273
|
finally {
|
|
@@ -249,12 +275,12 @@ class VSCodeAzureSubscriptionProvider extends vscode.Disposable {
|
|
|
249
275
|
}
|
|
250
276
|
}
|
|
251
277
|
}
|
|
252
|
-
catch (
|
|
278
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
253
279
|
finally {
|
|
254
280
|
try {
|
|
255
281
|
if (!_d && !_a && (_b = _e.return)) yield _b.call(_e);
|
|
256
282
|
}
|
|
257
|
-
finally { if (
|
|
283
|
+
finally { if (e_3) throw e_3.error; }
|
|
258
284
|
}
|
|
259
285
|
return subscriptions;
|
|
260
286
|
});
|
|
@@ -263,13 +289,14 @@ class VSCodeAzureSubscriptionProvider extends vscode.Disposable {
|
|
|
263
289
|
* Gets a fully-configured subscription client for a given tenant ID
|
|
264
290
|
*
|
|
265
291
|
* @param tenantId (Optional) The tenant ID to get a client for
|
|
292
|
+
* @param account The account that you would like to get the session for
|
|
266
293
|
*
|
|
267
294
|
* @returns A client, the credential used by the client, and the authentication function
|
|
268
295
|
*/
|
|
269
|
-
getSubscriptionClient(tenantId, scopes) {
|
|
296
|
+
getSubscriptionClient(account, tenantId, scopes) {
|
|
270
297
|
return __awaiter(this, void 0, void 0, function* () {
|
|
271
298
|
const armSubs = yield Promise.resolve().then(() => require('@azure/arm-resources-subscriptions'));
|
|
272
|
-
const session = yield (0, getSessionFromVSCode_1.getSessionFromVSCode)(scopes, tenantId, { createIfNone: false, silent: true });
|
|
299
|
+
const session = yield (0, getSessionFromVSCode_1.getSessionFromVSCode)(scopes, tenantId, { createIfNone: false, silent: true, account });
|
|
273
300
|
if (!session) {
|
|
274
301
|
throw new NotSignedInError_1.NotSignedInError();
|
|
275
302
|
}
|
|
@@ -289,7 +316,7 @@ class VSCodeAzureSubscriptionProvider extends vscode.Disposable {
|
|
|
289
316
|
authentication: {
|
|
290
317
|
getSession: () => session,
|
|
291
318
|
getSessionWithScopes: (scopes) => {
|
|
292
|
-
return (0, getSessionFromVSCode_1.getSessionFromVSCode)(scopes, tenantId, { createIfNone: false, silent: true });
|
|
319
|
+
return (0, getSessionFromVSCode_1.getSessionFromVSCode)(scopes, tenantId, { createIfNone: false, silent: true, account });
|
|
293
320
|
},
|
|
294
321
|
}
|
|
295
322
|
};
|
|
@@ -14,8 +14,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
14
14
|
};
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.getSessionFromVSCode = void 0;
|
|
17
|
-
const configuredAzureEnv_1 = require("./utils/configuredAzureEnv");
|
|
18
17
|
const vscode = require("vscode");
|
|
18
|
+
const configuredAzureEnv_1 = require("./utils/configuredAzureEnv");
|
|
19
19
|
function ensureEndingSlash(value) {
|
|
20
20
|
return value.endsWith('/') ? value : `${value}/`;
|
|
21
21
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/vscode-azext-azureauth",
|
|
3
3
|
"author": "Microsoft Corporation",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "3.0.0",
|
|
5
5
|
"description": "Azure authentication helpers for Visual Studio Code",
|
|
6
6
|
"tags": [
|
|
7
7
|
"azure",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"@types/node-fetch": "2.6.7",
|
|
42
42
|
"@types/semver": "^7.3.9",
|
|
43
43
|
"@types/uuid": "^9.0.1",
|
|
44
|
-
"@types/vscode": "1.
|
|
44
|
+
"@types/vscode": "1.93.0",
|
|
45
45
|
"@typescript-eslint/eslint-plugin": "^5.53.0",
|
|
46
46
|
"@vscode/test-electron": "^2.3.8",
|
|
47
47
|
"eslint": "^8.34.0",
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { AzureSubscriptionProvider } from "./AzureSubscriptionProvider";
|
|
2
|
-
/**
|
|
3
|
-
* Prompts user to select from a list of unauthenticated tenants.
|
|
4
|
-
* Once selected, requests a new session from VS Code specifially for this tenant.
|
|
5
|
-
*/
|
|
6
|
-
export declare function signInToTenant(subscriptionProvider: AzureSubscriptionProvider): Promise<void>;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
7
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
8
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
9
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
10
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
11
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
12
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
13
|
-
});
|
|
14
|
-
};
|
|
15
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.signInToTenant = void 0;
|
|
17
|
-
const vscode = require("vscode");
|
|
18
|
-
const getUnauthenticatedTenants_1 = require("./utils/getUnauthenticatedTenants");
|
|
19
|
-
/**
|
|
20
|
-
* Prompts user to select from a list of unauthenticated tenants.
|
|
21
|
-
* Once selected, requests a new session from VS Code specifially for this tenant.
|
|
22
|
-
*/
|
|
23
|
-
function signInToTenant(subscriptionProvider) {
|
|
24
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
-
const tenantId = yield pickTenant(subscriptionProvider);
|
|
26
|
-
if (tenantId) {
|
|
27
|
-
yield subscriptionProvider.signIn(tenantId);
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
exports.signInToTenant = signInToTenant;
|
|
32
|
-
function pickTenant(subscriptionProvider) {
|
|
33
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
-
const pick = yield vscode.window.showQuickPick(getPicks(subscriptionProvider), {
|
|
35
|
-
placeHolder: 'Select Directory to Sign In To',
|
|
36
|
-
matchOnDescription: true,
|
|
37
|
-
ignoreFocusOut: true,
|
|
38
|
-
});
|
|
39
|
-
return pick === null || pick === void 0 ? void 0 : pick.tenant.tenantId;
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
function getPicks(subscriptionProvider) {
|
|
43
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
-
const unauthenticatedTenants = yield (0, getUnauthenticatedTenants_1.getUnauthenticatedTenants)(subscriptionProvider);
|
|
45
|
-
const picks = unauthenticatedTenants.map(tenant => {
|
|
46
|
-
var _a, _b, _c;
|
|
47
|
-
return ({
|
|
48
|
-
label: (_a = tenant.displayName) !== null && _a !== void 0 ? _a : '',
|
|
49
|
-
description: (_b = tenant.tenantId) !== null && _b !== void 0 ? _b : '',
|
|
50
|
-
detail: (_c = tenant.defaultDomain) !== null && _c !== void 0 ? _c : '',
|
|
51
|
-
tenant,
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
return picks;
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
//# sourceMappingURL=signInToTenants.js.map
|