azure-kusto-data 2.2.1 → 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.
Files changed (42) hide show
  1. package/.eslintignore +5 -0
  2. package/.eslintrc.js +247 -0
  3. package/.prettierignore +7 -0
  4. package/.prettierrc.json +5 -0
  5. package/README.md +22 -12
  6. package/example.js +3 -5
  7. package/index.js +0 -1
  8. package/index.js.map +1 -1
  9. package/package.json +63 -51
  10. package/source/client.d.ts +3 -3
  11. package/source/client.js +41 -28
  12. package/source/client.js.map +1 -1
  13. package/source/clientRequestProperties.d.ts +13 -2
  14. package/source/clientRequestProperties.js +11 -5
  15. package/source/clientRequestProperties.js.map +1 -1
  16. package/source/cloudSettings.js +2 -2
  17. package/source/cloudSettings.js.map +1 -1
  18. package/source/connectionBuilder.d.ts +22 -6
  19. package/source/connectionBuilder.js +120 -50
  20. package/source/connectionBuilder.js.map +1 -1
  21. package/source/errors.d.ts +6 -0
  22. package/source/errors.js +16 -0
  23. package/source/errors.js.map +1 -0
  24. package/source/models.d.ts +29 -5
  25. package/source/models.js +57 -20
  26. package/source/models.js.map +1 -1
  27. package/source/response.d.ts +2 -2
  28. package/source/response.js +15 -13
  29. package/source/response.js.map +1 -1
  30. package/source/security.d.ts +2 -2
  31. package/source/security.js +31 -20
  32. package/source/security.js.map +1 -1
  33. package/source/tokenProvider.d.ts +62 -28
  34. package/source/tokenProvider.js +143 -61
  35. package/source/tokenProvider.js.map +1 -1
  36. package/source/typeUtilts.d.ts +3 -0
  37. package/source/typeUtilts.js +5 -0
  38. package/source/typeUtilts.js.map +1 -0
  39. package/tsconfig.json +16 -16
  40. package/tsconfig.tsbuildinfo +1579 -2247
  41. package/index.ts +0 -13
  42. package/tslint.json +0 -18
@@ -1,12 +1,15 @@
1
- import { AuthenticationResult, PublicClientApplication, ConfidentialClientApplication } from "@azure/msal-node";
1
+ import { ConfidentialClientApplication, PublicClientApplication } from "@azure/msal-node";
2
2
  import { DeviceCodeResponse } from "@azure/msal-common";
3
- import { AzureCliCredentials } from "@azure/ms-rest-nodeauth";
4
- import { ManagedIdentityCredential } from "@azure/identity";
5
3
  import { CloudInfo } from "./cloudSettings";
4
+ import { TokenCredential } from "@azure/core-auth";
6
5
  export declare type TokenResponse = {
7
6
  tokenType: string;
8
7
  accessToken: string;
9
8
  };
9
+ interface TokenType {
10
+ tokenType: string;
11
+ accessToken: string;
12
+ }
10
13
  /**
11
14
  * This base class abstracts token acquisition for all implementations.
12
15
  * The class is build for Lazy initialization, so that the first call, take on instantiation of 'heavy' long-lived class members
@@ -15,7 +18,8 @@ export declare abstract class TokenProviderBase {
15
18
  kustoUri: string;
16
19
  scopes: string[];
17
20
  abstract acquireToken(): Promise<TokenResponse>;
18
- constructor(kustoUri: string);
21
+ context(): Record<string, any>;
22
+ protected constructor(kustoUri: string);
19
23
  }
20
24
  /**
21
25
  * Basic Token Provider keeps and returns a token received on construction
@@ -33,31 +37,58 @@ export declare class CallbackTokenProvider extends TokenProviderBase {
33
37
  constructor(kustoUri: string, callback: () => Promise<string>);
34
38
  acquireToken(): Promise<TokenResponse>;
35
39
  }
36
- export declare class MsiTokenProvider extends TokenProviderBase {
37
- clientId?: string;
38
- managedIdentityCredential: ManagedIdentityCredential;
39
- constructor(kustoUri: string, clientId?: string);
40
- acquireToken(): Promise<TokenResponse>;
41
- }
42
- /**
43
- * AzCli Token Provider obtains a refresh token from the AzCli cache and uses it to authenticate with MSAL
44
- */
45
- export declare class AzCliTokenProvider extends TokenProviderBase {
46
- azureCliCredentials: AzureCliCredentials;
47
- constructor(kustoUri: string);
48
- acquireToken(): Promise<TokenResponse>;
49
- }
50
40
  /**
51
41
  * Acquire a token from MSAL
52
42
  */
