azure-kusto-data 2.2.3 → 3.2.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/.eslintignore +5 -0
- package/.eslintrc.js +247 -0
- package/.prettierignore +7 -0
- package/.prettierrc.json +5 -0
- package/README.md +38 -12
- package/example.js +3 -5
- package/index.js +0 -1
- package/index.js.map +1 -1
- package/package.json +63 -50
- package/source/client.d.ts +9 -7
- package/source/client.js +55 -28
- package/source/client.js.map +1 -1
- package/source/clientRequestProperties.d.ts +13 -2
- package/source/clientRequestProperties.js +11 -5
- package/source/clientRequestProperties.js.map +1 -1
- package/source/cloudSettings.js +2 -2
- package/source/cloudSettings.js.map +1 -1
- package/source/connectionBuilder.d.ts +24 -6
- package/source/connectionBuilder.js +128 -50
- package/source/connectionBuilder.js.map +1 -1
- package/source/errors.d.ts +6 -0
- package/source/errors.js +16 -0
- package/source/errors.js.map +1 -0
- package/source/models.d.ts +29 -5
- package/source/models.js +57 -20
- package/source/models.js.map +1 -1
- package/source/response.d.ts +2 -2
- package/source/response.js +15 -13
- package/source/response.js.map +1 -1
- package/source/security.d.ts +2 -2
- package/source/security.js +31 -20
- package/source/security.js.map +1 -1
- package/source/tokenProvider.d.ts +62 -27
- package/source/tokenProvider.js +143 -64
- package/source/tokenProvider.js.map +1 -1
- package/source/typeUtilts.d.ts +3 -0
- package/source/typeUtilts.js +5 -0
- package/source/typeUtilts.js.map +1 -0
- package/tsconfig.json +16 -16
- package/tsconfig.tsbuildinfo +1618 -1292
- package/index.ts +0 -13
- package/tslint.json +0 -18
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ConfidentialClientApplication, PublicClientApplication } from "@azure/msal-node";
|
|
2
2
|
import { DeviceCodeResponse } from "@azure/msal-common";
|
|
3
|
-
import { ManagedIdentityCredential, AzureCliCredential } from "@azure/identity";
|
|
4
3
|
import { CloudInfo } from "./cloudSettings";
|
|
4
|
+
import { TokenCredential } from "@azure/core-auth";
|
|
5
5
|
export declare type TokenResponse = {
|
|
6
6
|
tokenType: string;
|
|
7
7
|
accessToken: string;
|
|
8
8
|
};
|
|
9
|
+
interface TokenType {
|
|
10
|
+
tokenType: string;
|
|
11
|
+
accessToken: string;
|
|
12
|
+
}
|
|
9
13
|
/**
|
|
10
14
|
* This base class abstracts token acquisition for all implementations.
|
|
11
15
|
* The class is build for Lazy initialization, so that the first call, take on instantiation of 'heavy' long-lived class members
|
|
@@ -14,7 +18,8 @@ export declare abstract class TokenProviderBase {
|
|
|
14
18
|
kustoUri: string;
|
|
15
19
|
scopes: string[];
|
|
16
20
|
abstract acquireToken(): Promise<TokenResponse>;
|
|
17
|
-
|
|
21
|
+
context(): Record<string, any>;
|
|
22
|
+
protected constructor(kustoUri: string);
|
|
18
23
|
}
|
|
19
24
|
/**
|
|
20
25
|
* Basic Token Provider keeps and returns a token received on construction
|
|
@@ -32,31 +37,58 @@ export declare class CallbackTokenProvider extends TokenProviderBase {
|
|
|
32
37
|
constructor(kustoUri: string, callback: () => Promise<string>);
|
|
33
38
|
acquireToken(): Promise<TokenResponse>;
|
|
34
39
|
}
|
|
35
|
-
export declare class MsiTokenProvider extends TokenProviderBase {
|
|
36
|
-
clientId?: string;
|
|
37
|
-
managedIdentityCredential: ManagedIdentityCredential;
|
|
38
|
-
constructor(kustoUri: string, clientId?: string);
|
|
39
|
-
acquireToken(): Promise<TokenResponse>;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* AzCli Token Provider obtains a refresh token from the AzCli cache and uses it to authenticate with MSAL
|
|
43
|
-
*/
|
|
44
|
-
export declare class AzCliTokenProvider extends TokenProviderBase {
|
|
45
|
-
azureCliCredentials: AzureCliCredential;
|
|
46
|
-
constructor(kustoUri: string);
|
|
47
|
-
acquireToken(): Promise<TokenResponse>;
|
|
48
|
-
}
|
|
49
40
|
/**
|
|
50
41
|
* Acquire a token from MSAL
|
|
51
42
|
*/
|
|
52
43
|
declare abstract class MsalTokenProvider extends TokenProviderBase {
|
|
53
44
|
cloudInfo: CloudInfo;
|
|
54
|
-
authorityId
|
|
45
|
+
authorityId: string;
|
|
55
46
|
initialized: boolean;
|
|
47
|
+
authorityUri: string;
|
|
56
48
|
abstract initClient(): void;
|
|
57
|
-
abstract acquireMsalToken(): Promise<
|
|
58
|
-
constructor(kustoUri: string, authorityId
|
|
49
|
+
abstract acquireMsalToken(): Promise<TokenType | null>;
|
|
50
|
+
protected constructor(kustoUri: string, authorityId: string);
|
|
59
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>;
|
|
60
92
|
}
|
|
61
93
|
/**
|
|
62
94
|
* Acquire a token from MSAL with username and password
|
|
@@ -66,9 +98,10 @@ export declare class UserPassTokenProvider extends MsalTokenProvider {
|
|
|
66
98
|
password: string;
|
|
67
99
|
homeAccountId?: string;
|
|
68
100
|
msalClient: PublicClientApplication;
|
|
69
|
-
constructor(kustoUri: string, userName: string, password: string, authorityId
|
|
101
|
+
constructor(kustoUri: string, userName: string, password: string, authorityId: string);
|
|
70
102
|
initClient(): void;
|
|
71
|
-
acquireMsalToken(): Promise<
|
|
103
|
+
acquireMsalToken(): Promise<TokenType | null>;
|
|
104
|
+
context(): Record<string, any>;
|
|
72
105
|
}
|
|
73
106
|
/**
|
|
74
107
|
* Acquire a token from MSAL with Device Login flow
|
|
@@ -77,9 +110,9 @@ export declare class DeviceLoginTokenProvider extends MsalTokenProvider {
|
|
|
77
110
|
deviceCodeCallback: (response: DeviceCodeResponse) => void;
|
|
78
111
|
homeAccountId?: string;
|
|
79
112
|
msalClient: PublicClientApplication;
|
|
80
|
-
constructor(kustoUri: string, deviceCodeCallback: (response: DeviceCodeResponse) => void, authorityId
|
|
113
|
+
constructor(kustoUri: string, deviceCodeCallback: (response: DeviceCodeResponse) => void, authorityId: string);
|
|
81
114
|
initClient(): void;
|
|
82
|
-
acquireMsalToken(): Promise<
|
|
115
|
+
acquireMsalToken(): Promise<TokenType | null>;
|
|
83
116
|
}
|
|
84
117
|
/**
|
|
85
118
|
* Acquire a token from MSAL with application Id and Key
|
|
@@ -88,9 +121,10 @@ export declare class ApplicationKeyTokenProvider extends MsalTokenProvider {
|
|
|
88
121
|
appClientId: string;
|
|
89
122
|
appKey: string;
|
|
90
123
|
msalClient: ConfidentialClientApplication;
|
|
91
|
-
constructor(kustoUri: string, appClientId: string, appKey: string, authorityId
|
|
124
|
+
constructor(kustoUri: string, appClientId: string, appKey: string, authorityId: string);
|
|
92
125
|
initClient(): void;
|
|
93
|
-
acquireMsalToken(): Promise<
|
|
126
|
+
acquireMsalToken(): Promise<TokenType | null>;
|
|
127
|
+
context(): Record<string, any>;
|
|
94
128
|
}
|
|
95
129
|
/**
|
|
96
130
|
* Acquire a token from MSAL using application certificate
|
|
@@ -104,6 +138,7 @@ export declare class ApplicationCertificateTokenProvider extends MsalTokenProvid
|
|
|
104
138
|
msalClient: ConfidentialClientApplication;
|
|
105
139
|
constructor(kustoUri: string, appClientId: string, certThumbprint: string, certPrivateKey: string, certX5c?: string, authorityId?: string);
|
|
106
140
|
initClient(): void;
|
|
107
|
-
acquireMsalToken(): Promise<
|
|
141
|
+
acquireMsalToken(): Promise<TokenType | null>;
|
|
142
|
+
context(): Record<string, any>;
|
|
108
143
|
}
|
|
109
144
|
export {};
|
package/source/tokenProvider.js
CHANGED
|
@@ -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,9 +11,8 @@ 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
|
-
|
|
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
17
|
const identity_1 = require("@azure/identity");
|
|
17
18
|
const cloudSettings_1 = require("./cloudSettings");
|
|
@@ -24,10 +25,13 @@ class TokenProviderBase {
|
|
|
24
25
|
constructor(kustoUri) {
|
|
25
26
|
this.kustoUri = kustoUri;
|
|
26
27
|
if (kustoUri != null) {
|
|
27
|
-
const suffix = this.kustoUri.endsWith("/") ? "
|
|
28
|
+
const suffix = (!this.kustoUri.endsWith("/") ? "/" : "") + ".default";
|
|
28
29
|
this.scopes = [kustoUri + suffix];
|
|
29
30
|
}
|
|
30
31
|
}
|
|
32
|
+
context() {
|
|
33
|
+
return {};
|
|
34
|
+
}
|
|
31
35
|
}
|
|
32
36
|
exports.TokenProviderBase = TokenProviderBase;
|
|
33
37
|
/**
|
|
@@ -39,7 +43,10 @@ class BasicTokenProvider extends TokenProviderBase {
|
|
|
39
43
|
this.token = token;
|
|
40
44
|
}
|
|
41
45
|
acquireToken() {
|
|
42
|
-
return Promise.resolve({
|
|
46
|
+
return Promise.resolve({
|
|
47
|
+
tokenType: BEARER_TYPE,
|
|
48
|
+
accessToken: this.token,
|
|
49
|
+
});
|
|
43
50
|
}
|
|
44
51
|
}
|
|
45
52
|
exports.BasicTokenProvider = BasicTokenProvider;
|
|
@@ -59,48 +66,6 @@ class CallbackTokenProvider extends TokenProviderBase {
|
|
|
59
66
|
}
|
|
60
67
|
}
|
|
61
68
|
exports.CallbackTokenProvider = CallbackTokenProvider;
|
|
62
|
-
// MSI Token Provider obtains a token from the MSI endpoint
|
|
63
|
-
// The args parameter is a dictionary conforming with the ManagedIdentityCredential initializer API arguments
|
|
64
|
-
class MsiTokenProvider extends TokenProviderBase {
|
|
65
|
-
constructor(kustoUri, clientId) {
|
|
66
|
-
super(kustoUri);
|
|
67
|
-
this.clientId = clientId;
|
|
68
|
-
}
|
|
69
|
-
acquireToken() {
|
|
70
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
-
if (this.managedIdentityCredential == null) {
|
|
72
|
-
this.managedIdentityCredential = this.clientId ? new identity_1.ManagedIdentityCredential(this.clientId) : new identity_1.ManagedIdentityCredential();
|
|
73
|
-
}
|
|
74
|
-
const msiToken = yield this.managedIdentityCredential.getToken(this.kustoUri);
|
|
75
|
-
if ((msiToken === null || msiToken === void 0 ? void 0 : msiToken.token) != null) {
|
|
76
|
-
return { tokenType: BEARER_TYPE, accessToken: msiToken.token };
|
|
77
|
-
}
|
|
78
|
-
throw new Error(`"Failed to obtain MSI token for '${this.kustoUri}' with '${this.clientId}'`);
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
exports.MsiTokenProvider = MsiTokenProvider;
|
|
83
|
-
/**
|
|
84
|
-
* AzCli Token Provider obtains a refresh token from the AzCli cache and uses it to authenticate with MSAL
|
|
85
|
-
*/
|
|
86
|
-
class AzCliTokenProvider extends TokenProviderBase {
|
|
87
|
-
constructor(kustoUri) {
|
|
88
|
-
super(kustoUri);
|
|
89
|
-
}
|
|
90
|
-
acquireToken() {
|
|
91
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
92
|
-
if (this.azureCliCredentials == null) {
|
|
93
|
-
this.azureCliCredentials = new identity_1.AzureCliCredential();
|
|
94
|
-
}
|
|
95
|
-
const response = yield this.azureCliCredentials.getToken(this.scopes);
|
|
96
|
-
if (response) {
|
|
97
|
-
return { tokenType: BEARER_TYPE, accessToken: response.token };
|
|
98
|
-
}
|
|
99
|
-
throw new Error(`"Failed to obtain AzCli token for '${this.kustoUri}'`);
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
exports.AzCliTokenProvider = AzCliTokenProvider;
|
|
104
69
|
/**
|
|
105
70
|
* Acquire a token from MSAL
|
|
106
71
|
*/
|
|
@@ -112,7 +77,6 @@ class MsalTokenProvider extends TokenProviderBase {
|
|
|
112
77
|
}
|
|
113
78
|
acquireToken() {
|
|
114
79
|
return __awaiter(this, void 0, void 0, function* () {
|
|
115
|
-
let token;
|
|
116
80
|
if (!this.initialized) {
|
|
117
81
|
if (this.cloudInfo == null) {
|
|
118
82
|
this.cloudInfo = yield cloudSettings_1.CloudSettings.getInstance().getCloudInfoForCluster(this.kustoUri);
|
|
@@ -121,18 +85,107 @@ class MsalTokenProvider extends TokenProviderBase {
|
|
|
121
85
|
resourceUri = resourceUri.replace(".kusto.", ".kustomfa.");
|
|
122
86
|
}
|
|
123
87
|
this.scopes = [resourceUri + "/.default"];
|
|
88
|
+
this.authorityUri = cloudSettings_1.CloudSettings.getAuthorityUri(this.cloudInfo, this.authorityId);
|
|
124
89
|
this.initClient();
|
|
125
90
|
}
|
|
126
91
|
this.initialized = true;
|
|
127
92
|
}
|
|
128
|
-
token = yield this.acquireMsalToken();
|
|
93
|
+
const token = yield this.acquireMsalToken();
|
|
129
94
|
if (token) {
|
|
130
95
|
return { tokenType: token.tokenType, accessToken: token.accessToken };
|
|
131
96
|
}
|
|
132
97
|
throw new Error("Failed to get token from msal");
|
|
133
98
|
});
|
|
134
99
|
}
|
|
100
|
+
context() {
|
|
101
|
+
return Object.assign(Object.assign({}, super.context()), { kustoUri: this.kustoUri, authorityId: this.authorityId });
|
|
102
|
+
}
|
|
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
|
+
}
|
|
135
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;
|
|
136
189
|
/**
|
|
137
190
|
* Acquire a token from MSAL with username and password
|
|
138
191
|
*/
|
|
@@ -146,8 +199,8 @@ class UserPassTokenProvider extends MsalTokenProvider {
|
|
|
146
199
|
const clientConfig = {
|
|
147
200
|
auth: {
|
|
148
201
|
clientId: this.cloudInfo.KustoClientAppId,
|
|
149
|
-
authority:
|
|
150
|
-
}
|
|
202
|
+
authority: this.authorityUri,
|
|
203
|
+
},
|
|
151
204
|
};
|
|
152
205
|
this.msalClient = new msal_node_1.PublicClientApplication(clientConfig);
|
|
153
206
|
}
|
|
@@ -158,16 +211,26 @@ class UserPassTokenProvider extends MsalTokenProvider {
|
|
|
158
211
|
if (this.homeAccountId != null) {
|
|
159
212
|
const account = yield this.msalClient.getTokenCache().getAccountByHomeId(this.homeAccountId);
|
|
160
213
|
if (account) {
|
|
161
|
-
token = yield this.msalClient.acquireTokenSilent({
|
|
214
|
+
token = yield this.msalClient.acquireTokenSilent({
|
|
215
|
+
account,
|
|
216
|
+
scopes: this.scopes,
|
|
217
|
+
});
|
|
162
218
|
}
|
|
163
219
|
}
|
|
164
220
|
if (token == null) {
|
|
165
|
-
token = yield this.msalClient.acquireTokenByUsernamePassword({
|
|
221
|
+
token = yield this.msalClient.acquireTokenByUsernamePassword({
|
|
222
|
+
scopes: this.scopes,
|
|
223
|
+
username: this.userName,
|
|
224
|
+
password: this.password,
|
|
225
|
+
});
|
|
166
226
|
this.homeAccountId = (_a = token === null || token === void 0 ? void 0 : token.account) === null || _a === void 0 ? void 0 : _a.homeAccountId;
|
|
167
227
|
}
|
|
168
228
|
return token;
|
|
169
229
|
});
|
|
170
230
|
}
|
|
231
|
+
context() {
|
|
232
|
+
return Object.assign(Object.assign({}, super.context()), { userName: this.userName, homeAccountId: this.homeAccountId });
|
|
233
|
+
}
|
|
171
234
|
}
|
|
172
235
|
exports.UserPassTokenProvider = UserPassTokenProvider;
|
|
173
236
|
/**
|
|
@@ -182,7 +245,7 @@ class DeviceLoginTokenProvider extends MsalTokenProvider {
|
|
|
182
245
|
const clientConfig = {
|
|
183
246
|
auth: {
|
|
184
247
|
clientId: this.cloudInfo.KustoClientAppId,
|
|
185
|
-
authority:
|
|
248
|
+
authority: this.authorityUri,
|
|
186
249
|
},
|
|
187
250
|
};
|
|
188
251
|
this.msalClient = new msal_node_1.PublicClientApplication(clientConfig);
|
|
@@ -194,11 +257,17 @@ class DeviceLoginTokenProvider extends MsalTokenProvider {
|
|
|
194
257
|
if (this.homeAccountId != null) {
|
|
195
258
|
const account = yield this.msalClient.getTokenCache().getAccountByHomeId(this.homeAccountId);
|
|
196
259
|
if (account) {
|
|
197
|
-
token = yield this.msalClient.acquireTokenSilent({
|
|
260
|
+
token = yield this.msalClient.acquireTokenSilent({
|
|
261
|
+
account,
|
|
262
|
+
scopes: this.scopes,
|
|
263
|
+
});
|
|
198
264
|
}
|
|
199
265
|
}
|
|
200
266
|
if (token == null) {
|
|
201
|
-
token = yield this.msalClient.acquireTokenByDeviceCode({
|
|
267
|
+
token = yield this.msalClient.acquireTokenByDeviceCode({
|
|
268
|
+
scopes: this.scopes,
|
|
269
|
+
deviceCodeCallback: this.deviceCodeCallback,
|
|
270
|
+
});
|
|
202
271
|
this.homeAccountId = (_a = token === null || token === void 0 ? void 0 : token.account) === null || _a === void 0 ? void 0 : _a.homeAccountId;
|
|
203
272
|
}
|
|
204
273
|
return token;
|
|
@@ -220,13 +289,18 @@ class ApplicationKeyTokenProvider extends MsalTokenProvider {
|
|
|
220
289
|
auth: {
|
|
221
290
|
clientId: this.appClientId,
|
|
222
291
|
clientSecret: this.appKey,
|
|
223
|
-
authority:
|
|
224
|
-
}
|
|
292
|
+
authority: this.authorityUri,
|
|
293
|
+
},
|
|
225
294
|
};
|
|
226
295
|
this.msalClient = new msal_node_1.ConfidentialClientApplication(clientConfig);
|
|
227
296
|
}
|
|
228
297
|
acquireMsalToken() {
|
|
229
|
-
return this.msalClient.acquireTokenByClientCredential({
|
|
298
|
+
return this.msalClient.acquireTokenByClientCredential({
|
|
299
|
+
scopes: this.scopes,
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
context() {
|
|
303
|
+
return Object.assign(Object.assign({}, super.context()), { clientId: this.appClientId });
|
|
230
304
|
}
|
|
231
305
|
}
|
|
232
306
|
exports.ApplicationKeyTokenProvider = ApplicationKeyTokenProvider;
|
|
@@ -246,18 +320,23 @@ class ApplicationCertificateTokenProvider extends MsalTokenProvider {
|
|
|
246
320
|
const clientConfig = {
|
|
247
321
|
auth: {
|
|
248
322
|
clientId: this.appClientId,
|
|
249
|
-
authority:
|
|
323
|
+
authority: this.authorityUri,
|
|
250
324
|
clientCertificate: {
|
|
251
325
|
thumbprint: this.certThumbprint,
|
|
252
326
|
privateKey: this.certPrivateKey,
|
|
253
|
-
x5c: this.certX5c
|
|
254
|
-
}
|
|
255
|
-
}
|
|
327
|
+
x5c: this.certX5c,
|
|
328
|
+
},
|
|
329
|
+
},
|
|
256
330
|
};
|
|
257
331
|
this.msalClient = new msal_node_1.ConfidentialClientApplication(clientConfig);
|
|
258
332
|
}
|
|
259
333
|
acquireMsalToken() {
|
|
260
|
-
return this.msalClient.acquireTokenByClientCredential({
|
|
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 });
|
|
261
340
|
}
|
|
262
341
|
}
|
|
263
342
|
exports.ApplicationCertificateTokenProvider = ApplicationCertificateTokenProvider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokenProvider.js","sourceRoot":"","sources":["tokenProvider.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tokenProvider.js","sourceRoot":"","sources":["tokenProvider.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;;;AAElC,yFAAyF;AAEzF,gDAA0F;AAE1F,8CAAsI;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
+
"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
|
+
}
|