azure-kusto-data 5.0.2 → 5.0.4
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/dist-esm/src/clientDetails.js +13 -2
- package/dist-esm/src/connectionBuilder.browser.js +6 -1
- package/dist-esm/src/connectionBuilder.js +20 -4
- package/dist-esm/src/response.js +4 -0
- package/dist-esm/src/security.js +9 -6
- package/dist-esm/src/tokenProvider.js +32 -14
- package/dist-esm/src/version.js +1 -1
- package/package.json +2 -2
- package/types/src/connectionBuilder.browser.d.ts +3 -2
- package/types/src/connectionBuilder.d.ts +3 -2
- package/types/src/connectionBuilderBase.d.ts +3 -1
- package/types/src/tokenProvider.d.ts +14 -5
- package/types/src/version.d.ts +1 -1
|
@@ -31,9 +31,20 @@ class ClientDetails {
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
static defaultUser() {
|
|
34
|
+
var _a;
|
|
34
35
|
if (core_util_1.isNode) {
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
let username;
|
|
37
|
+
try {
|
|
38
|
+
username = (0, os_1.userInfo)().username;
|
|
39
|
+
}
|
|
40
|
+
catch (err) {
|
|
41
|
+
/* Ignore possible errors like "uv_os_get_passwd returned ENOMEM" that may occur in some environments. */
|
|
42
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
43
|
+
if (((_a = err.info) === null || _a === void 0 ? void 0 : _a.code) !== "ENOMEM") {
|
|
44
|
+
throw err;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return username || (process.env.USERDOMAIN ? `${process.env.USERDOMAIN}\\${process.env.USERNAME}` : process.env.USERNAME) || None;
|
|
37
48
|
}
|
|
38
49
|
else {
|
|
39
50
|
return None;
|
|
@@ -15,7 +15,7 @@ class KustoConnectionStringBuilder extends connectionBuilderBase_1.default {
|
|
|
15
15
|
static withAadApplicationKeyAuthentication(_connectionString, _aadAppId, _appKey, _authorityId) {
|
|
16
16
|
throw new Error("Not supported in browser - use withUserPrompt instead");
|
|
17
17
|
}
|
|
18
|
-
static withAadApplicationCertificateAuthentication(_connectionString, _aadAppId, _applicationCertificatePrivateKey, _authorityId, _applicationCertificateSendX5c) {
|
|
18
|
+
static withAadApplicationCertificateAuthentication(_connectionString, _aadAppId, _applicationCertificatePrivateKey, _authorityId, _applicationCertificateSendX5c, _applicationCertificatePath) {
|
|
19
19
|
throw new Error("Not supported in browser - use withUserPrompt instead");
|
|
20
20
|
}
|
|
21
21
|
static withAadDeviceAuthentication(_connectionString, _authorityId, _deviceCodeCallback) {
|
|
@@ -64,6 +64,11 @@ class KustoConnectionStringBuilder extends connectionBuilderBase_1.default {
|
|
|
64
64
|
kcsb.timeoutMs = timeoutMs;
|
|
65
65
|
return kcsb;
|
|
66
66
|
}
|
|
67
|
+
static withTokenCredential(connectionString, credential) {
|
|
68
|
+
const kcsb = new KustoConnectionStringBuilder(connectionString);
|
|
69
|
+
kcsb.tokenCredential = credential;
|
|
70
|
+
return kcsb;
|
|
71
|
+
}
|
|
67
72
|
}
|
|
68
73
|
KustoConnectionStringBuilder.DefaultDatabaseName = "NetDefaultDB";
|
|
69
74
|
KustoConnectionStringBuilder.SecretReplacement = "****";
|
|
@@ -37,15 +37,26 @@ class KustoConnectionStringBuilder extends connectionBuilderBase_1.KustoConnecti
|
|
|
37
37
|
}
|
|
38
38
|
return kcsb;
|
|
39
39
|
}
|
|
40
|
-
static withAadApplicationCertificateAuthentication(connectionString, aadAppId, applicationCertificatePrivateKey, authorityId, applicationCertificateSendX5c) {
|
|
40
|
+
static withAadApplicationCertificateAuthentication(connectionString, aadAppId, applicationCertificatePrivateKey, authorityId, applicationCertificateSendX5c, applicationCertificatePrivatePath) {
|
|
41
41
|
if (aadAppId.trim().length === 0)
|
|
42
42
|
throw new Error("Invalid app id");
|
|
43
|
-
if (applicationCertificatePrivateKey.trim().length === 0)
|
|
44
|
-
throw new Error("Invalid certificate");
|
|
45
43
|
const kcsb = new KustoConnectionStringBuilder(connectionString);
|
|
44
|
+
if (!applicationCertificatePrivatePath) {
|
|
45
|
+
if (!applicationCertificatePrivateKey) {
|
|
46
|
+
throw new Error("withAadApplicationCertificateAuthentication should specify either a cert key or a path");
|
|
47
|
+
}
|
|
48
|
+
if (applicationCertificatePrivateKey.trim().length === 0)
|
|
49
|
+
throw new Error("Invalid certificate key");
|
|
50
|
+
kcsb.applicationCertificatePrivateKey = applicationCertificatePrivateKey;
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
if (applicationCertificatePrivateKey) {
|
|
54
|
+
throw new Error("withAadApplicationCertificateAuthentication should specify either a cert key or a path");
|
|
55
|
+
}
|
|
56
|
+
kcsb.applicationCertificatePath = applicationCertificatePrivatePath;
|
|
57
|
+
}
|
|
46
58
|
kcsb.aadFederatedSecurity = true;
|
|
47
59
|
kcsb.applicationClientId = aadAppId;
|
|
48
|
-
kcsb.applicationCertificatePrivateKey = applicationCertificatePrivateKey;
|
|
49
60
|
kcsb.applicationCertificateSendX5c = applicationCertificateSendX5c;
|
|
50
61
|
if (authorityId) {
|
|
51
62
|
kcsb.authorityId = authorityId;
|
|
@@ -120,6 +131,11 @@ class KustoConnectionStringBuilder extends connectionBuilderBase_1.KustoConnecti
|
|
|
120
131
|
kcsb.timeoutMs = timeoutMs;
|
|
121
132
|
return kcsb;
|
|
122
133
|
}
|
|
134
|
+
static withTokenCredential(connectionString, credential) {
|
|
135
|
+
const kcsb = new KustoConnectionStringBuilder(connectionString);
|
|
136
|
+
kcsb.tokenCredential = credential;
|
|
137
|
+
return kcsb;
|
|
138
|
+
}
|
|
123
139
|
}
|
|
124
140
|
KustoConnectionStringBuilder.DefaultDatabaseName = "NetDefaultDB";
|
|
125
141
|
KustoConnectionStringBuilder.SecretReplacement = "****";
|
package/dist-esm/src/response.js
CHANGED
|
@@ -100,6 +100,7 @@ class KustoResponseDataSetV1 extends KustoResponseDataSet {
|
|
|
100
100
|
QueryResult: models_1.WellKnownDataSet.PrimaryResult,
|
|
101
101
|
QueryProperties: models_1.WellKnownDataSet.QueryProperties,
|
|
102
102
|
QueryStatus: models_1.WellKnownDataSet.QueryCompletionInformation,
|
|
103
|
+
PrimaryResult: models_1.WellKnownDataSet.PrimaryResult,
|
|
103
104
|
};
|
|
104
105
|
}
|
|
105
106
|
constructor(data) {
|
|
@@ -125,6 +126,9 @@ class KustoResponseDataSetV1 extends KustoResponseDataSet {
|
|
|
125
126
|
this.tables[i].name = current.Name;
|
|
126
127
|
this.tables[i].id = current.Id;
|
|
127
128
|
this.tables[i].kind = KustoResponseDataSetV1.getTablesKinds()[current.Kind];
|
|
129
|
+
if (this.tables[i].kind === models_1.WellKnownDataSet.PrimaryResult) {
|
|
130
|
+
this.primaryResults.push(this.tables[i]);
|
|
131
|
+
}
|
|
128
132
|
}
|
|
129
133
|
}
|
|
130
134
|
this.version = "1.0";
|
package/dist-esm/src/security.js
CHANGED
|
@@ -33,13 +33,13 @@ class AadHelper {
|
|
|
33
33
|
throw new Error("Invalid string builder - missing dataSource");
|
|
34
34
|
}
|
|
35
35
|
if (!!kcsb.aadUserId && !!kcsb.password) {
|
|
36
|
-
this.tokenProvider = new TokenProvider.UserPassTokenProvider(kcsb.dataSource, kcsb.aadUserId, kcsb.password, kcsb.authorityId);
|
|
36
|
+
this.tokenProvider = new TokenProvider.UserPassTokenProvider(kcsb.dataSource, kcsb.aadUserId, kcsb.password, kcsb.authorityId, kcsb.timeoutMs);
|
|
37
37
|
}
|
|
38
38
|
else if (!!kcsb.applicationClientId && !!kcsb.applicationKey) {
|
|
39
|
-
this.tokenProvider = new TokenProvider.ApplicationKeyTokenProvider(kcsb.dataSource, kcsb.applicationClientId, kcsb.applicationKey, kcsb.authorityId);
|
|
39
|
+
this.tokenProvider = new TokenProvider.ApplicationKeyTokenProvider(kcsb.dataSource, kcsb.applicationClientId, kcsb.applicationKey, kcsb.authorityId, kcsb.timeoutMs);
|
|
40
40
|
}
|
|
41
|
-
else if (!!kcsb.applicationClientId && !!kcsb.applicationCertificatePrivateKey) {
|
|
42
|
-
this.tokenProvider = new TokenProvider.ApplicationCertificateTokenProvider(kcsb.dataSource, kcsb.applicationClientId, kcsb.applicationCertificatePrivateKey, kcsb.applicationCertificateSendX5c, kcsb.authorityId);
|
|
41
|
+
else if (!!kcsb.applicationClientId && (!!kcsb.applicationCertificatePrivateKey || !!kcsb.applicationCertificatePath)) {
|
|
42
|
+
this.tokenProvider = new TokenProvider.ApplicationCertificateTokenProvider(kcsb.dataSource, kcsb.applicationClientId, kcsb.applicationCertificatePrivateKey, kcsb.applicationCertificatePath, kcsb.applicationCertificateSendX5c, kcsb.authorityId, kcsb.timeoutMs);
|
|
43
43
|
}
|
|
44
44
|
else if (kcsb.useManagedIdentityAuth) {
|
|
45
45
|
this.tokenProvider = new TokenProvider.MsiTokenProvider(kcsb.dataSource, kcsb.msiClientId, kcsb.authorityId, kcsb.timeoutMs);
|
|
@@ -51,13 +51,16 @@ class AadHelper {
|
|
|
51
51
|
this.tokenProvider = new tokenProvider_1.BasicTokenProvider(kcsb.dataSource, kcsb.accessToken);
|
|
52
52
|
}
|
|
53
53
|
else if (kcsb.useUserPromptAuth) {
|
|
54
|
-
this.tokenProvider = new tokenProvider_1.UserPromptProvider(kcsb.dataSource, kcsb.interactiveCredentialOptions);
|
|
54
|
+
this.tokenProvider = new tokenProvider_1.UserPromptProvider(kcsb.dataSource, kcsb.interactiveCredentialOptions, kcsb.timeoutMs);
|
|
55
55
|
}
|
|
56
56
|
else if (kcsb.tokenProvider) {
|
|
57
57
|
this.tokenProvider = new tokenProvider_1.CallbackTokenProvider(kcsb.dataSource, kcsb.tokenProvider);
|
|
58
58
|
}
|
|
59
59
|
else if (kcsb.useDeviceCodeAuth) {
|
|
60
|
-
this.tokenProvider = new TokenProvider.DeviceLoginTokenProvider(kcsb.dataSource, kcsb.deviceCodeCallback, kcsb.authorityId);
|
|
60
|
+
this.tokenProvider = new TokenProvider.DeviceLoginTokenProvider(kcsb.dataSource, kcsb.deviceCodeCallback, kcsb.authorityId, kcsb.timeoutMs);
|
|
61
|
+
}
|
|
62
|
+
else if (kcsb.tokenCredential) {
|
|
63
|
+
this.tokenProvider = new tokenProvider_1.TokenCredentialProvider(kcsb.dataSource, kcsb.tokenCredential, kcsb.timeoutMs);
|
|
61
64
|
}
|
|
62
65
|
}
|
|
63
66
|
async getAuthHeader() {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ApplicationKeyTokenProvider = exports.ApplicationCertificateTokenProvider = exports.DeviceLoginTokenProvider = exports.UserPassTokenProvider = exports.AzCliTokenProvider = exports.MsiTokenProvider = exports.UserPromptProvider = exports.AzureIdentityProvider = exports.CloudSettingsTokenProvider = exports.CallbackTokenProvider = exports.BasicTokenProvider = exports.TokenProviderBase = void 0;
|
|
3
|
+
exports.ApplicationKeyTokenProvider = exports.ApplicationCertificateTokenProvider = exports.DeviceLoginTokenProvider = exports.UserPassTokenProvider = exports.AzCliTokenProvider = exports.MsiTokenProvider = exports.UserPromptProvider = exports.TokenCredentialProvider = exports.AzureIdentityProvider = exports.CloudSettingsTokenProvider = exports.CallbackTokenProvider = exports.BasicTokenProvider = exports.TokenProviderBase = void 0;
|
|
4
4
|
// Copyright (c) Microsoft Corporation.
|
|
5
5
|
// Licensed under the MIT License.
|
|
6
6
|
const identity_1 = require("@azure/identity");
|
|
7
|
-
const identity_2 = require("@azure/identity");
|
|
8
7
|
const cloudSettings_1 = require("./cloudSettings");
|
|
9
8
|
const BEARER_TYPE = "Bearer";
|
|
10
9
|
/**
|
|
@@ -118,6 +117,19 @@ class AzureIdentityProvider extends CloudSettingsTokenProvider {
|
|
|
118
117
|
}
|
|
119
118
|
}
|
|
120
119
|
exports.AzureIdentityProvider = AzureIdentityProvider;
|
|
120
|
+
/**
|
|
121
|
+
* TokenCredentialProvider receives any TokenCredential to create a token with.
|
|
122
|
+
*/
|
|
123
|
+
class TokenCredentialProvider extends AzureIdentityProvider {
|
|
124
|
+
constructor(kustoUri, tokenCredential, timeoutMs) {
|
|
125
|
+
super(kustoUri, undefined, timeoutMs);
|
|
126
|
+
this.tokenCredential = tokenCredential;
|
|
127
|
+
}
|
|
128
|
+
getCredential() {
|
|
129
|
+
return this.tokenCredential;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
exports.TokenCredentialProvider = TokenCredentialProvider;
|
|
121
133
|
/**
|
|
122
134
|
* UserPromptProvider will pop up a login prompt to acquire a token.
|
|
123
135
|
*/
|
|
@@ -131,7 +143,7 @@ class UserPromptProvider extends AzureIdentityProvider {
|
|
|
131
143
|
}
|
|
132
144
|
getCredential() {
|
|
133
145
|
var _a, _b, _c, _d;
|
|
134
|
-
return new
|
|
146
|
+
return new identity_1.InteractiveBrowserCredential(Object.assign(Object.assign({}, this.interactiveCredentialOptions), { tenantId: this.authorityId, clientId: (_b = (_a = this.interactiveCredentialOptions) === null || _a === void 0 ? void 0 : _a.clientId) !== null && _b !== void 0 ? _b : this.cloudInfo.KustoClientAppId, redirectUri: (_d = (_c = this.interactiveCredentialOptions) === null || _c === void 0 ? void 0 : _c.redirectUri) !== null && _d !== void 0 ? _d : `http://localhost:${this.getRandomPortInRange()}/` }));
|
|
135
147
|
}
|
|
136
148
|
getRandomPortInRange() {
|
|
137
149
|
return Math.floor(Math.random() * (this.MaxPort - this.MinPort) + this.MinPort);
|
|
@@ -176,8 +188,8 @@ exports.AzCliTokenProvider = AzCliTokenProvider;
|
|
|
176
188
|
* Acquire a token from MSAL with username and password
|
|
177
189
|
*/
|
|
178
190
|
class UserPassTokenProvider extends AzureIdentityProvider {
|
|
179
|
-
constructor(kustoUri, userName, password, authorityId) {
|
|
180
|
-
super(kustoUri, authorityId,
|
|
191
|
+
constructor(kustoUri, userName, password, authorityId, timeoutMs) {
|
|
192
|
+
super(kustoUri, authorityId, timeoutMs);
|
|
181
193
|
this.userName = userName;
|
|
182
194
|
this.password = password;
|
|
183
195
|
}
|
|
@@ -193,8 +205,8 @@ exports.UserPassTokenProvider = UserPassTokenProvider;
|
|
|
193
205
|
* Acquire a token from Device Login flow
|
|
194
206
|
*/
|
|
195
207
|
class DeviceLoginTokenProvider extends AzureIdentityProvider {
|
|
196
|
-
constructor(kustoUri, deviceCodeCallback, authorityId) {
|
|
197
|
-
super(kustoUri, authorityId,
|
|
208
|
+
constructor(kustoUri, deviceCodeCallback, authorityId, timeoutMs) {
|
|
209
|
+
super(kustoUri, authorityId, timeoutMs);
|
|
198
210
|
this.deviceCodeCallback = deviceCodeCallback;
|
|
199
211
|
}
|
|
200
212
|
getCredential() {
|
|
@@ -211,16 +223,22 @@ exports.DeviceLoginTokenProvider = DeviceLoginTokenProvider;
|
|
|
211
223
|
* Passing the public certificate is optional and will result in Subject Name & Issuer Authentication
|
|
212
224
|
*/
|
|
213
225
|
class ApplicationCertificateTokenProvider extends AzureIdentityProvider {
|
|
214
|
-
constructor(kustoUri, appClientId, certPrivateKey, sendX5c, authorityId) {
|
|
215
|
-
super(kustoUri, authorityId);
|
|
226
|
+
constructor(kustoUri, appClientId, certPrivateKey, certPath, sendX5c, authorityId, timeoutMs) {
|
|
227
|
+
super(kustoUri, authorityId, timeoutMs);
|
|
216
228
|
this.appClientId = appClientId;
|
|
217
229
|
this.certPrivateKey = certPrivateKey;
|
|
230
|
+
this.certPath = certPath;
|
|
218
231
|
this.sendX5c = sendX5c;
|
|
219
232
|
}
|
|
220
233
|
getCredential() {
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
234
|
+
if (this.certPrivateKey) {
|
|
235
|
+
return new identity_1.ClientCertificateCredential(this.authorityId, this.appClientId, {
|
|
236
|
+
certificate: this.certPrivateKey,
|
|
237
|
+
}, {
|
|
238
|
+
sendCertificateChain: this.sendX5c,
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
return new identity_1.ClientCertificateCredential(this.authorityId, this.appClientId, this.certPath, {
|
|
224
242
|
sendCertificateChain: this.sendX5c,
|
|
225
243
|
});
|
|
226
244
|
}
|
|
@@ -233,8 +251,8 @@ exports.ApplicationCertificateTokenProvider = ApplicationCertificateTokenProvide
|
|
|
233
251
|
* Acquire a token from MSAL with application id and Key
|
|
234
252
|
*/
|
|
235
253
|
class ApplicationKeyTokenProvider extends AzureIdentityProvider {
|
|
236
|
-
constructor(kustoUri, appClientId, appKey, authorityId) {
|
|
237
|
-
super(kustoUri, authorityId);
|
|
254
|
+
constructor(kustoUri, appClientId, appKey, authorityId, timeoutMs) {
|
|
255
|
+
super(kustoUri, authorityId, timeoutMs);
|
|
238
256
|
this.appClientId = appClientId;
|
|
239
257
|
this.appKey = appKey;
|
|
240
258
|
}
|
package/dist-esm/src/version.js
CHANGED
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.SDK_VERSION = void 0;
|
|
6
6
|
// SDK_VERSION should be updated in all 3 package.json and lerna.json(by running lerna version)
|
|
7
|
-
exports.SDK_VERSION = "5.0.
|
|
7
|
+
exports.SDK_VERSION = "5.0.4";
|
|
8
8
|
//# sourceMappingURL=version.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "azure-kusto-data",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.4",
|
|
4
4
|
"description": "Azure Data Explorer Query SDK",
|
|
5
5
|
"module": "dist-esm/src/index.js",
|
|
6
6
|
"types": "./types/src/index.d.ts",
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"overrides": {
|
|
69
69
|
"jsonwebtoken": "^9.0.0"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "c50520216e9db02516a3ae5a85e2f088f788595e"
|
|
72
72
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { DeviceCodeInfo, InteractiveBrowserCredentialInBrowserOptions, InteractiveBrowserCredentialNodeOptions } from "@azure/identity";
|
|
1
|
+
import { DeviceCodeInfo, InteractiveBrowserCredentialInBrowserOptions, InteractiveBrowserCredentialNodeOptions, TokenCredential } from "@azure/identity";
|
|
2
2
|
import KustoConnectionStringBuilderBase from "./connectionBuilderBase";
|
|
3
3
|
export declare class KustoConnectionStringBuilder extends KustoConnectionStringBuilderBase {
|
|
4
4
|
static readonly DefaultDatabaseName = "NetDefaultDB";
|
|
5
5
|
static readonly SecretReplacement = "****";
|
|
6
6
|
static withAadUserPasswordAuthentication(_connectionString: string, _userId: string, _password: string, _authorityId?: string): KustoConnectionStringBuilder;
|
|
7
7
|
static withAadApplicationKeyAuthentication(_connectionString: string, _aadAppId: string, _appKey: string, _authorityId?: string): KustoConnectionStringBuilder;
|
|
8
|
-
static withAadApplicationCertificateAuthentication(_connectionString: string, _aadAppId: string, _applicationCertificatePrivateKey
|
|
8
|
+
static withAadApplicationCertificateAuthentication(_connectionString: string, _aadAppId: string, _applicationCertificatePrivateKey?: string, _authorityId?: string, _applicationCertificateSendX5c?: boolean, _applicationCertificatePath?: string): KustoConnectionStringBuilder;
|
|
9
9
|
static withAadDeviceAuthentication(_connectionString: string, _authorityId?: string, _deviceCodeCallback?: (response: DeviceCodeInfo) => void): KustoConnectionStringBuilder;
|
|
10
10
|
static withSystemManagedIdentity(_connectionString: string, _authorityId?: string, _timeoutMs?: number): KustoConnectionStringBuilder;
|
|
11
11
|
static withUserManagedIdentity(_connectionString: string, _msiClientId: string, _authorityId?: string, _timeoutMs?: number): KustoConnectionStringBuilder;
|
|
@@ -13,6 +13,7 @@ export declare class KustoConnectionStringBuilder extends KustoConnectionStringB
|
|
|
13
13
|
static withAccessToken(connectionString: string, accessToken: string): KustoConnectionStringBuilder;
|
|
14
14
|
static withTokenProvider(connectionString: string, tokenProvider: () => Promise<string>): KustoConnectionStringBuilder;
|
|
15
15
|
static withUserPrompt(connectionString: string, interactiveCredentialOptions: InteractiveBrowserCredentialNodeOptions | InteractiveBrowserCredentialInBrowserOptions, timeoutMs?: number): KustoConnectionStringBuilder;
|
|
16
|
+
static withTokenCredential(connectionString: string, credential: TokenCredential): KustoConnectionStringBuilder;
|
|
16
17
|
}
|
|
17
18
|
export default KustoConnectionStringBuilder;
|
|
18
19
|
//# sourceMappingURL=connectionBuilder.browser.d.ts.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { DeviceCodeInfo, InteractiveBrowserCredentialInBrowserOptions, InteractiveBrowserCredentialNodeOptions } from "@azure/identity";
|
|
1
|
+
import { DeviceCodeInfo, InteractiveBrowserCredentialInBrowserOptions, InteractiveBrowserCredentialNodeOptions, TokenCredential } from "@azure/identity";
|
|
2
2
|
import { KustoConnectionStringBuilderBase } from "./connectionBuilderBase";
|
|
3
3
|
export declare class KustoConnectionStringBuilder extends KustoConnectionStringBuilderBase {
|
|
4
4
|
static readonly DefaultDatabaseName = "NetDefaultDB";
|
|
5
5
|
static readonly SecretReplacement = "****";
|
|
6
6
|
static withAadUserPasswordAuthentication(connectionString: string, userId: string, password: string, authorityId?: string): KustoConnectionStringBuilder;
|
|
7
7
|
static withAadApplicationKeyAuthentication(connectionString: string, aadAppId: string, appKey: string, authorityId?: string): KustoConnectionStringBuilder;
|
|
8
|
-
static withAadApplicationCertificateAuthentication(connectionString: string, aadAppId: string, applicationCertificatePrivateKey
|
|
8
|
+
static withAadApplicationCertificateAuthentication(connectionString: string, aadAppId: string, applicationCertificatePrivateKey?: string, authorityId?: string, applicationCertificateSendX5c?: boolean, applicationCertificatePrivatePath?: string): KustoConnectionStringBuilder;
|
|
9
9
|
static withAadDeviceAuthentication(connectionString: string, authorityId?: string, deviceCodeCallback?: (response: DeviceCodeInfo) => void): KustoConnectionStringBuilder;
|
|
10
10
|
private static withAadManagedIdentities;
|
|
11
11
|
static withSystemManagedIdentity(connectionString: string, authorityId?: string, timeoutMs?: number): KustoConnectionStringBuilder;
|
|
@@ -19,6 +19,7 @@ export declare class KustoConnectionStringBuilder extends KustoConnectionStringB
|
|
|
19
19
|
* See: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity/test/manual/interactive-browser-credential
|
|
20
20
|
*/
|
|
21
21
|
static withUserPrompt(connectionString: string, options?: InteractiveBrowserCredentialNodeOptions | InteractiveBrowserCredentialInBrowserOptions, timeoutMs?: number): KustoConnectionStringBuilder;
|
|
22
|
+
static withTokenCredential(connectionString: string, credential: TokenCredential): KustoConnectionStringBuilder;
|
|
22
23
|
}
|
|
23
24
|
export default KustoConnectionStringBuilder;
|
|
24
25
|
//# sourceMappingURL=connectionBuilder.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DeviceCodeInfo, InteractiveBrowserCredentialInBrowserOptions, InteractiveBrowserCredentialNodeOptions } from "@azure/identity";
|
|
1
|
+
import { DeviceCodeInfo, InteractiveBrowserCredentialInBrowserOptions, InteractiveBrowserCredentialNodeOptions, TokenCredential } from "@azure/identity";
|
|
2
2
|
import { KeyOfType } from "./typeUtilts";
|
|
3
3
|
import { ClientDetails } from "./clientDetails";
|
|
4
4
|
interface MappingType {
|
|
@@ -33,6 +33,8 @@ export declare abstract class KustoConnectionStringBuilderBase {
|
|
|
33
33
|
useAzLoginAuth?: boolean;
|
|
34
34
|
useManagedIdentityAuth?: boolean;
|
|
35
35
|
interactiveCredentialOptions?: InteractiveBrowserCredentialNodeOptions | InteractiveBrowserCredentialInBrowserOptions;
|
|
36
|
+
tokenCredential?: TokenCredential;
|
|
37
|
+
applicationCertificatePath?: string;
|
|
36
38
|
applicationNameForTracing: string | null;
|
|
37
39
|
userNameForTracing: string | null;
|
|
38
40
|
constructor(connectionString: string);
|
|
@@ -59,6 +59,14 @@ export declare abstract class AzureIdentityProvider extends CloudSettingsTokenPr
|
|
|
59
59
|
context(): Record<string, any>;
|
|
60
60
|
abstract getCredential(): TokenCredential;
|
|
61
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* TokenCredentialProvider receives any TokenCredential to create a token with.
|
|
64
|
+
*/
|
|
65
|
+
export declare class TokenCredentialProvider extends AzureIdentityProvider {
|
|
66
|
+
private tokenCredential;
|
|
67
|
+
constructor(kustoUri: string, tokenCredential: TokenCredential, timeoutMs?: number);
|
|
68
|
+
getCredential(): TokenCredential;
|
|
69
|
+
}
|
|
62
70
|
/**
|
|
63
71
|
* UserPromptProvider will pop up a login prompt to acquire a token.
|
|
64
72
|
*/
|
|
@@ -94,7 +102,7 @@ export declare class UserPassTokenProvider extends AzureIdentityProvider {
|
|
|
94
102
|
userName: string;
|
|
95
103
|
password: string;
|
|
96
104
|
homeAccountId?: string;
|
|
97
|
-
constructor(kustoUri: string, userName: string, password: string, authorityId: string);
|
|
105
|
+
constructor(kustoUri: string, userName: string, password: string, authorityId: string, timeoutMs?: number);
|
|
98
106
|
getCredential(): TokenCredential;
|
|
99
107
|
context(): Record<string, any>;
|
|
100
108
|
}
|
|
@@ -103,7 +111,7 @@ export declare class UserPassTokenProvider extends AzureIdentityProvider {
|
|
|
103
111
|
*/
|
|
104
112
|
export declare class DeviceLoginTokenProvider extends AzureIdentityProvider {
|
|
105
113
|
private deviceCodeCallback?;
|
|
106
|
-
constructor(kustoUri: string, deviceCodeCallback?: ((response: DeviceCodeInfo) => void) | undefined, authorityId?: string);
|
|
114
|
+
constructor(kustoUri: string, deviceCodeCallback?: ((response: DeviceCodeInfo) => void) | undefined, authorityId?: string, timeoutMs?: number);
|
|
107
115
|
getCredential(): TokenCredential;
|
|
108
116
|
}
|
|
109
117
|
/**
|
|
@@ -112,9 +120,10 @@ export declare class DeviceLoginTokenProvider extends AzureIdentityProvider {
|
|
|
112
120
|
*/
|
|
113
121
|
export declare class ApplicationCertificateTokenProvider extends AzureIdentityProvider {
|
|
114
122
|
private appClientId;
|
|
115
|
-
private certPrivateKey
|
|
123
|
+
private certPrivateKey?;
|
|
124
|
+
private certPath?;
|
|
116
125
|
private sendX5c?;
|
|
117
|
-
constructor(kustoUri: string, appClientId: string, certPrivateKey
|
|
126
|
+
constructor(kustoUri: string, appClientId: string, certPrivateKey?: string | undefined, certPath?: string | undefined, sendX5c?: boolean | undefined, authorityId?: string, timeoutMs?: number);
|
|
118
127
|
getCredential(): TokenCredential;
|
|
119
128
|
context(): Record<string, any>;
|
|
120
129
|
}
|
|
@@ -124,7 +133,7 @@ export declare class ApplicationCertificateTokenProvider extends AzureIdentityPr
|
|
|
124
133
|
export declare class ApplicationKeyTokenProvider extends AzureIdentityProvider {
|
|
125
134
|
private appClientId;
|
|
126
135
|
private appKey;
|
|
127
|
-
constructor(kustoUri: string, appClientId: string, appKey: string, authorityId: string);
|
|
136
|
+
constructor(kustoUri: string, appClientId: string, appKey: string, authorityId: string, timeoutMs?: number);
|
|
128
137
|
getCredential(): TokenCredential;
|
|
129
138
|
context(): Record<string, any>;
|
|
130
139
|
}
|
package/types/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "5.0.
|
|
1
|
+
export declare const SDK_VERSION = "5.0.4";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|