53
43
  declare abstract class MsalTokenProvider extends TokenProviderBase {
54
44
  cloudInfo: CloudInfo;
55
- authorityId?: string;
45
+ authorityId: string;
56
46
  initialized: boolean;
47
+ authorityUri: string;
57
48
  abstract initClient(): void;
58
- abstract acquireMsalToken(): Promise<AuthenticationResult | null>;
59
- constructor(kustoUri: string, authorityId?: string);
49
+ abstract acquireMsalToken(): Promise<TokenType | null>;
50
+ protected constructor(kustoUri: string, authorityId: string);
60
51
  acquireToken(): Promise<TokenResponse>;
52
+ context(): Record<string, any>;
53
+ }
54
+ export declare abstract class AzureIdentityProvider extends MsalTokenProvider {
55
+ protected clientId?: string | undefined;
56
+ private timeoutMs?;
57
+ private credential;
58
+ protected authorityHost: string;
59
+ constructor(kustoUri: string, authorityId: string, clientId?: string | undefined, timeoutMs?: number | undefined);
60
+ initClient(): void;
61
+ getCommonOptions(): {
62
+ authorityHost: string;
63
+ clientId: string | undefined;
64
+ tenantId: string;
65
+ };
66
+ acquireMsalToken(): Promise<TokenType | null>;
67
+ context(): Record<string, any>;
68
+ abstract getCredential(): TokenCredential;
69
+ }
70
+ /**
71
+ * MSI Token Provider obtains a token from the MSI endpoint
72
+ * The args parameter is a dictionary conforming with the ManagedIdentityCredential initializer API arguments
73
+ */
74
+ export declare class MsiTokenProvider extends AzureIdentityProvider {
75
+ getCredential(): TokenCredential;
76
+ }
77
+ /**
78
+ * AzCli Token Provider obtains a refresh token from the AzCli cache and uses it to authenticate with MSAL
79
+ */
80
+ export declare class AzCliTokenProvider extends AzureIdentityProvider {
81
+ getCredential(): TokenCredential;
82
+ }
83
+ /**
84
+ * UserPromptProvider will pop up a login prompt to acquire a token.
85
+ */
86
+ export declare class UserPromptProvider extends AzureIdentityProvider {
87
+ private loginHint?;
88
+ readonly BrowserPort = 23145;
89
+ constructor(kustoUri: string, authorityId: string, clientId?: string, timeoutMs?: number, loginHint?: string | undefined);
90
+ getCredential(): TokenCredential;
91
+ context(): Record<string, any>;
61
92
  }
