@azure/msal-node 3.0.1 → 3.1.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/dist/cache/NodeStorage.mjs +1 -1
- package/dist/cache/TokenCache.mjs +1 -1
- package/dist/cache/distributed/DistributedCachePlugin.mjs +1 -1
- package/dist/cache/serializer/Deserializer.mjs +1 -1
- package/dist/cache/serializer/Serializer.mjs +1 -1
- package/dist/client/ClientApplication.mjs +1 -1
- package/dist/client/ClientAssertion.mjs +1 -1
- package/dist/client/ClientCredentialClient.mjs +1 -1
- package/dist/client/ConfidentialClientApplication.d.ts +0 -1
- package/dist/client/ConfidentialClientApplication.d.ts.map +1 -1
- package/dist/client/ConfidentialClientApplication.mjs +40 -43
- package/dist/client/ConfidentialClientApplication.mjs.map +1 -1
- package/dist/client/DeviceCodeClient.mjs +1 -1
- package/dist/client/ManagedIdentityApplication.mjs +1 -1
- package/dist/client/ManagedIdentityClient.d.ts.map +1 -1
- package/dist/client/ManagedIdentityClient.mjs +10 -6
- package/dist/client/ManagedIdentityClient.mjs.map +1 -1
- package/dist/client/ManagedIdentitySources/AppService.mjs +1 -1
- package/dist/client/ManagedIdentitySources/AzureArc.mjs +1 -1
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts +3 -2
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts.map +1 -1
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs +7 -4
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs.map +1 -1
- package/dist/client/ManagedIdentitySources/CloudShell.mjs +1 -1
- package/dist/client/ManagedIdentitySources/Imds.d.ts.map +1 -1
- package/dist/client/ManagedIdentitySources/Imds.mjs +3 -2
- package/dist/client/ManagedIdentitySources/Imds.mjs.map +1 -1
- package/dist/client/ManagedIdentitySources/MachineLearning.d.ts +15 -0
- package/dist/client/ManagedIdentitySources/MachineLearning.d.ts.map +1 -0
- package/dist/client/ManagedIdentitySources/MachineLearning.mjs +51 -0
- package/dist/client/ManagedIdentitySources/MachineLearning.mjs.map +1 -0
- package/dist/client/ManagedIdentitySources/ServiceFabric.d.ts.map +1 -1
- package/dist/client/ManagedIdentitySources/ServiceFabric.mjs +3 -4
- package/dist/client/ManagedIdentitySources/ServiceFabric.mjs.map +1 -1
- package/dist/client/OnBehalfOfClient.mjs +1 -1
- package/dist/client/PublicClientApplication.mjs +1 -1
- package/dist/client/UsernamePasswordClient.mjs +1 -1
- package/dist/config/Configuration.mjs +1 -1
- package/dist/config/ManagedIdentityId.mjs +1 -1
- package/dist/config/ManagedIdentityRequestParameters.mjs +1 -1
- package/dist/crypto/CryptoProvider.mjs +1 -1
- package/dist/crypto/GuidGenerator.mjs +1 -1
- package/dist/crypto/HashUtils.mjs +1 -1
- package/dist/crypto/PkceGenerator.mjs +1 -1
- package/dist/error/ManagedIdentityError.mjs +1 -1
- package/dist/error/ManagedIdentityErrorCodes.mjs +1 -1
- package/dist/error/NodeAuthError.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/internals.mjs +1 -1
- package/dist/network/HttpClient.mjs +1 -1
- package/dist/network/HttpClientWithRetries.mjs +1 -1
- package/dist/network/LoopbackClient.mjs +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/retry/LinearRetryPolicy.mjs +1 -1
- package/dist/utils/Constants.d.ts +3 -1
- package/dist/utils/Constants.d.ts.map +1 -1
- package/dist/utils/Constants.mjs +5 -3
- package/dist/utils/Constants.mjs.map +1 -1
- package/dist/utils/EncodingUtils.mjs +1 -1
- package/dist/utils/NetworkUtils.mjs +1 -1
- package/lib/msal-node.cjs +164 -125
- package/lib/msal-node.cjs.map +1 -1
- package/lib/types/client/ConfidentialClientApplication.d.ts +0 -1
- package/lib/types/client/ConfidentialClientApplication.d.ts.map +1 -1
- package/lib/types/client/ManagedIdentityClient.d.ts.map +1 -1
- package/lib/types/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts +3 -2
- package/lib/types/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts.map +1 -1
- package/lib/types/client/ManagedIdentitySources/Imds.d.ts.map +1 -1
- package/lib/types/client/ManagedIdentitySources/MachineLearning.d.ts +15 -0
- package/lib/types/client/ManagedIdentitySources/MachineLearning.d.ts.map +1 -0
- package/lib/types/client/ManagedIdentitySources/ServiceFabric.d.ts.map +1 -1
- package/lib/types/packageMetadata.d.ts +1 -1
- package/lib/types/utils/Constants.d.ts +3 -1
- package/lib/types/utils/Constants.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/client/ConfidentialClientApplication.ts +57 -60
- package/src/client/ManagedIdentityClient.ts +11 -0
- package/src/client/ManagedIdentitySources/BaseManagedIdentitySource.ts +7 -3
- package/src/client/ManagedIdentitySources/Imds.ts +2 -1
- package/src/client/ManagedIdentitySources/MachineLearning.ts +123 -0
- package/src/client/ManagedIdentitySources/ServiceFabric.ts +2 -3
- package/src/packageMetadata.ts +1 -1
- package/src/utils/Constants.ts +3 -1
package/lib/msal-node.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-node v3.0
|
|
1
|
+
/*! @azure/msal-node v3.1.0 2025-01-22 */
|
|
2
2
|
'use strict';
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
@@ -152,7 +152,7 @@ class Serializer {
|
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
-
/*! @azure/msal-common v15.0.
|
|
155
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
156
156
|
/*
|
|
157
157
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
158
158
|
* Licensed under the MIT License.
|
|
@@ -445,7 +445,7 @@ const CacheOutcome = {
|
|
|
445
445
|
// Token renewal offset default in seconds
|
|
446
446
|
const DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;
|
|
447
447
|
|
|
448
|
-
/*! @azure/msal-common v15.0.
|
|
448
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
449
449
|
/*
|
|
450
450
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
451
451
|
* Licensed under the MIT License.
|
|
@@ -462,7 +462,7 @@ var AuthErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
462
462
|
unexpectedError: unexpectedError
|
|
463
463
|
});
|
|
464
464
|
|
|
465
|
-
/*! @azure/msal-common v15.0.
|
|
465
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
466
466
|
|
|
467
467
|
/*
|
|
468
468
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -511,7 +511,7 @@ function createAuthError(code, additionalMessage) {
|
|
|
511
511
|
: AuthErrorMessages[code]);
|
|
512
512
|
}
|
|
513
513
|
|
|
514
|
-
/*! @azure/msal-common v15.0.
|
|
514
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
515
515
|
/*
|
|
516
516
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
517
517
|
* Licensed under the MIT License.
|
|
@@ -609,7 +609,7 @@ var ClientAuthErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
609
609
|
userTimeoutReached: userTimeoutReached
|
|
610
610
|
});
|
|
611
611
|
|
|
612
|
-
/*! @azure/msal-common v15.0.
|
|
612
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
613
613
|
|
|
614
614
|
/*
|
|
615
615
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -861,7 +861,7 @@ function createClientAuthError(errorCode, additionalMessage) {
|
|
|
861
861
|
return new ClientAuthError(errorCode, additionalMessage);
|
|
862
862
|
}
|
|
863
863
|
|
|
864
|
-
/*! @azure/msal-common v15.0.
|
|
864
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
865
865
|
|
|
866
866
|
/*
|
|
867
867
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -900,7 +900,7 @@ const DEFAULT_CRYPTO_IMPLEMENTATION = {
|
|
|
900
900
|
},
|
|
901
901
|
};
|
|
902
902
|
|
|
903
|
-
/*! @azure/msal-common v15.0.
|
|
903
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
904
904
|
|
|
905
905
|
/*
|
|
906
906
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1091,12 +1091,12 @@ class Logger {
|
|
|
1091
1091
|
}
|
|
1092
1092
|
}
|
|
1093
1093
|
|
|
1094
|
-
/*! @azure/msal-common v15.0.
|
|
1094
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
1095
1095
|
/* eslint-disable header/header */
|
|
1096
1096
|
const name$1 = "@azure/msal-common";
|
|
1097
|
-
const version$1 = "15.0.
|
|
1097
|
+
const version$1 = "15.0.2";
|
|
1098
1098
|
|
|
1099
|
-
/*! @azure/msal-common v15.0.
|
|
1099
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
1100
1100
|
/*
|
|
1101
1101
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1102
1102
|
* Licensed under the MIT License.
|
|
@@ -1116,7 +1116,7 @@ const AzureCloudInstance = {
|
|
|
1116
1116
|
AzureUsGovernment: "https://login.microsoftonline.us",
|
|
1117
1117
|
};
|
|
1118
1118
|
|
|
1119
|
-
/*! @azure/msal-common v15.0.
|
|
1119
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
1120
1120
|
|
|
1121
1121
|
/*
|
|
1122
1122
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1177,7 +1177,7 @@ function checkMaxAge(authTime, maxAge) {
|
|
|
1177
1177
|
}
|
|
1178
1178
|
}
|
|
1179
1179
|
|
|
1180
|
-
/*! @azure/msal-common v15.0.
|
|
1180
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
1181
1181
|
/*
|
|
1182
1182
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1183
1183
|
* Licensed under the MIT License.
|
|
@@ -1222,7 +1222,7 @@ function delay(t, value) {
|
|
|
1222
1222
|
return new Promise((resolve) => setTimeout(() => resolve(value), t));
|
|
1223
1223
|
}
|
|
1224
1224
|
|
|
1225
|
-
/*! @azure/msal-common v15.0.
|
|
1225
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
1226
1226
|
|
|
1227
1227
|
/*
|
|
1228
1228
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1549,7 +1549,7 @@ function isAuthorityMetadataExpired(metadata) {
|
|
|
1549
1549
|
return metadata.expiresAt <= nowSeconds();
|
|
1550
1550
|
}
|
|
1551
1551
|
|
|
1552
|
-
/*! @azure/msal-common v15.0.
|
|
1552
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
1553
1553
|
/*
|
|
1554
1554
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1555
1555
|
* Licensed under the MIT License.
|
|
@@ -1603,7 +1603,7 @@ var ClientConfigurationErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
1603
1603
|
urlParseError: urlParseError
|
|
1604
1604
|
});
|
|
1605
1605
|
|
|
1606
|
-
/*! @azure/msal-common v15.0.
|
|
1606
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
1607
1607
|
|
|
1608
1608
|
/*
|
|
1609
1609
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1741,7 +1741,7 @@ function createClientConfigurationError(errorCode) {
|
|
|
1741
1741
|
return new ClientConfigurationError(errorCode);
|
|
1742
1742
|
}
|
|
1743
1743
|
|
|
1744
|
-
/*! @azure/msal-common v15.0.
|
|
1744
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
1745
1745
|
/*
|
|
1746
1746
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1747
1747
|
* Licensed under the MIT License.
|
|
@@ -1838,7 +1838,7 @@ class StringUtils {
|
|
|
1838
1838
|
}
|
|
1839
1839
|
}
|
|
1840
1840
|
|
|
1841
|
-
/*! @azure/msal-common v15.0.
|
|
1841
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
1842
1842
|
|
|
1843
1843
|
/*
|
|
1844
1844
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1858,8 +1858,10 @@ class ScopeSet {
|
|
|
1858
1858
|
const filteredInput = scopeArr
|
|
1859
1859
|
? StringUtils.removeEmptyStringsFromArray(scopeArr)
|
|
1860
1860
|
: [];
|
|
1861
|
-
//
|
|
1862
|
-
|
|
1861
|
+
// Check if scopes array has at least one member
|
|
1862
|
+
if (!filteredInput || !filteredInput.length) {
|
|
1863
|
+
throw createClientConfigurationError(emptyInputScopesError);
|
|
1864
|
+
}
|
|
1863
1865
|
this.scopes = new Set(); // Iterator in constructor not supported by IE11
|
|
1864
1866
|
filteredInput.forEach((scope) => this.scopes.add(scope));
|
|
1865
1867
|
}
|
|
@@ -1889,17 +1891,6 @@ class ScopeSet {
|
|
|
1889
1891
|
}
|
|
1890
1892
|
return scopeSet;
|
|
1891
1893
|
}
|
|
1892
|
-
/**
|
|
1893
|
-
* Used to validate the scopes input parameter requested by the developer.
|
|
1894
|
-
* @param {Array<string>} inputScopes - Developer requested permissions. Not all scopes are guaranteed to be included in the access token returned.
|
|
1895
|
-
* @param {boolean} scopesRequired - Boolean indicating whether the scopes array is required or not
|
|
1896
|
-
*/
|
|
1897
|
-
validateInputScopes(inputScopes) {
|
|
1898
|
-
// Check if scopes are required but not given or is an empty array
|
|
1899
|
-
if (!inputScopes || inputScopes.length < 1) {
|
|
1900
|
-
throw createClientConfigurationError(emptyInputScopesError);
|
|
1901
|
-
}
|
|
1902
|
-
}
|
|
1903
1894
|
/**
|
|
1904
1895
|
* Check if a given scope is present in this set of scopes.
|
|
1905
1896
|
* @param scope
|
|
@@ -2038,7 +2029,7 @@ class ScopeSet {
|
|
|
2038
2029
|
}
|
|
2039
2030
|
}
|
|
2040
2031
|
|
|
2041
|
-
/*! @azure/msal-common v15.0.
|
|
2032
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
2042
2033
|
|
|
2043
2034
|
/*
|
|
2044
2035
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2078,7 +2069,7 @@ function buildClientInfoFromHomeAccountId(homeAccountId) {
|
|
|
2078
2069
|
};
|
|
2079
2070
|
}
|
|
2080
2071
|
|
|
2081
|
-
/*! @azure/msal-common v15.0.
|
|
2072
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
2082
2073
|
/*
|
|
2083
2074
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2084
2075
|
* Licensed under the MIT License.
|
|
@@ -2157,7 +2148,7 @@ function updateAccountTenantProfileData(baseAccountInfo, tenantProfile, idTokenC
|
|
|
2157
2148
|
return updatedAccountInfo;
|
|
2158
2149
|
}
|
|
2159
2150
|
|
|
2160
|
-
/*! @azure/msal-common v15.0.
|
|
2151
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
2161
2152
|
/*
|
|
2162
2153
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2163
2154
|
* Licensed under the MIT License.
|
|
@@ -2172,7 +2163,7 @@ const AuthorityType = {
|
|
|
2172
2163
|
Ciam: 3,
|
|
2173
2164
|
};
|
|
2174
2165
|
|
|
2175
|
-
/*! @azure/msal-common v15.0.
|
|
2166
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
2176
2167
|
/*
|
|
2177
2168
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2178
2169
|
* Licensed under the MIT License.
|
|
@@ -2194,7 +2185,7 @@ function getTenantIdFromIdTokenClaims(idTokenClaims) {
|
|
|
2194
2185
|
return null;
|
|
2195
2186
|
}
|
|
2196
2187
|
|
|
2197
|
-
/*! @azure/msal-common v15.0.
|
|
2188
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
2198
2189
|
/*
|
|
2199
2190
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2200
2191
|
* Licensed under the MIT License.
|
|
@@ -2207,7 +2198,7 @@ const ProtocolMode = {
|
|
|
2207
2198
|
OIDC: "OIDC",
|
|
2208
2199
|
};
|
|
2209
2200
|
|
|
2210
|
-
/*! @azure/msal-common v15.0.
|
|
2201
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
2211
2202
|
|
|
2212
2203
|
/*
|
|
2213
2204
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2450,7 +2441,7 @@ class AccountEntity {
|
|
|
2450
2441
|
}
|
|
2451
2442
|
}
|
|
2452
2443
|
|
|
2453
|
-
/*! @azure/msal-common v15.0.
|
|
2444
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
2454
2445
|
|
|
2455
2446
|
/*
|
|
2456
2447
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2497,7 +2488,7 @@ function getDeserializedResponse(responseString) {
|
|
|
2497
2488
|
return null;
|
|
2498
2489
|
}
|
|
2499
2490
|
|
|
2500
|
-
/*! @azure/msal-common v15.0.
|
|
2491
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
2501
2492
|
|
|
2502
2493
|
/*
|
|
2503
2494
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2661,7 +2652,7 @@ class UrlString {
|
|
|
2661
2652
|
}
|
|
2662
2653
|
}
|
|
2663
2654
|
|
|
2664
|
-
/*! @azure/msal-common v15.0.
|
|
2655
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
2665
2656
|
|
|
2666
2657
|
/*
|
|
2667
2658
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2801,7 +2792,7 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
|
|
|
2801
2792
|
return null;
|
|
2802
2793
|
}
|
|
2803
2794
|
|
|
2804
|
-
/*! @azure/msal-common v15.0.
|
|
2795
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
2805
2796
|
/*
|
|
2806
2797
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2807
2798
|
* Licensed under the MIT License.
|
|
@@ -2809,7 +2800,7 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
|
|
|
2809
2800
|
const cacheQuotaExceededErrorCode = "cache_quota_exceeded";
|
|
2810
2801
|
const cacheUnknownErrorCode = "cache_error_unknown";
|
|
2811
2802
|
|
|
2812
|
-
/*! @azure/msal-common v15.0.
|
|
2803
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
2813
2804
|
|
|
2814
2805
|
/*
|
|
2815
2806
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2836,7 +2827,7 @@ class CacheError extends Error {
|
|
|
2836
2827
|
}
|
|
2837
2828
|
}
|
|
2838
2829
|
|
|
2839
|
-
/*! @azure/msal-common v15.0.
|
|
2830
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
2840
2831
|
|
|
2841
2832
|
/*
|
|
2842
2833
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4020,7 +4011,7 @@ class DefaultStorageClass extends CacheManager {
|
|
|
4020
4011
|
}
|
|
4021
4012
|
}
|
|
4022
4013
|
|
|
4023
|
-
/*! @azure/msal-common v15.0.
|
|
4014
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
4024
4015
|
|
|
4025
4016
|
/*
|
|
4026
4017
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4119,7 +4110,7 @@ function isOidcProtocolMode(config) {
|
|
|
4119
4110
|
return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);
|
|
4120
4111
|
}
|
|
4121
4112
|
|
|
4122
|
-
/*! @azure/msal-common v15.0.
|
|
4113
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
4123
4114
|
/*
|
|
4124
4115
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4125
4116
|
* Licensed under the MIT License.
|
|
@@ -4129,7 +4120,7 @@ const CcsCredentialType = {
|
|
|
4129
4120
|
UPN: "UPN",
|
|
4130
4121
|
};
|
|
4131
4122
|
|
|
4132
|
-
/*! @azure/msal-common v15.0.
|
|
4123
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
4133
4124
|
/*
|
|
4134
4125
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4135
4126
|
* Licensed under the MIT License.
|
|
@@ -4180,7 +4171,7 @@ const X_CLIENT_EXTRA_SKU = "x-client-xtra-sku";
|
|
|
4180
4171
|
const BROKER_CLIENT_ID = "brk_client_id";
|
|
4181
4172
|
const BROKER_REDIRECT_URI = "brk_redirect_uri";
|
|
4182
4173
|
|
|
4183
|
-
/*! @azure/msal-common v15.0.
|
|
4174
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
4184
4175
|
|
|
4185
4176
|
/*
|
|
4186
4177
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4247,7 +4238,7 @@ class RequestValidator {
|
|
|
4247
4238
|
}
|
|
4248
4239
|
}
|
|
4249
4240
|
|
|
4250
|
-
/*! @azure/msal-common v15.0.
|
|
4241
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
4251
4242
|
|
|
4252
4243
|
/*
|
|
4253
4244
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4655,7 +4646,7 @@ class RequestParameterBuilder {
|
|
|
4655
4646
|
}
|
|
4656
4647
|
}
|
|
4657
4648
|
|
|
4658
|
-
/*! @azure/msal-common v15.0.
|
|
4649
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
4659
4650
|
/*
|
|
4660
4651
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4661
4652
|
* Licensed under the MIT License.
|
|
@@ -4667,7 +4658,7 @@ function isOpenIdConfigResponse(response) {
|
|
|
4667
4658
|
response.hasOwnProperty("jwks_uri"));
|
|
4668
4659
|
}
|
|
4669
4660
|
|
|
4670
|
-
/*! @azure/msal-common v15.0.
|
|
4661
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
4671
4662
|
/*
|
|
4672
4663
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4673
4664
|
* Licensed under the MIT License.
|
|
@@ -4677,7 +4668,7 @@ function isCloudInstanceDiscoveryResponse(response) {
|
|
|
4677
4668
|
response.hasOwnProperty("metadata"));
|
|
4678
4669
|
}
|
|
4679
4670
|
|
|
4680
|
-
/*! @azure/msal-common v15.0.
|
|
4671
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
4681
4672
|
/*
|
|
4682
4673
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4683
4674
|
* Licensed under the MIT License.
|
|
@@ -4687,7 +4678,7 @@ function isCloudInstanceDiscoveryErrorResponse(response) {
|
|
|
4687
4678
|
response.hasOwnProperty("error_description"));
|
|
4688
4679
|
}
|
|
4689
4680
|
|
|
4690
|
-
/*! @azure/msal-common v15.0.
|
|
4681
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
4691
4682
|
/*
|
|
4692
4683
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4693
4684
|
* Licensed under the MIT License.
|
|
@@ -4941,7 +4932,7 @@ const PerformanceEvents = {
|
|
|
4941
4932
|
Decrypt: "decrypt",
|
|
4942
4933
|
};
|
|
4943
4934
|
|
|
4944
|
-
/*! @azure/msal-common v15.0.
|
|
4935
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
4945
4936
|
/*
|
|
4946
4937
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4947
4938
|
* Licensed under the MIT License.
|
|
@@ -5037,7 +5028,7 @@ const invokeAsync = (callback, eventName, logger, telemetryClient, correlationId
|
|
|
5037
5028
|
};
|
|
5038
5029
|
};
|
|
5039
5030
|
|
|
5040
|
-
/*! @azure/msal-common v15.0.
|
|
5031
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
5041
5032
|
|
|
5042
5033
|
/*
|
|
5043
5034
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5146,7 +5137,7 @@ RegionDiscovery.IMDS_OPTIONS = {
|
|
|
5146
5137
|
},
|
|
5147
5138
|
};
|
|
5148
5139
|
|
|
5149
|
-
/*! @azure/msal-common v15.0.
|
|
5140
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
5150
5141
|
|
|
5151
5142
|
/*
|
|
5152
5143
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5985,7 +5976,7 @@ function buildStaticAuthorityOptions(authOptions) {
|
|
|
5985
5976
|
};
|
|
5986
5977
|
}
|
|
5987
5978
|
|
|
5988
|
-
/*! @azure/msal-common v15.0.
|
|
5979
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
5989
5980
|
|
|
5990
5981
|
/*
|
|
5991
5982
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6016,7 +6007,7 @@ async function createDiscoveredInstance(authorityUri, networkClient, cacheManage
|
|
|
6016
6007
|
}
|
|
6017
6008
|
}
|
|
6018
6009
|
|
|
6019
|
-
/*! @azure/msal-common v15.0.
|
|
6010
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
6020
6011
|
|
|
6021
6012
|
/*
|
|
6022
6013
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6035,7 +6026,7 @@ class ServerError extends AuthError {
|
|
|
6035
6026
|
}
|
|
6036
6027
|
}
|
|
6037
6028
|
|
|
6038
|
-
/*! @azure/msal-common v15.0.
|
|
6029
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
6039
6030
|
|
|
6040
6031
|
/*
|
|
6041
6032
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6133,7 +6124,7 @@ class ThrottlingUtils {
|
|
|
6133
6124
|
}
|
|
6134
6125
|
}
|
|
6135
6126
|
|
|
6136
|
-
/*! @azure/msal-common v15.0.
|
|
6127
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
6137
6128
|
|
|
6138
6129
|
/*
|
|
6139
6130
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6153,7 +6144,7 @@ class NetworkError extends AuthError {
|
|
|
6153
6144
|
}
|
|
6154
6145
|
}
|
|
6155
6146
|
|
|
6156
|
-
/*! @azure/msal-common v15.0.
|
|
6147
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
6157
6148
|
|
|
6158
6149
|
/*
|
|
6159
6150
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6303,7 +6294,7 @@ class BaseClient {
|
|
|
6303
6294
|
}
|
|
6304
6295
|
}
|
|
6305
6296
|
|
|
6306
|
-
/*! @azure/msal-common v15.0.
|
|
6297
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
6307
6298
|
/*
|
|
6308
6299
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6309
6300
|
* Licensed under the MIT License.
|
|
@@ -6329,7 +6320,7 @@ var InteractionRequiredAuthErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
6329
6320
|
refreshTokenExpired: refreshTokenExpired
|
|
6330
6321
|
});
|
|
6331
6322
|
|
|
6332
|
-
/*! @azure/msal-common v15.0.
|
|
6323
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
6333
6324
|
|
|
6334
6325
|
/*
|
|
6335
6326
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6417,7 +6408,7 @@ function createInteractionRequiredAuthError(errorCode) {
|
|
|
6417
6408
|
return new InteractionRequiredAuthError(errorCode, InteractionRequiredAuthErrorMessages[errorCode]);
|
|
6418
6409
|
}
|
|
6419
6410
|
|
|
6420
|
-
/*! @azure/msal-common v15.0.
|
|
6411
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
6421
6412
|
|
|
6422
6413
|
/*
|
|
6423
6414
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6489,7 +6480,7 @@ class ProtocolUtils {
|
|
|
6489
6480
|
}
|
|
6490
6481
|
}
|
|
6491
6482
|
|
|
6492
|
-
/*! @azure/msal-common v15.0.
|
|
6483
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
6493
6484
|
|
|
6494
6485
|
/*
|
|
6495
6486
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6573,7 +6564,7 @@ class PopTokenGenerator {
|
|
|
6573
6564
|
}
|
|
6574
6565
|
}
|
|
6575
6566
|
|
|
6576
|
-
/*! @azure/msal-common v15.0.
|
|
6567
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
6577
6568
|
/*
|
|
6578
6569
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6579
6570
|
* Licensed under the MIT License.
|
|
@@ -6600,7 +6591,7 @@ class PopTokenGenerator {
|
|
|
6600
6591
|
}
|
|
6601
6592
|
}
|
|
6602
6593
|
|
|
6603
|
-
/*! @azure/msal-common v15.0.
|
|
6594
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
6604
6595
|
|
|
6605
6596
|
/*
|
|
6606
6597
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6977,7 +6968,7 @@ function buildAccountToCache(cacheStorage, authority, homeAccountId, base64Decod
|
|
|
6977
6968
|
return baseAccount;
|
|
6978
6969
|
}
|
|
6979
6970
|
|
|
6980
|
-
/*! @azure/msal-common v15.0.
|
|
6971
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
6981
6972
|
/*
|
|
6982
6973
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6983
6974
|
* Licensed under the MIT License.
|
|
@@ -6995,7 +6986,7 @@ async function getClientAssertion(clientAssertion, clientId, tokenEndpoint) {
|
|
|
6995
6986
|
}
|
|
6996
6987
|
}
|
|
6997
6988
|
|
|
6998
|
-
/*! @azure/msal-common v15.0.
|
|
6989
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
6999
6990
|
|
|
7000
6991
|
/*
|
|
7001
6992
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7437,7 +7428,7 @@ class AuthorizationCodeClient extends BaseClient {
|
|
|
7437
7428
|
}
|
|
7438
7429
|
}
|
|
7439
7430
|
|
|
7440
|
-
/*! @azure/msal-common v15.0.
|
|
7431
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
7441
7432
|
|
|
7442
7433
|
/*
|
|
7443
7434
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7657,7 +7648,7 @@ class RefreshTokenClient extends BaseClient {
|
|
|
7657
7648
|
}
|
|
7658
7649
|
}
|
|
7659
7650
|
|
|
7660
|
-
/*! @azure/msal-common v15.0.
|
|
7651
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
7661
7652
|
|
|
7662
7653
|
/*
|
|
7663
7654
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7793,7 +7784,7 @@ class SilentFlowClient extends BaseClient {
|
|
|
7793
7784
|
}
|
|
7794
7785
|
}
|
|
7795
7786
|
|
|
7796
|
-
/*! @azure/msal-common v15.0.
|
|
7787
|
+
/*! @azure/msal-common v15.0.2 2025-01-22 */
|
|
7797
7788
|
|
|
7798
7789
|
/*
|
|
7799
7790
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8248,7 +8239,7 @@ var internals = /*#__PURE__*/Object.freeze({
|
|
|
8248
8239
|
const AUTHORIZATION_HEADER_NAME = "Authorization";
|
|
8249
8240
|
const METADATA_HEADER_NAME = "Metadata";
|
|
8250
8241
|
const APP_SERVICE_SECRET_HEADER_NAME = "X-IDENTITY-HEADER";
|
|
8251
|
-
const
|
|
8242
|
+
const ML_AND_SF_SECRET_HEADER_NAME = "secret";
|
|
8252
8243
|
const API_VERSION_QUERY_PARAMETER_NAME = "api-version";
|
|
8253
8244
|
const RESOURCE_BODY_OR_QUERY_PARAMETER_NAME = "resource";
|
|
8254
8245
|
const DEFAULT_MANAGED_IDENTITY_ID = "system_assigned_managed_identity";
|
|
@@ -8264,6 +8255,7 @@ const ManagedIdentityEnvironmentVariableNames = {
|
|
|
8264
8255
|
IDENTITY_SERVER_THUMBPRINT: "IDENTITY_SERVER_THUMBPRINT",
|
|
8265
8256
|
IMDS_ENDPOINT: "IMDS_ENDPOINT",
|
|
8266
8257
|
MSI_ENDPOINT: "MSI_ENDPOINT",
|
|
8258
|
+
MSI_SECRET: "MSI_SECRET",
|
|
8267
8259
|
};
|
|
8268
8260
|
/**
|
|
8269
8261
|
* Managed Identity Source Names
|
|
@@ -8275,6 +8267,7 @@ const ManagedIdentitySourceNames = {
|
|
|
8275
8267
|
CLOUD_SHELL: "CloudShell",
|
|
8276
8268
|
DEFAULT_TO_IMDS: "DefaultToImds",
|
|
8277
8269
|
IMDS: "Imds",
|
|
8270
|
+
MACHINE_LEARNING: "MachineLearning",
|
|
8278
8271
|
SERVICE_FABRIC: "ServiceFabric",
|
|
8279
8272
|
};
|
|
8280
8273
|
/**
|
|
@@ -10141,7 +10134,7 @@ class ClientAssertion {
|
|
|
10141
10134
|
|
|
10142
10135
|
/* eslint-disable header/header */
|
|
10143
10136
|
const name = "@azure/msal-node";
|
|
10144
|
-
const version = "3.0
|
|
10137
|
+
const version = "3.1.0";
|
|
10145
10138
|
|
|
10146
10139
|
/*
|
|
10147
10140
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -11538,7 +11531,44 @@ class ConfidentialClientApplication extends ClientApplication {
|
|
|
11538
11531
|
*/
|
|
11539
11532
|
constructor(configuration) {
|
|
11540
11533
|
super(configuration);
|
|
11541
|
-
this.
|
|
11534
|
+
const clientSecretNotEmpty = !!this.config.auth.clientSecret;
|
|
11535
|
+
const clientAssertionNotEmpty = !!this.config.auth.clientAssertion;
|
|
11536
|
+
const certificateNotEmpty = (!!this.config.auth.clientCertificate?.thumbprint ||
|
|
11537
|
+
!!this.config.auth.clientCertificate?.thumbprintSha256) &&
|
|
11538
|
+
!!this.config.auth.clientCertificate?.privateKey;
|
|
11539
|
+
/*
|
|
11540
|
+
* If app developer configures this callback, they don't need a credential
|
|
11541
|
+
* i.e. AzureSDK can get token from Managed Identity without a cert / secret
|
|
11542
|
+
*/
|
|
11543
|
+
if (this.appTokenProvider) {
|
|
11544
|
+
return;
|
|
11545
|
+
}
|
|
11546
|
+
// Check that at most one credential is set on the application
|
|
11547
|
+
if ((clientSecretNotEmpty && clientAssertionNotEmpty) ||
|
|
11548
|
+
(clientAssertionNotEmpty && certificateNotEmpty) ||
|
|
11549
|
+
(clientSecretNotEmpty && certificateNotEmpty)) {
|
|
11550
|
+
throw createClientAuthError(invalidClientCredential);
|
|
11551
|
+
}
|
|
11552
|
+
if (this.config.auth.clientSecret) {
|
|
11553
|
+
this.clientSecret = this.config.auth.clientSecret;
|
|
11554
|
+
return;
|
|
11555
|
+
}
|
|
11556
|
+
if (this.config.auth.clientAssertion) {
|
|
11557
|
+
this.developerProvidedClientAssertion =
|
|
11558
|
+
this.config.auth.clientAssertion;
|
|
11559
|
+
return;
|
|
11560
|
+
}
|
|
11561
|
+
if (!certificateNotEmpty) {
|
|
11562
|
+
throw createClientAuthError(invalidClientCredential);
|
|
11563
|
+
}
|
|
11564
|
+
else {
|
|
11565
|
+
this.clientAssertion = !!this.config.auth.clientCertificate
|
|
11566
|
+
.thumbprintSha256
|
|
11567
|
+
? ClientAssertion.fromCertificateWithSha256Thumbprint(this.config.auth.clientCertificate.thumbprintSha256, this.config.auth.clientCertificate.privateKey, this.config.auth.clientCertificate.x5c)
|
|
11568
|
+
: ClientAssertion.fromCertificate(
|
|
11569
|
+
// guaranteed to be a string, due to prior error checking in this function
|
|
11570
|
+
this.config.auth.clientCertificate.thumbprint, this.config.auth.clientCertificate.privateKey, this.config.auth.clientCertificate.x5c);
|
|
11571
|
+
}
|
|
11542
11572
|
this.appTokenProvider = undefined;
|
|
11543
11573
|
}
|
|
11544
11574
|
/**
|
|
@@ -11648,46 +11678,6 @@ class ConfidentialClientApplication extends ClientApplication {
|
|
|
11648
11678
|
throw e;
|
|
11649
11679
|
}
|
|
11650
11680
|
}
|
|
11651
|
-
setClientCredential() {
|
|
11652
|
-
const clientSecretNotEmpty = !!this.config.auth.clientSecret;
|
|
11653
|
-
const clientAssertionNotEmpty = !!this.config.auth.clientAssertion;
|
|
11654
|
-
const certificateNotEmpty = (!!this.config.auth.clientCertificate?.thumbprint ||
|
|
11655
|
-
!!this.config.auth.clientCertificate?.thumbprintSha256) &&
|
|
11656
|
-
!!this.config.auth.clientCertificate?.privateKey;
|
|
11657
|
-
/*
|
|
11658
|
-
* If app developer configures this callback, they don't need a credential
|
|
11659
|
-
* i.e. AzureSDK can get token from Managed Identity without a cert / secret
|
|
11660
|
-
*/
|
|
11661
|
-
if (this.appTokenProvider) {
|
|
11662
|
-
return;
|
|
11663
|
-
}
|
|
11664
|
-
// Check that at most one credential is set on the application
|
|
11665
|
-
if ((clientSecretNotEmpty && clientAssertionNotEmpty) ||
|
|
11666
|
-
(clientAssertionNotEmpty && certificateNotEmpty) ||
|
|
11667
|
-
(clientSecretNotEmpty && certificateNotEmpty)) {
|
|
11668
|
-
throw createClientAuthError(invalidClientCredential);
|
|
11669
|
-
}
|
|
11670
|
-
if (this.config.auth.clientSecret) {
|
|
11671
|
-
this.clientSecret = this.config.auth.clientSecret;
|
|
11672
|
-
return;
|
|
11673
|
-
}
|
|
11674
|
-
if (this.config.auth.clientAssertion) {
|
|
11675
|
-
this.developerProvidedClientAssertion =
|
|
11676
|
-
this.config.auth.clientAssertion;
|
|
11677
|
-
return;
|
|
11678
|
-
}
|
|
11679
|
-
if (!certificateNotEmpty) {
|
|
11680
|
-
throw createClientAuthError(invalidClientCredential);
|
|
11681
|
-
}
|
|
11682
|
-
else {
|
|
11683
|
-
this.clientAssertion = !!this.config.auth.clientCertificate
|
|
11684
|
-
.thumbprintSha256
|
|
11685
|
-
? ClientAssertion.fromCertificateWithSha256Thumbprint(this.config.auth.clientCertificate.thumbprintSha256, this.config.auth.clientCertificate.privateKey, this.config.auth.clientCertificate.x5c)
|
|
11686
|
-
: ClientAssertion.fromCertificate(
|
|
11687
|
-
// guaranteed to be a string, due to prior error checking in this function
|
|
11688
|
-
this.config.auth.clientCertificate.thumbprint, this.config.auth.clientCertificate.privateKey, this.config.auth.clientCertificate.x5c);
|
|
11689
|
-
}
|
|
11690
|
-
}
|
|
11691
11681
|
}
|
|
11692
11682
|
|
|
11693
11683
|
/*
|
|
@@ -11700,7 +11690,8 @@ class ConfidentialClientApplication extends ClientApplication {
|
|
|
11700
11690
|
const ManagedIdentityUserAssignedIdQueryParameterNames = {
|
|
11701
11691
|
MANAGED_IDENTITY_CLIENT_ID: "client_id",
|
|
11702
11692
|
MANAGED_IDENTITY_OBJECT_ID: "object_id",
|
|
11703
|
-
|
|
11693
|
+
MANAGED_IDENTITY_RESOURCE_ID_IMDS: "msi_res_id",
|
|
11694
|
+
MANAGED_IDENTITY_RESOURCE_ID_NON_IMDS: "mi_res_id",
|
|
11704
11695
|
};
|
|
11705
11696
|
class BaseManagedIdentitySource {
|
|
11706
11697
|
constructor(logger, nodeStorage, networkClient, cryptoProvider) {
|
|
@@ -11787,14 +11778,16 @@ class BaseManagedIdentitySource {
|
|
|
11787
11778
|
// caches the token
|
|
11788
11779
|
return responseHandler.handleServerTokenResponse(serverTokenResponse, fakeAuthority, reqTimestamp, managedIdentityRequest);
|
|
11789
11780
|
}
|
|
11790
|
-
getManagedIdentityUserAssignedIdQueryParameterKey(managedIdentityIdType) {
|
|
11781
|
+
getManagedIdentityUserAssignedIdQueryParameterKey(managedIdentityIdType, imds) {
|
|
11791
11782
|
switch (managedIdentityIdType) {
|
|
11792
11783
|
case ManagedIdentityIdType.USER_ASSIGNED_CLIENT_ID:
|
|
11793
11784
|
this.logger.info("[Managed Identity] Adding user assigned client id to the request.");
|
|
11794
11785
|
return ManagedIdentityUserAssignedIdQueryParameterNames.MANAGED_IDENTITY_CLIENT_ID;
|
|
11795
11786
|
case ManagedIdentityIdType.USER_ASSIGNED_RESOURCE_ID:
|
|
11796
11787
|
this.logger.info("[Managed Identity] Adding user assigned resource id to the request.");
|
|
11797
|
-
return
|
|
11788
|
+
return imds
|
|
11789
|
+
? ManagedIdentityUserAssignedIdQueryParameterNames.MANAGED_IDENTITY_RESOURCE_ID_IMDS
|
|
11790
|
+
: ManagedIdentityUserAssignedIdQueryParameterNames.MANAGED_IDENTITY_RESOURCE_ID_NON_IMDS;
|
|
11798
11791
|
case ManagedIdentityIdType.USER_ASSIGNED_OBJECT_ID:
|
|
11799
11792
|
this.logger.info("[Managed Identity] Adding user assigned object id to the request.");
|
|
11800
11793
|
return ManagedIdentityUserAssignedIdQueryParameterNames.MANAGED_IDENTITY_OBJECT_ID;
|
|
@@ -12118,7 +12111,8 @@ class Imds extends BaseManagedIdentitySource {
|
|
|
12118
12111
|
request.queryParameters[RESOURCE_BODY_OR_QUERY_PARAMETER_NAME] =
|
|
12119
12112
|
resource;
|
|
12120
12113
|
if (managedIdentityId.idType !== ManagedIdentityIdType.SYSTEM_ASSIGNED) {
|
|
12121
|
-
request.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(managedIdentityId.idType
|
|
12114
|
+
request.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(managedIdentityId.idType, true // indicates source is IMDS
|
|
12115
|
+
)] = managedIdentityId.id;
|
|
12122
12116
|
}
|
|
12123
12117
|
// bodyParameters calculated in BaseManagedIdentity.acquireTokenWithManagedIdentity
|
|
12124
12118
|
return request;
|
|
@@ -12166,8 +12160,7 @@ class ServiceFabric extends BaseManagedIdentitySource {
|
|
|
12166
12160
|
}
|
|
12167
12161
|
createRequest(resource, managedIdentityId) {
|
|
12168
12162
|
const request = new ManagedIdentityRequestParameters(HttpMethod.GET, this.identityEndpoint);
|
|
12169
|
-
request.headers[
|
|
12170
|
-
this.identityHeader;
|
|
12163
|
+
request.headers[ML_AND_SF_SECRET_HEADER_NAME] = this.identityHeader;
|
|
12171
12164
|
request.queryParameters[API_VERSION_QUERY_PARAMETER_NAME] =
|
|
12172
12165
|
SERVICE_FABRIC_MSI_API_VERSION;
|
|
12173
12166
|
request.queryParameters[RESOURCE_BODY_OR_QUERY_PARAMETER_NAME] =
|
|
@@ -12180,6 +12173,49 @@ class ServiceFabric extends BaseManagedIdentitySource {
|
|
|
12180
12173
|
}
|
|
12181
12174
|
}
|
|
12182
12175
|
|
|
12176
|
+
/*
|
|
12177
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
12178
|
+
* Licensed under the MIT License.
|
|
12179
|
+
*/
|
|
12180
|
+
const MACHINE_LEARNING_MSI_API_VERSION = "2017-09-01";
|
|
12181
|
+
class MachineLearning extends BaseManagedIdentitySource {
|
|
12182
|
+
constructor(logger, nodeStorage, networkClient, cryptoProvider, msiEndpoint, secret) {
|
|
12183
|
+
super(logger, nodeStorage, networkClient, cryptoProvider);
|
|
12184
|
+
this.msiEndpoint = msiEndpoint;
|
|
12185
|
+
this.secret = secret;
|
|
12186
|
+
}
|
|
12187
|
+
static getEnvironmentVariables() {
|
|
12188
|
+
const msiEndpoint = process.env[ManagedIdentityEnvironmentVariableNames.MSI_ENDPOINT];
|
|
12189
|
+
const secret = process.env[ManagedIdentityEnvironmentVariableNames.MSI_SECRET];
|
|
12190
|
+
return [msiEndpoint, secret];
|
|
12191
|
+
}
|
|
12192
|
+
static tryCreate(logger, nodeStorage, networkClient, cryptoProvider) {
|
|
12193
|
+
const [msiEndpoint, secret] = MachineLearning.getEnvironmentVariables();
|
|
12194
|
+
// if either of the MSI endpoint or MSI secret variables are undefined, this MSI provider is unavailable.
|
|
12195
|
+
if (!msiEndpoint || !secret) {
|
|
12196
|
+
logger.info(`[Managed Identity] ${ManagedIdentitySourceNames.MACHINE_LEARNING} managed identity is unavailable because one or both of the '${ManagedIdentityEnvironmentVariableNames.MSI_ENDPOINT}' and '${ManagedIdentityEnvironmentVariableNames.MSI_SECRET}' environment variables are not defined.`);
|
|
12197
|
+
return null;
|
|
12198
|
+
}
|
|
12199
|
+
const validatedMsiEndpoint = MachineLearning.getValidatedEnvVariableUrlString(ManagedIdentityEnvironmentVariableNames.MSI_ENDPOINT, msiEndpoint, ManagedIdentitySourceNames.MACHINE_LEARNING, logger);
|
|
12200
|
+
logger.info(`[Managed Identity] Environment variables validation passed for ${ManagedIdentitySourceNames.MACHINE_LEARNING} managed identity. Endpoint URI: ${validatedMsiEndpoint}. Creating ${ManagedIdentitySourceNames.MACHINE_LEARNING} managed identity.`);
|
|
12201
|
+
return new MachineLearning(logger, nodeStorage, networkClient, cryptoProvider, msiEndpoint, secret);
|
|
12202
|
+
}
|
|
12203
|
+
createRequest(resource, managedIdentityId) {
|
|
12204
|
+
const request = new ManagedIdentityRequestParameters(HttpMethod.GET, this.msiEndpoint);
|
|
12205
|
+
request.headers[METADATA_HEADER_NAME] = "true";
|
|
12206
|
+
request.headers[ML_AND_SF_SECRET_HEADER_NAME] = this.secret;
|
|
12207
|
+
request.queryParameters[API_VERSION_QUERY_PARAMETER_NAME] =
|
|
12208
|
+
MACHINE_LEARNING_MSI_API_VERSION;
|
|
12209
|
+
request.queryParameters[RESOURCE_BODY_OR_QUERY_PARAMETER_NAME] =
|
|
12210
|
+
resource;
|
|
12211
|
+
if (managedIdentityId.idType !== ManagedIdentityIdType.SYSTEM_ASSIGNED) {
|
|
12212
|
+
request.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(managedIdentityId.idType)] = managedIdentityId.id;
|
|
12213
|
+
}
|
|
12214
|
+
// bodyParameters calculated in BaseManagedIdentity.acquireTokenWithManagedIdentity
|
|
12215
|
+
return request;
|
|
12216
|
+
}
|
|
12217
|
+
}
|
|
12218
|
+
|
|
12183
12219
|
/*
|
|
12184
12220
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
12185
12221
|
* Licensed under the MIT License.
|
|
@@ -12217,11 +12253,13 @@ class ManagedIdentityClient {
|
|
|
12217
12253
|
? ManagedIdentitySourceNames.SERVICE_FABRIC
|
|
12218
12254
|
: this.allEnvironmentVariablesAreDefined(AppService.getEnvironmentVariables())
|
|
12219
12255
|
? ManagedIdentitySourceNames.APP_SERVICE
|
|
12220
|
-
: this.allEnvironmentVariablesAreDefined(
|
|
12221
|
-
? ManagedIdentitySourceNames.
|
|
12222
|
-
: this.allEnvironmentVariablesAreDefined(
|
|
12223
|
-
? ManagedIdentitySourceNames.
|
|
12224
|
-
:
|
|
12256
|
+
: this.allEnvironmentVariablesAreDefined(MachineLearning.getEnvironmentVariables())
|
|
12257
|
+
? ManagedIdentitySourceNames.MACHINE_LEARNING
|
|
12258
|
+
: this.allEnvironmentVariablesAreDefined(CloudShell.getEnvironmentVariables())
|
|
12259
|
+
? ManagedIdentitySourceNames.CLOUD_SHELL
|
|
12260
|
+
: this.allEnvironmentVariablesAreDefined(AzureArc.getEnvironmentVariables())
|
|
12261
|
+
? ManagedIdentitySourceNames.AZURE_ARC
|
|
12262
|
+
: ManagedIdentitySourceNames.DEFAULT_TO_IMDS;
|
|
12225
12263
|
return ManagedIdentityClient.sourceName;
|
|
12226
12264
|
}
|
|
12227
12265
|
/**
|
|
@@ -12231,6 +12269,7 @@ class ManagedIdentityClient {
|
|
|
12231
12269
|
selectManagedIdentitySource(logger, nodeStorage, networkClient, cryptoProvider, managedIdentityId) {
|
|
12232
12270
|
const source = ServiceFabric.tryCreate(logger, nodeStorage, networkClient, cryptoProvider, managedIdentityId) ||
|
|
12233
12271
|
AppService.tryCreate(logger, nodeStorage, networkClient, cryptoProvider) ||
|
|
12272
|
+
MachineLearning.tryCreate(logger, nodeStorage, networkClient, cryptoProvider) ||
|
|
12234
12273
|
CloudShell.tryCreate(logger, nodeStorage, networkClient, cryptoProvider, managedIdentityId) ||
|
|
12235
12274
|
AzureArc.tryCreate(logger, nodeStorage, networkClient, cryptoProvider, managedIdentityId) ||
|
|
12236
12275
|
Imds.tryCreate(logger, nodeStorage, networkClient, cryptoProvider);
|