62
93
  /**
63
94
  * Acquire a token from MSAL with username and password
@@ -67,9 +98,10 @@ export declare class UserPassTokenProvider extends MsalTokenProvider {
67
98
  password: string;
68
99
  homeAccountId?: string;
69
100
  msalClient: PublicClientApplication;
70
- constructor(kustoUri: string, userName: string, password: string, authorityId?: string);
101
+ constructor(kustoUri: string, userName: string, password: string, authorityId: string);
71
102
  initClient(): void;
72
- acquireMsalToken(): Promise<AuthenticationResult | null>;
103
+ acquireMsalToken(): Promise<TokenType | null>;
104
+ context(): Record<string, any>;
73
105
  }
74
106
  /**
75
107
  * Acquire a token from MSAL with Device Login flow
@@ -78,9 +110,9 @@ export declare class DeviceLoginTokenProvider extends MsalTokenProvider {
78
110
  deviceCodeCallback: (response: DeviceCodeResponse) => void;
79
111
  homeAccountId?: string;
80
112
  msalClient: PublicClientApplication;
81
- constructor(kustoUri: string, deviceCodeCallback: (response: DeviceCodeResponse) => void, authorityId?: string);
113
+ constructor(kustoUri: string, deviceCodeCallback: (response: DeviceCodeResponse) => void, authorityId: string);
82
114
  initClient(): void;
83
- acquireMsalToken(): Promise<AuthenticationResult | null>;
115
+ acquireMsalToken(): Promise<TokenType | null>;
84
116
  }
85
117
  /**
86
118
  * Acquire a token from MSAL with application Id and Key
@@ -89,9 +121,10 @@ export declare class ApplicationKeyTokenProvider extends MsalTokenProvider {
89
121
  appClientId: string;
90
122
  appKey: string;
91
123
  msalClient: ConfidentialClientApplication;
92
- constructor(kustoUri: string, appClientId: string, appKey: string, authorityId?: string);
124
+ constructor(kustoUri: string, appClientId: string, appKey: string, authorityId: string);
93
125
  initClient(): void;
94
- acquireMsalToken(): Promise<AuthenticationResult | null>;
126
+ acquireMsalToken(): Promise<TokenType | null>;
127
+ context(): Record<string, any>;
95
128
  }
96
129
  /**
97
130
  * Acquire a token from MSAL using application certificate
@@ -105,6 +138,7 @@ export declare class ApplicationCertificateTokenProvider extends MsalTokenProvid
105
138
  msalClient: ConfidentialClientApplication;
106
139
  constructor(kustoUri: string, appClientId: string, certThumbprint: string, certPrivateKey: string, certX5c?: string, authorityId?: string);
107
140
  initClient(): void;
108
- acquireMsalToken(): Promise<AuthenticationResult | null>;
141
+ acquireMsalToken(): Promise<TokenType | null>;
142
+ context(): Record<string, any>;
109
143
  }
110
144
  export {};
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
+ // Copyright (c) Microsoft Corporation.
3
+ // Licensed under the MIT License.
2
4
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
5
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
6
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -9,11 +11,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
11
  });
10
12
  };
11
13
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.ApplicationCertificateTokenProvider = exports.ApplicationKeyTokenProvider = exports.DeviceLoginTokenProvider = exports.UserPassTokenProvider = exports.AzCliTokenProvider = exports.MsiTokenProvider = exports.CallbackTokenProvider = exports.BasicTokenProvider = exports.TokenProviderBase = void 0;
13
- // Copyright (c) Microsoft Corporation.
14
- // Licensed under the MIT License.
14
+ exports.ApplicationCertificateTokenProvider = exports.ApplicationKeyTokenProvider = exports.DeviceLoginTokenProvider = exports.UserPassTokenProvider = exports.UserPromptProvider = exports.AzCliTokenProvider = exports.MsiTokenProvider = exports.AzureIdentityProvider = exports.CallbackTokenProvider = exports.BasicTokenProvider = exports.TokenProviderBase = void 0;
15
+ /* eslint-disable max-classes-per-file -- We want all the Token Providers in this file */
15
16
  const msal_node_1 = require("@azure/msal-node");
16
- const ms_rest_nodeauth_1 = require("@azure/ms-rest-nodeauth");
17
17
  const identity_1 = require("@azure/identity");
18
18
  const cloudSettings_1 = require("./cloudSettings");
19
19
  const BEARER_TYPE = "Bearer";
@@ -25,10 +25,13 @@ class TokenProviderBase {
25
25
  constructor(kustoUri) {
26
26
  this.kustoUri = kustoUri;
27
27
  if (kustoUri != null) {
28
- const suffix = this.kustoUri.endsWith("/") ? ".default" : "/.default";
28
+ const suffix = (!this.kustoUri.endsWith("/") ? "/" : "") + ".default";
29
29
  this.scopes = [kustoUri + suffix];
30
30
  }
31
31
  }
32
+ context() {
33
+ return {};
34
+ }
32
35
  }
33
36
  exports.TokenProviderBase = TokenProviderBase;
34
37
  /**
@@ -40,7 +43,10 @@ class BasicTokenProvider extends TokenProviderBase {
40
43
  this.token = token;
41
44
  }
42
45
  acquireToken() {
43
- return Promise.resolve({ tokenType: BEARER_TYPE, accessToken: this.token });
46
+ return Promise.resolve({
47
+ tokenType: BEARER_TYPE,
48
+ accessToken: this.token,
49
+ });
44
50
  }
45
51
  }
46
52
  exports.BasicTokenProvider = BasicTokenProvider;
@@ -60,44 +66,6 @@ class CallbackTokenProvider extends TokenProviderBase {
60
66
  }
61
67
  }
62
68
  exports.CallbackTokenProvider = CallbackTokenProvider;
63
- // MSI Token Provider obtains a token from the MSI endpoint
64
- // The args parameter is a dictionary conforming with the ManagedIdentityCredential initializer API arguments
65
- class MsiTokenProvider extends TokenProviderBase {
66
- constructor(kustoUri, clientId) {
67
- super(kustoUri);
68
- this.clientId = clientId;
69
- }
70
- acquireToken() {
71
- return __awaiter(this, void 0, void 0, function* () {
72
- if (this.managedIdentityCredential == null) {
73
- this.managedIdentityCredential = this.clientId ? new identity_1.ManagedIdentityCredential(this.clientId) : new identity_1.ManagedIdentityCredential();
74
- }
75
- const msiToken = yield this.managedIdentityCredential.getToken(this.kustoUri);
76
- if ((msiToken === null || msiToken === void 0 ? void 0 : msiToken.token) != null) {
77
- return { tokenType: BEARER_TYPE, accessToken: msiToken.token };
78
- }
79
- throw new Error(`"Failed to obtain MSI token for '${this.kustoUri}' with '${this.clientId}'`);
80
- });
81
- }
82
- }
83
- exports.MsiTokenProvider = MsiTokenProvider;
84
- /**
85
- * AzCli Token Provider obtains a refresh token from the AzCli cache and uses it to authenticate with MSAL
86
- */
87
- class AzCliTokenProvider extends TokenProviderBase {
88
- constructor(kustoUri) {
89
- super(kustoUri);
90
- }
91
- acquireToken() {
92
- return __awaiter(this, void 0, void 0, function* () {
93
- if (this.azureCliCredentials == null) {
94
- this.azureCliCredentials = yield ms_rest_nodeauth_1.AzureCliCredentials.create({ resource: this.kustoUri });
95
- }
96
- return this.azureCliCredentials.getToken();
97
- });
98
- }
99
- }
100
- exports.AzCliTokenProvider = AzCliTokenProvider;
101
69
  /**
102
70
  * Acquire a token from MSAL
103
71
  */
@@ -109,7 +77,6 @@ class MsalTokenProvider extends TokenProviderBase {
109
77
  }
110
78
  acquireToken() {
111
79
  return __awaiter(this, void 0, void 0, function* () {
112
- let token;
113
80
  if (!this.initialized) {
114
81
  if (this.cloudInfo == null) {
115
82
  this.cloudInfo = yield cloudSettings_1.CloudSettings.getInstance().getCloudInfoForCluster(this.kustoUri);
@@ -118,18 +85,107 @@ class MsalTokenProvider extends TokenProviderBase {
118
85
  resourceUri = resourceUri.replace(".kusto.", ".kustomfa.");
119
86
  }
120
87
  this.scopes = [resourceUri + "/.default"];
88
+ this.authorityUri = cloudSettings_1.CloudSettings.getAuthorityUri(this.cloudInfo, this.authorityId);
121
89
  this.initClient();
122
90
  }
123
91
  this.initialized = true;
124
92
  }
125
- token = yield this.acquireMsalToken();
93
+ const token = yield this.acquireMsalToken();
126
94
  if (token) {
127
95
  return { tokenType: token.tokenType, accessToken: token.accessToken };
128
96
  }
129
97
  throw new Error("Failed to get token from msal");
130
98
  });
131
99
  }
100
+ context() {
101
+ return Object.assign(Object.assign({}, super.context()), { kustoUri: this.kustoUri, authorityId: this.authorityId });
102
+ }
132
103
  }
104
+ class AzureIdentityProvider extends MsalTokenProvider {
105
+ constructor(kustoUri, authorityId, clientId, timeoutMs) {
106
+ super(kustoUri, authorityId);
107
+ this.clientId = clientId;
108
+ this.timeoutMs = timeoutMs;
109
+ }
110
+ initClient() {
111
+ this.authorityHost = this.cloudInfo.LoginEndpoint;
112
+ this.credential = this.getCredential();
113
+ }
114
+ getCommonOptions() {
115
+ return {
116
+ authorityHost: this.authorityHost,
117
+ tenantId: this.authorityId,
118
+ clientId: this.clientId,
119
+ };
120
+ }
121
+ acquireMsalToken() {
122
+ return __awaiter(this, void 0, void 0, function* () {
123
+ const response = yield this.credential.getToken(this.scopes, {
124
+ requestOptions: {
125
+ timeout: this.timeoutMs,
126
+ },
127
+ tenantId: this.authorityId,
128
+ });
129
+ if (response === null) {
130
+ throw new Error("Failed to get token from msal");
131
+ }
132
+ return { tokenType: BEARER_TYPE, accessToken: response.token };
133
+ });
134
+ }
135
+ context() {
136
+ let base = Object.assign(Object.assign({}, super.context()), { kustoUri: this.kustoUri, authorityId: this.authorityId });
137
+ if (this.clientId) {
138
+ base = Object.assign(Object.assign({}, base), { clientId: this.clientId });
139
+ }
140
+ if (this.timeoutMs) {
141
+ base = Object.assign(Object.assign({}, base), { timeoutMs: this.timeoutMs });
142
+ }
143
+ return base;
144
+ }
145
+ }
146
+ exports.AzureIdentityProvider = AzureIdentityProvider;
147
+ /**
148
+ * MSI Token Provider obtains a token from the MSI endpoint
149
+ * The args parameter is a dictionary conforming with the ManagedIdentityCredential initializer API arguments
150
+ */
151
+ class MsiTokenProvider extends AzureIdentityProvider {
152
+ getCredential() {
153
+ const options = this.getCommonOptions();
154
+ return this.clientId ? new identity_1.ManagedIdentityCredential(this.clientId, options) : new identity_1.ManagedIdentityCredential(options);
155
+ }
156
+ }
157
+ exports.MsiTokenProvider = MsiTokenProvider;
158
+ /**
159
+ * AzCli Token Provider obtains a refresh token from the AzCli cache and uses it to authenticate with MSAL
160
+ */
161
+ class AzCliTokenProvider extends AzureIdentityProvider {
162
+ getCredential() {
163
+ return new identity_1.AzureCliCredential(this.getCommonOptions());
164
+ }
165
+ }
166
+ exports.AzCliTokenProvider = AzCliTokenProvider;
167
+ /**
168
+ * UserPromptProvider will pop up a login prompt to acquire a token.
169
+ */
170
+ class UserPromptProvider extends AzureIdentityProvider {
171
+ constructor(kustoUri, authorityId, clientId, timeoutMs, loginHint) {
172
+ super(kustoUri, authorityId, clientId, timeoutMs);
173
+ this.loginHint = loginHint;
174
+ // The default port is 80, which can lead to permission errors, so we'll choose another port
175
+ this.BrowserPort = 23145;
176
+ }
177
+ getCredential() {
178
+ return new identity_1.InteractiveBrowserCredential(Object.assign(Object.assign({}, this.getCommonOptions()), { loginHint: this.loginHint, redirectUri: `http://localhost:${this.BrowserPort}/` }));
179
+ }
180
+ context() {
181
+ let base = super.context();
182
+ if (this.loginHint) {
183
+ base = Object.assign(Object.assign({}, base), { loginHint: this.loginHint });
184
+ }
185
+ return base;
186
+ }
187
+ }
188
+ exports.UserPromptProvider = UserPromptProvider;
133
189
  /**
134
190
  * Acquire a token from MSAL with username and password
135
191
  */
@@ -143,8 +199,8 @@ class UserPassTokenProvider extends MsalTokenProvider {
143
199
  const clientConfig = {
144
200
  auth: {
145
201
  clientId: this.cloudInfo.KustoClientAppId,
146
- authority: cloudSettings_1.CloudSettings.getAuthorityUri(this.cloudInfo, this.authorityId),
147
- }
202
+ authority: this.authorityUri,
203
+ },
148
204
  };
149
205
  this.msalClient = new msal_node_1.PublicClientApplication(clientConfig);
150
206
  }
@@ -155,16 +211,26 @@ class UserPassTokenProvider extends MsalTokenProvider {
155
211
  if (this.homeAccountId != null) {
156
212
  const account = yield this.msalClient.getTokenCache().getAccountByHomeId(this.homeAccountId);
157
213
  if (account) {
158
- token = yield this.msalClient.acquireTokenSilent({ account, scopes: this.scopes });
214
+ token = yield this.msalClient.acquireTokenSilent({
215
+ account,
216
+ scopes: this.scopes,
217
+ });
159
218
  }
160
219
  }
161
220
  if (token == null) {
162
- token = yield this.msalClient.acquireTokenByUsernamePassword({ scopes: this.scopes, username: this.userName, password: this.password });
221
+ token = yield this.msalClient.acquireTokenByUsernamePassword({
222
+ scopes: this.scopes,
223
+ username: this.userName,
224
+ password: this.password,
225
+ });
163
226
  this.homeAccountId = (_a = token === null || token === void 0 ? void 0 : token.account) === null || _a === void 0 ? void 0 : _a.homeAccountId;
164
227
  }
165
228
  return token;
166
229
  });
167
230
  }
231
+ context() {
232
+ return Object.assign(Object.assign({}, super.context()), { userName: this.userName, homeAccountId: this.homeAccountId });
233
+ }
168
234
  }
169
235
  exports.UserPassTokenProvider = UserPassTokenProvider;
170
236
  /**
@@ -179,7 +245,7 @@ class DeviceLoginTokenProvider extends MsalTokenProvider {
179
245
  const clientConfig = {
180
246
  auth: {
181
247
  clientId: this.cloudInfo.KustoClientAppId,
182
- authority: cloudSettings_1.CloudSettings.getAuthorityUri(this.cloudInfo, this.authorityId),
248
+ authority: this.authorityUri,
183
249
  },
184
250
  };
185
251
  this.msalClient = new msal_node_1.PublicClientApplication(clientConfig);
@@ -191,11 +257,17 @@ class DeviceLoginTokenProvider extends MsalTokenProvider {
191
257
  if (this.homeAccountId != null) {
192
258
  const account = yield this.msalClient.getTokenCache().getAccountByHomeId(this.homeAccountId);
193
259
  if (account) {
194
- token = yield this.msalClient.acquireTokenSilent({ account, scopes: this.scopes });
260
+ token = yield this.msalClient.acquireTokenSilent({
261
+ account,
262
+ scopes: this.scopes,
263
+ });
195
264
  }
196
265
  }
197
266
  if (token == null) {
198
- token = yield this.msalClient.acquireTokenByDeviceCode({ scopes: this.scopes, deviceCodeCallback: this.deviceCodeCallback });
267
+ token = yield this.msalClient.acquireTokenByDeviceCode({
268
+ scopes: this.scopes,
269
+ deviceCodeCallback: this.deviceCodeCallback,
270
+ });
199
271
  this.homeAccountId = (_a = token === null || token === void 0 ? void 0 : token.account) === null || _a === void 0 ? void 0 : _a.homeAccountId;
200
272
  }
201
273
  return token;
@@ -217,13 +289,18 @@ class ApplicationKeyTokenProvider extends MsalTokenProvider {
217
289
  auth: {
218
290
  clientId: this.appClientId,
219
291
  clientSecret: this.appKey,
220
- authority: cloudSettings_1.CloudSettings.getAuthorityUri(this.cloudInfo, this.authorityId),
221
- }
292
+ authority: this.authorityUri,
293
+ },
222
294
  };
223
295
  this.msalClient = new msal_node_1.ConfidentialClientApplication(clientConfig);
224
296
  }
225
297
  acquireMsalToken() {
226
- return this.msalClient.acquireTokenByClientCredential({ scopes: this.scopes });
298
+ return this.msalClient.acquireTokenByClientCredential({
299
+ scopes: this.scopes,
300
+ });
301
+ }
302
+ context() {
303
+ return Object.assign(Object.assign({}, super.context()), { clientId: this.appClientId });
227
304
  }
228
305
  }
229
306
  exports.ApplicationKeyTokenProvider = ApplicationKeyTokenProvider;
@@ -243,18 +320,23 @@ class ApplicationCertificateTokenProvider extends MsalTokenProvider {
243
320
  const clientConfig = {
244
321
  auth: {
245
322
  clientId: this.appClientId,
246
- authority: cloudSettings_1.CloudSettings.getAuthorityUri(this.cloudInfo, this.authorityId),
323
+ authority: this.authorityUri,
247
324
  clientCertificate: {
248
325
  thumbprint: this.certThumbprint,
249
326
  privateKey: this.certPrivateKey,
250
- x5c: this.certX5c
251
- }
252
- }
327
+ x5c: this.certX5c,
328
+ },
329
+ },
253
330
  };
254
331
  this.msalClient = new msal_node_1.ConfidentialClientApplication(clientConfig);
255
332
  }
256
333
  acquireMsalToken() {
257
- return this.msalClient.acquireTokenByClientCredential({ scopes: this.scopes });
334
+ return this.msalClient.acquireTokenByClientCredential({
335
+ scopes: this.scopes,
336
+ });
337
+ }
338
+ context() {
339
+ return Object.assign(Object.assign({}, super.context()), { clientId: this.appClientId, thumbprint: this.certThumbprint });
258
340
  }
259
341
  }
260
342
  exports.ApplicationCertificateTokenProvider = ApplicationCertificateTokenProvider;
@@ -1 +1 @@
1
- {"version":3,"file":"tokenProvider.js","sourceRoot":"","sources":["tokenProvider.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uCAAuC;AACvC,kCAAkC;AAClC,gDAAgH;AAEhH,8DAA8D;AAC9D,8CAA4D;AAC5D,mDAA0D;AAO1D,MAAM,WAAW,GAAG,QAAQ,CAAC;AAE7B;;;GAGG;AACH,MAAsB,iBAAiB;IAMnC,YAAY,QAAgB;QACxB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,QAAQ,IAAI,IAAI,EAAE;YAClB,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC;YACtE,IAAI,CAAC,MAAM,GAAG,CAAC,QAAQ,GAAG,M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KAAK,CAAC,QAAQ,EAAE,WAAY,CAAC,CAAC;QAC9B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IAC3B,CAAC;IAED,UAAU;QACN,MAAM,YAAY,GAAG;YACjB,IAAI,EAAE;gBACF,QAAQ,EAAE,IAAI,CAAC,WAAW;gBAC1B,SAAS,EAAE,IAAI,CAAC,YAAY;gBAC5B,iBAAiB,EAAE;oBACf,UAAU,EAAE,IAAI,CAAC,cAAc;oBAC/B,UAAU,EAAE,IAAI,CAAC,cAAc;oBAC/B,GAAG,EAAE,IAAI,CAAC,OAAO;iBACpB;aACJ;SACJ,CAAC;QACF,IAAI,CAAC,UAAU,GAAG,IAAI,yCAA6B,CAAC,YAAY,CAAC,CAAC;IACtE,CAAC;IAED,gBAAgB;QACZ,OAAO,IAAI,CAAC,UAAU,CAAC,8BAA8B,CAAC;YAClD,MAAM,EAAE,IAAI,CAAC,MAAM;SACtB,CAAC,CAAC;IACP,CAAC;IAED,OAAO;QACH,uCACO,KAAK,CAAC,OAAO,EAAE,KAClB,QAAQ,EAAE,IAAI,CAAC,WAAW,EAC1B,UAAU,EAAE,IAAI,CAAC,cAAc,IACjC;IACN,CAAC;CACJ;AA3CD,kFA2CC"}
@@ -0,0 +1,3 @@
1
+ export declare type KeyOfType<T, V> = keyof {
2
+ [P in keyof T as T[P] extends V ? P : never]: unknown;
3
+ };
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation.
3
+ // Licensed under the MIT License.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ //# sourceMappingURL=typeUtilts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typeUtilts.js","sourceRoot":"","sources":["typeUtilts.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC"}
package/tsconfig.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
- "compilerOptions": {
3
- "target": "es6",
4
- "module": "commonjs",
5
- "esModuleInterop": true,
6
- "strict": true,
7
- "incremental": true,
8
- "sourceMap": true,
9
- "resolveJsonModule": true,
10
- "allowJs": false,
11
- "allowSyntheticDefaultImports": true,
12
- "declaration": true,
13
- "noUnusedParameters": true,
14
- "noUnusedLocals": true
15
- },
16
- "include": ["source/**/*.ts", "test/**/*.ts", "index.ts"]
17
- }
2
+ "compilerOptions": {
3
+ "target": "es6",
4
+ "module": "commonjs",
5
+ "esModuleInterop": true,
6
+ "strict": true,
7
+ "incremental": true,
8
+ "sourceMap": true,
9
+ "resolveJsonModule": true,
10
+ "allowJs": false,
11
+ "allowSyntheticDefaultImports": true,
12
+ "declaration": true,
13
+ "noUnusedParameters": true,
14
+ "noUnusedLocals": true
15
+ },
16
+ "include": ["source/**/*.ts", "test/**/*.ts", "index.ts"]
17
+ }