@azure/msal-node 3.2.2 → 3.3.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/README.md +3 -1
- 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.d.ts +1 -0
- package/dist/client/ClientApplication.d.ts.map +1 -1
- package/dist/client/ClientApplication.mjs +2 -1
- package/dist/client/ClientApplication.mjs.map +1 -1
- package/dist/client/ClientAssertion.mjs +1 -1
- package/dist/client/ClientCredentialClient.mjs +1 -1
- package/dist/client/ConfidentialClientApplication.mjs +1 -1
- package/dist/client/DeviceCodeClient.mjs +1 -1
- package/dist/client/IConfidentialClientApplication.d.ts +4 -1
- package/dist/client/IConfidentialClientApplication.d.ts.map +1 -1
- package/dist/client/IPublicClientApplication.d.ts +4 -1
- package/dist/client/IPublicClientApplication.d.ts.map +1 -1
- package/dist/client/ManagedIdentityApplication.d.ts.map +1 -1
- package/dist/client/ManagedIdentityApplication.mjs +2 -2
- package/dist/client/ManagedIdentityApplication.mjs.map +1 -1
- package/dist/client/ManagedIdentityClient.d.ts +2 -1
- package/dist/client/ManagedIdentityClient.d.ts.map +1 -1
- package/dist/client/ManagedIdentityClient.mjs +11 -10
- package/dist/client/ManagedIdentityClient.mjs.map +1 -1
- package/dist/client/ManagedIdentitySources/AppService.d.ts +2 -2
- package/dist/client/ManagedIdentitySources/AppService.d.ts.map +1 -1
- package/dist/client/ManagedIdentitySources/AppService.mjs +5 -5
- package/dist/client/ManagedIdentitySources/AppService.mjs.map +1 -1
- package/dist/client/ManagedIdentitySources/AzureArc.d.ts +2 -2
- package/dist/client/ManagedIdentitySources/AzureArc.d.ts.map +1 -1
- package/dist/client/ManagedIdentitySources/AzureArc.mjs +5 -5
- package/dist/client/ManagedIdentitySources/AzureArc.mjs.map +1 -1
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts +2 -1
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts.map +1 -1
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs +15 -5
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs.map +1 -1
- package/dist/client/ManagedIdentitySources/CloudShell.d.ts +2 -2
- package/dist/client/ManagedIdentitySources/CloudShell.d.ts.map +1 -1
- package/dist/client/ManagedIdentitySources/CloudShell.mjs +5 -5
- package/dist/client/ManagedIdentitySources/CloudShell.mjs.map +1 -1
- package/dist/client/ManagedIdentitySources/Imds.d.ts +2 -2
- package/dist/client/ManagedIdentitySources/Imds.d.ts.map +1 -1
- package/dist/client/ManagedIdentitySources/Imds.mjs +5 -5
- package/dist/client/ManagedIdentitySources/Imds.mjs.map +1 -1
- package/dist/client/ManagedIdentitySources/MachineLearning.d.ts +2 -2
- package/dist/client/ManagedIdentitySources/MachineLearning.d.ts.map +1 -1
- package/dist/client/ManagedIdentitySources/MachineLearning.mjs +5 -5
- package/dist/client/ManagedIdentitySources/MachineLearning.mjs.map +1 -1
- package/dist/client/ManagedIdentitySources/ServiceFabric.d.ts +2 -2
- package/dist/client/ManagedIdentitySources/ServiceFabric.d.ts.map +1 -1
- package/dist/client/ManagedIdentitySources/ServiceFabric.mjs +5 -5
- 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.d.ts +1 -0
- package/dist/client/UsernamePasswordClient.d.ts.map +1 -1
- package/dist/client/UsernamePasswordClient.mjs +2 -1
- package/dist/client/UsernamePasswordClient.mjs.map +1 -1
- package/dist/config/Configuration.d.ts +1 -0
- package/dist/config/Configuration.d.ts.map +1 -1
- package/dist/config/Configuration.mjs +2 -9
- package/dist/config/Configuration.mjs.map +1 -1
- package/dist/config/ManagedIdentityId.mjs +1 -1
- package/dist/config/ManagedIdentityRequestParameters.d.ts +3 -2
- package/dist/config/ManagedIdentityRequestParameters.d.ts.map +1 -1
- package/dist/config/ManagedIdentityRequestParameters.mjs +6 -2
- package/dist/config/ManagedIdentityRequestParameters.mjs.map +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 +5 -0
- package/dist/utils/Constants.d.ts.map +1 -1
- package/dist/utils/Constants.mjs +1 -1
- package/dist/utils/Constants.mjs.map +1 -1
- package/dist/utils/EncodingUtils.mjs +1 -1
- package/dist/utils/NetworkUtils.mjs +1 -1
- package/dist/utils/TimeUtils.mjs +1 -1
- package/lib/msal-node.cjs +227 -218
- package/lib/msal-node.cjs.map +1 -1
- package/lib/types/client/ClientApplication.d.ts +1 -0
- package/lib/types/client/ClientApplication.d.ts.map +1 -1
- package/lib/types/client/IConfidentialClientApplication.d.ts +4 -1
- package/lib/types/client/IConfidentialClientApplication.d.ts.map +1 -1
- package/lib/types/client/IPublicClientApplication.d.ts +4 -1
- package/lib/types/client/IPublicClientApplication.d.ts.map +1 -1
- package/lib/types/client/ManagedIdentityApplication.d.ts.map +1 -1
- package/lib/types/client/ManagedIdentityClient.d.ts +2 -1
- package/lib/types/client/ManagedIdentityClient.d.ts.map +1 -1
- package/lib/types/client/ManagedIdentitySources/AppService.d.ts +2 -2
- package/lib/types/client/ManagedIdentitySources/AppService.d.ts.map +1 -1
- package/lib/types/client/ManagedIdentitySources/AzureArc.d.ts +2 -2
- package/lib/types/client/ManagedIdentitySources/AzureArc.d.ts.map +1 -1
- package/lib/types/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts +2 -1
- package/lib/types/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts.map +1 -1
- package/lib/types/client/ManagedIdentitySources/CloudShell.d.ts +2 -2
- package/lib/types/client/ManagedIdentitySources/CloudShell.d.ts.map +1 -1
- package/lib/types/client/ManagedIdentitySources/Imds.d.ts +2 -2
- package/lib/types/client/ManagedIdentitySources/Imds.d.ts.map +1 -1
- package/lib/types/client/ManagedIdentitySources/MachineLearning.d.ts +2 -2
- package/lib/types/client/ManagedIdentitySources/MachineLearning.d.ts.map +1 -1
- package/lib/types/client/ManagedIdentitySources/ServiceFabric.d.ts +2 -2
- package/lib/types/client/ManagedIdentitySources/ServiceFabric.d.ts.map +1 -1
- package/lib/types/client/UsernamePasswordClient.d.ts +1 -0
- package/lib/types/client/UsernamePasswordClient.d.ts.map +1 -1
- package/lib/types/config/Configuration.d.ts +1 -0
- package/lib/types/config/Configuration.d.ts.map +1 -1
- package/lib/types/config/ManagedIdentityRequestParameters.d.ts +3 -2
- package/lib/types/config/ManagedIdentityRequestParameters.d.ts.map +1 -1
- package/lib/types/packageMetadata.d.ts +1 -1
- package/lib/types/utils/Constants.d.ts +5 -0
- package/lib/types/utils/Constants.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/client/ClientApplication.ts +1 -0
- package/src/client/IConfidentialClientApplication.ts +4 -1
- package/src/client/IPublicClientApplication.ts +4 -1
- package/src/client/ManagedIdentityApplication.ts +2 -1
- package/src/client/ManagedIdentityClient.ts +20 -4
- package/src/client/ManagedIdentitySources/AppService.ts +11 -2
- package/src/client/ManagedIdentitySources/AzureArc.ts +10 -1
- package/src/client/ManagedIdentitySources/BaseManagedIdentitySource.ts +20 -4
- package/src/client/ManagedIdentitySources/CloudShell.ts +10 -1
- package/src/client/ManagedIdentitySources/Imds.ts +11 -2
- package/src/client/ManagedIdentitySources/MachineLearning.ts +11 -2
- package/src/client/ManagedIdentitySources/ServiceFabric.ts +10 -1
- package/src/client/UsernamePasswordClient.ts +1 -0
- package/src/config/Configuration.ts +2 -20
- package/src/config/ManagedIdentityRequestParameters.ts +21 -2
- package/src/packageMetadata.ts +1 -1
- package/src/utils/Constants.ts +6 -0
package/lib/msal-node.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-node v3.
|
|
1
|
+
/*! @azure/msal-node v3.3.0 2025-03-11 */
|
|
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.
|
|
155
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
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.
|
|
448
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
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.
|
|
465
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
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.
|
|
514
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
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.
|
|
612
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
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.
|
|
864
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
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.
|
|
903
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
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.
|
|
1094
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
1095
1095
|
/* eslint-disable header/header */
|
|
1096
1096
|
const name$1 = "@azure/msal-common";
|
|
1097
|
-
const version$1 = "15.
|
|
1097
|
+
const version$1 = "15.2.1";
|
|
1098
1098
|
|
|
1099
|
-
/*! @azure/msal-common v15.
|
|
1099
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
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.
|
|
1119
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
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.
|
|
1180
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
1181
1181
|
/*
|
|
1182
1182
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1183
1183
|
* Licensed under the MIT License.
|
|
@@ -1192,6 +1192,16 @@ function nowSeconds() {
|
|
|
1192
1192
|
// Date.getTime() returns in milliseconds.
|
|
1193
1193
|
return Math.round(new Date().getTime() / 1000.0);
|
|
1194
1194
|
}
|
|
1195
|
+
/**
|
|
1196
|
+
* Convert seconds to JS Date object. Seconds can be in a number or string format or undefined (will still return a date).
|
|
1197
|
+
* @param seconds
|
|
1198
|
+
*/
|
|
1199
|
+
function toDateFromSeconds(seconds) {
|
|
1200
|
+
if (seconds) {
|
|
1201
|
+
return new Date(Number(seconds) * 1000);
|
|
1202
|
+
}
|
|
1203
|
+
return new Date();
|
|
1204
|
+
}
|
|
1195
1205
|
/**
|
|
1196
1206
|
* check if a token is expired based on given UTC time in seconds.
|
|
1197
1207
|
* @param expiresOn
|
|
@@ -1222,7 +1232,7 @@ function delay(t, value) {
|
|
|
1222
1232
|
return new Promise((resolve) => setTimeout(() => resolve(value), t));
|
|
1223
1233
|
}
|
|
1224
1234
|
|
|
1225
|
-
/*! @azure/msal-common v15.
|
|
1235
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
1226
1236
|
|
|
1227
1237
|
/*
|
|
1228
1238
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1549,7 +1559,7 @@ function isAuthorityMetadataExpired(metadata) {
|
|
|
1549
1559
|
return metadata.expiresAt <= nowSeconds();
|
|
1550
1560
|
}
|
|
1551
1561
|
|
|
1552
|
-
/*! @azure/msal-common v15.
|
|
1562
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
1553
1563
|
/*
|
|
1554
1564
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1555
1565
|
* Licensed under the MIT License.
|
|
@@ -1603,7 +1613,7 @@ var ClientConfigurationErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
1603
1613
|
urlParseError: urlParseError
|
|
1604
1614
|
});
|
|
1605
1615
|
|
|
1606
|
-
/*! @azure/msal-common v15.
|
|
1616
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
1607
1617
|
|
|
1608
1618
|
/*
|
|
1609
1619
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1741,7 +1751,7 @@ function createClientConfigurationError(errorCode) {
|
|
|
1741
1751
|
return new ClientConfigurationError(errorCode);
|
|
1742
1752
|
}
|
|
1743
1753
|
|
|
1744
|
-
/*! @azure/msal-common v15.
|
|
1754
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
1745
1755
|
/*
|
|
1746
1756
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1747
1757
|
* Licensed under the MIT License.
|
|
@@ -1838,7 +1848,7 @@ class StringUtils {
|
|
|
1838
1848
|
}
|
|
1839
1849
|
}
|
|
1840
1850
|
|
|
1841
|
-
/*! @azure/msal-common v15.
|
|
1851
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
1842
1852
|
|
|
1843
1853
|
/*
|
|
1844
1854
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2029,7 +2039,7 @@ class ScopeSet {
|
|
|
2029
2039
|
}
|
|
2030
2040
|
}
|
|
2031
2041
|
|
|
2032
|
-
/*! @azure/msal-common v15.
|
|
2042
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
2033
2043
|
|
|
2034
2044
|
/*
|
|
2035
2045
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2069,7 +2079,7 @@ function buildClientInfoFromHomeAccountId(homeAccountId) {
|
|
|
2069
2079
|
};
|
|
2070
2080
|
}
|
|
2071
2081
|
|
|
2072
|
-
/*! @azure/msal-common v15.
|
|
2082
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
2073
2083
|
/*
|
|
2074
2084
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2075
2085
|
* Licensed under the MIT License.
|
|
@@ -2148,7 +2158,7 @@ function updateAccountTenantProfileData(baseAccountInfo, tenantProfile, idTokenC
|
|
|
2148
2158
|
return updatedAccountInfo;
|
|
2149
2159
|
}
|
|
2150
2160
|
|
|
2151
|
-
/*! @azure/msal-common v15.
|
|
2161
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
2152
2162
|
/*
|
|
2153
2163
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2154
2164
|
* Licensed under the MIT License.
|
|
@@ -2163,7 +2173,7 @@ const AuthorityType = {
|
|
|
2163
2173
|
Ciam: 3,
|
|
2164
2174
|
};
|
|
2165
2175
|
|
|
2166
|
-
/*! @azure/msal-common v15.
|
|
2176
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
2167
2177
|
/*
|
|
2168
2178
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2169
2179
|
* Licensed under the MIT License.
|
|
@@ -2185,7 +2195,7 @@ function getTenantIdFromIdTokenClaims(idTokenClaims) {
|
|
|
2185
2195
|
return null;
|
|
2186
2196
|
}
|
|
2187
2197
|
|
|
2188
|
-
/*! @azure/msal-common v15.
|
|
2198
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
2189
2199
|
/*
|
|
2190
2200
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2191
2201
|
* Licensed under the MIT License.
|
|
@@ -2198,7 +2208,7 @@ const ProtocolMode = {
|
|
|
2198
2208
|
OIDC: "OIDC",
|
|
2199
2209
|
};
|
|
2200
2210
|
|
|
2201
|
-
/*! @azure/msal-common v15.
|
|
2211
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
2202
2212
|
|
|
2203
2213
|
/*
|
|
2204
2214
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2441,7 +2451,7 @@ class AccountEntity {
|
|
|
2441
2451
|
}
|
|
2442
2452
|
}
|
|
2443
2453
|
|
|
2444
|
-
/*! @azure/msal-common v15.
|
|
2454
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
2445
2455
|
|
|
2446
2456
|
/*
|
|
2447
2457
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2488,7 +2498,7 @@ function getDeserializedResponse(responseString) {
|
|
|
2488
2498
|
return null;
|
|
2489
2499
|
}
|
|
2490
2500
|
|
|
2491
|
-
/*! @azure/msal-common v15.
|
|
2501
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
2492
2502
|
|
|
2493
2503
|
/*
|
|
2494
2504
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2652,7 +2662,7 @@ class UrlString {
|
|
|
2652
2662
|
}
|
|
2653
2663
|
}
|
|
2654
2664
|
|
|
2655
|
-
/*! @azure/msal-common v15.
|
|
2665
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
2656
2666
|
|
|
2657
2667
|
/*
|
|
2658
2668
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2792,7 +2802,7 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
|
|
|
2792
2802
|
return null;
|
|
2793
2803
|
}
|
|
2794
2804
|
|
|
2795
|
-
/*! @azure/msal-common v15.
|
|
2805
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
2796
2806
|
/*
|
|
2797
2807
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2798
2808
|
* Licensed under the MIT License.
|
|
@@ -2800,7 +2810,7 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
|
|
|
2800
2810
|
const cacheQuotaExceededErrorCode = "cache_quota_exceeded";
|
|
2801
2811
|
const cacheUnknownErrorCode = "cache_error_unknown";
|
|
2802
2812
|
|
|
2803
|
-
/*! @azure/msal-common v15.
|
|
2813
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
2804
2814
|
|
|
2805
2815
|
/*
|
|
2806
2816
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2827,7 +2837,7 @@ class CacheError extends Error {
|
|
|
2827
2837
|
}
|
|
2828
2838
|
}
|
|
2829
2839
|
|
|
2830
|
-
/*! @azure/msal-common v15.
|
|
2840
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
2831
2841
|
|
|
2832
2842
|
/*
|
|
2833
2843
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4011,7 +4021,7 @@ class DefaultStorageClass extends CacheManager {
|
|
|
4011
4021
|
}
|
|
4012
4022
|
}
|
|
4013
4023
|
|
|
4014
|
-
/*! @azure/msal-common v15.
|
|
4024
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
4015
4025
|
|
|
4016
4026
|
/*
|
|
4017
4027
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4110,7 +4120,7 @@ function isOidcProtocolMode(config) {
|
|
|
4110
4120
|
return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);
|
|
4111
4121
|
}
|
|
4112
4122
|
|
|
4113
|
-
/*! @azure/msal-common v15.
|
|
4123
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
4114
4124
|
/*
|
|
4115
4125
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4116
4126
|
* Licensed under the MIT License.
|
|
@@ -4120,7 +4130,7 @@ const CcsCredentialType = {
|
|
|
4120
4130
|
UPN: "UPN",
|
|
4121
4131
|
};
|
|
4122
4132
|
|
|
4123
|
-
/*! @azure/msal-common v15.
|
|
4133
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
4124
4134
|
/*
|
|
4125
4135
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4126
4136
|
* Licensed under the MIT License.
|
|
@@ -4171,7 +4181,7 @@ const X_CLIENT_EXTRA_SKU = "x-client-xtra-sku";
|
|
|
4171
4181
|
const BROKER_CLIENT_ID = "brk_client_id";
|
|
4172
4182
|
const BROKER_REDIRECT_URI = "brk_redirect_uri";
|
|
4173
4183
|
|
|
4174
|
-
/*! @azure/msal-common v15.
|
|
4184
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
4175
4185
|
|
|
4176
4186
|
/*
|
|
4177
4187
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4238,7 +4248,7 @@ class RequestValidator {
|
|
|
4238
4248
|
}
|
|
4239
4249
|
}
|
|
4240
4250
|
|
|
4241
|
-
/*! @azure/msal-common v15.
|
|
4251
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
4242
4252
|
|
|
4243
4253
|
/*
|
|
4244
4254
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4646,7 +4656,7 @@ class RequestParameterBuilder {
|
|
|
4646
4656
|
}
|
|
4647
4657
|
}
|
|
4648
4658
|
|
|
4649
|
-
/*! @azure/msal-common v15.
|
|
4659
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
4650
4660
|
/*
|
|
4651
4661
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4652
4662
|
* Licensed under the MIT License.
|
|
@@ -4658,7 +4668,7 @@ function isOpenIdConfigResponse(response) {
|
|
|
4658
4668
|
response.hasOwnProperty("jwks_uri"));
|
|
4659
4669
|
}
|
|
4660
4670
|
|
|
4661
|
-
/*! @azure/msal-common v15.
|
|
4671
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
4662
4672
|
/*
|
|
4663
4673
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4664
4674
|
* Licensed under the MIT License.
|
|
@@ -4668,7 +4678,7 @@ function isCloudInstanceDiscoveryResponse(response) {
|
|
|
4668
4678
|
response.hasOwnProperty("metadata"));
|
|
4669
4679
|
}
|
|
4670
4680
|
|
|
4671
|
-
/*! @azure/msal-common v15.
|
|
4681
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
4672
4682
|
/*
|
|
4673
4683
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4674
4684
|
* Licensed under the MIT License.
|
|
@@ -4678,7 +4688,7 @@ function isCloudInstanceDiscoveryErrorResponse(response) {
|
|
|
4678
4688
|
response.hasOwnProperty("error_description"));
|
|
4679
4689
|
}
|
|
4680
4690
|
|
|
4681
|
-
/*! @azure/msal-common v15.
|
|
4691
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
4682
4692
|
/*
|
|
4683
4693
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4684
4694
|
* Licensed under the MIT License.
|
|
@@ -4933,7 +4943,7 @@ const PerformanceEvents = {
|
|
|
4933
4943
|
Decrypt: "decrypt",
|
|
4934
4944
|
};
|
|
4935
4945
|
|
|
4936
|
-
/*! @azure/msal-common v15.
|
|
4946
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
4937
4947
|
/*
|
|
4938
4948
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4939
4949
|
* Licensed under the MIT License.
|
|
@@ -5029,7 +5039,7 @@ const invokeAsync = (callback, eventName, logger, telemetryClient, correlationId
|
|
|
5029
5039
|
};
|
|
5030
5040
|
};
|
|
5031
5041
|
|
|
5032
|
-
/*! @azure/msal-common v15.
|
|
5042
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
5033
5043
|
|
|
5034
5044
|
/*
|
|
5035
5045
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5138,7 +5148,7 @@ RegionDiscovery.IMDS_OPTIONS = {
|
|
|
5138
5148
|
},
|
|
5139
5149
|
};
|
|
5140
5150
|
|
|
5141
|
-
/*! @azure/msal-common v15.
|
|
5151
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
5142
5152
|
|
|
5143
5153
|
/*
|
|
5144
5154
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5977,7 +5987,7 @@ function buildStaticAuthorityOptions(authOptions) {
|
|
|
5977
5987
|
};
|
|
5978
5988
|
}
|
|
5979
5989
|
|
|
5980
|
-
/*! @azure/msal-common v15.
|
|
5990
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
5981
5991
|
|
|
5982
5992
|
/*
|
|
5983
5993
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6008,7 +6018,7 @@ async function createDiscoveredInstance(authorityUri, networkClient, cacheManage
|
|
|
6008
6018
|
}
|
|
6009
6019
|
}
|
|
6010
6020
|
|
|
6011
|
-
/*! @azure/msal-common v15.
|
|
6021
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
6012
6022
|
|
|
6013
6023
|
/*
|
|
6014
6024
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6027,7 +6037,28 @@ class ServerError extends AuthError {
|
|
|
6027
6037
|
}
|
|
6028
6038
|
}
|
|
6029
6039
|
|
|
6030
|
-
/*! @azure/msal-common v15.
|
|
6040
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
6041
|
+
/*
|
|
6042
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6043
|
+
* Licensed under the MIT License.
|
|
6044
|
+
*/
|
|
6045
|
+
function getRequestThumbprint(clientId, request, homeAccountId) {
|
|
6046
|
+
return {
|
|
6047
|
+
clientId: clientId,
|
|
6048
|
+
authority: request.authority,
|
|
6049
|
+
scopes: request.scopes,
|
|
6050
|
+
homeAccountIdentifier: homeAccountId,
|
|
6051
|
+
claims: request.claims,
|
|
6052
|
+
authenticationScheme: request.authenticationScheme,
|
|
6053
|
+
resourceRequestMethod: request.resourceRequestMethod,
|
|
6054
|
+
resourceRequestUri: request.resourceRequestUri,
|
|
6055
|
+
shrClaims: request.shrClaims,
|
|
6056
|
+
sshKid: request.sshKid,
|
|
6057
|
+
embeddedClientId: request.embeddedClientId || request.tokenBodyParameters?.clientId,
|
|
6058
|
+
};
|
|
6059
|
+
}
|
|
6060
|
+
|
|
6061
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
6031
6062
|
|
|
6032
6063
|
/*
|
|
6033
6064
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6108,24 +6139,13 @@ class ThrottlingUtils {
|
|
|
6108
6139
|
ThrottlingConstants.DEFAULT_MAX_THROTTLE_TIME_SECONDS) * 1000);
|
|
6109
6140
|
}
|
|
6110
6141
|
static removeThrottle(cacheManager, clientId, request, homeAccountIdentifier) {
|
|
6111
|
-
const thumbprint =
|
|
6112
|
-
clientId: clientId,
|
|
6113
|
-
authority: request.authority,
|
|
6114
|
-
scopes: request.scopes,
|
|
6115
|
-
homeAccountIdentifier: homeAccountIdentifier,
|
|
6116
|
-
claims: request.claims,
|
|
6117
|
-
authenticationScheme: request.authenticationScheme,
|
|
6118
|
-
resourceRequestMethod: request.resourceRequestMethod,
|
|
6119
|
-
resourceRequestUri: request.resourceRequestUri,
|
|
6120
|
-
shrClaims: request.shrClaims,
|
|
6121
|
-
sshKid: request.sshKid,
|
|
6122
|
-
};
|
|
6142
|
+
const thumbprint = getRequestThumbprint(clientId, request, homeAccountIdentifier);
|
|
6123
6143
|
const key = this.generateThrottlingStorageKey(thumbprint);
|
|
6124
6144
|
cacheManager.removeItem(key);
|
|
6125
6145
|
}
|
|
6126
6146
|
}
|
|
6127
6147
|
|
|
6128
|
-
/*! @azure/msal-common v15.
|
|
6148
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
6129
6149
|
|
|
6130
6150
|
/*
|
|
6131
6151
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6145,7 +6165,7 @@ class NetworkError extends AuthError {
|
|
|
6145
6165
|
}
|
|
6146
6166
|
}
|
|
6147
6167
|
|
|
6148
|
-
/*! @azure/msal-common v15.
|
|
6168
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
6149
6169
|
|
|
6150
6170
|
/*
|
|
6151
6171
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6295,7 +6315,7 @@ class BaseClient {
|
|
|
6295
6315
|
}
|
|
6296
6316
|
}
|
|
6297
6317
|
|
|
6298
|
-
/*! @azure/msal-common v15.
|
|
6318
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
6299
6319
|
/*
|
|
6300
6320
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6301
6321
|
* Licensed under the MIT License.
|
|
@@ -6321,7 +6341,7 @@ var InteractionRequiredAuthErrorCodes = /*#__PURE__*/Object.freeze({
|
|
|
6321
6341
|
refreshTokenExpired: refreshTokenExpired
|
|
6322
6342
|
});
|
|
6323
6343
|
|
|
6324
|
-
/*! @azure/msal-common v15.
|
|
6344
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
6325
6345
|
|
|
6326
6346
|
/*
|
|
6327
6347
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6409,7 +6429,7 @@ function createInteractionRequiredAuthError(errorCode) {
|
|
|
6409
6429
|
return new InteractionRequiredAuthError(errorCode, InteractionRequiredAuthErrorMessages[errorCode]);
|
|
6410
6430
|
}
|
|
6411
6431
|
|
|
6412
|
-
/*! @azure/msal-common v15.
|
|
6432
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
6413
6433
|
|
|
6414
6434
|
/*
|
|
6415
6435
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6481,7 +6501,7 @@ class ProtocolUtils {
|
|
|
6481
6501
|
}
|
|
6482
6502
|
}
|
|
6483
6503
|
|
|
6484
|
-
/*! @azure/msal-common v15.
|
|
6504
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
6485
6505
|
|
|
6486
6506
|
/*
|
|
6487
6507
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6565,7 +6585,7 @@ class PopTokenGenerator {
|
|
|
6565
6585
|
}
|
|
6566
6586
|
}
|
|
6567
6587
|
|
|
6568
|
-
/*! @azure/msal-common v15.
|
|
6588
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
6569
6589
|
/*
|
|
6570
6590
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6571
6591
|
* Licensed under the MIT License.
|
|
@@ -6592,7 +6612,7 @@ class PopTokenGenerator {
|
|
|
6592
6612
|
}
|
|
6593
6613
|
}
|
|
6594
6614
|
|
|
6595
|
-
/*! @azure/msal-common v15.
|
|
6615
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
6596
6616
|
|
|
6597
6617
|
/*
|
|
6598
6618
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6884,10 +6904,11 @@ class ResponseHandler {
|
|
|
6884
6904
|
accessToken = cacheRecord.accessToken.secret;
|
|
6885
6905
|
}
|
|
6886
6906
|
responseScopes = ScopeSet.fromString(cacheRecord.accessToken.target).asArray();
|
|
6887
|
-
expiresOn
|
|
6888
|
-
|
|
6907
|
+
// Access token expiresOn cached in seconds, converting to Date for AuthenticationResult
|
|
6908
|
+
expiresOn = toDateFromSeconds(cacheRecord.accessToken.expiresOn);
|
|
6909
|
+
extExpiresOn = toDateFromSeconds(cacheRecord.accessToken.extendedExpiresOn);
|
|
6889
6910
|
if (cacheRecord.accessToken.refreshOn) {
|
|
6890
|
-
refreshOn =
|
|
6911
|
+
refreshOn = toDateFromSeconds(cacheRecord.accessToken.refreshOn);
|
|
6891
6912
|
}
|
|
6892
6913
|
}
|
|
6893
6914
|
if (cacheRecord.appMetadata) {
|
|
@@ -6969,7 +6990,7 @@ function buildAccountToCache(cacheStorage, authority, homeAccountId, base64Decod
|
|
|
6969
6990
|
return baseAccount;
|
|
6970
6991
|
}
|
|
6971
6992
|
|
|
6972
|
-
/*! @azure/msal-common v15.
|
|
6993
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
6973
6994
|
/*
|
|
6974
6995
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6975
6996
|
* Licensed under the MIT License.
|
|
@@ -6987,7 +7008,7 @@ async function getClientAssertion(clientAssertion, clientId, tokenEndpoint) {
|
|
|
6987
7008
|
}
|
|
6988
7009
|
}
|
|
6989
7010
|
|
|
6990
|
-
/*! @azure/msal-common v15.
|
|
7011
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
6991
7012
|
|
|
6992
7013
|
/*
|
|
6993
7014
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7093,18 +7114,7 @@ class AuthorizationCodeClient extends BaseClient {
|
|
|
7093
7114
|
}
|
|
7094
7115
|
}
|
|
7095
7116
|
const headers = this.createTokenRequestHeaders(ccsCredential || request.ccsCredential);
|
|
7096
|
-
const thumbprint =
|
|
7097
|
-
clientId: request.tokenBodyParameters?.clientId ||
|
|
7098
|
-
this.config.authOptions.clientId,
|
|
7099
|
-
authority: authority.canonicalAuthority,
|
|
7100
|
-
scopes: request.scopes,
|
|
7101
|
-
claims: request.claims,
|
|
7102
|
-
authenticationScheme: request.authenticationScheme,
|
|
7103
|
-
resourceRequestMethod: request.resourceRequestMethod,
|
|
7104
|
-
resourceRequestUri: request.resourceRequestUri,
|
|
7105
|
-
shrClaims: request.shrClaims,
|
|
7106
|
-
sshKid: request.sshKid,
|
|
7107
|
-
};
|
|
7117
|
+
const thumbprint = getRequestThumbprint(this.config.authOptions.clientId, request);
|
|
7108
7118
|
return invokeAsync(this.executePostToTokenEndpoint.bind(this), PerformanceEvents.AuthorizationCodeClientExecutePostToTokenEndpoint, this.logger, this.performanceClient, request.correlationId)(endpoint, requestBody, headers, thumbprint, request.correlationId, PerformanceEvents.AuthorizationCodeClientExecutePostToTokenEndpoint);
|
|
7109
7119
|
}
|
|
7110
7120
|
/**
|
|
@@ -7437,7 +7447,7 @@ class AuthorizationCodeClient extends BaseClient {
|
|
|
7437
7447
|
}
|
|
7438
7448
|
}
|
|
7439
7449
|
|
|
7440
|
-
/*! @azure/msal-common v15.
|
|
7450
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
7441
7451
|
|
|
7442
7452
|
/*
|
|
7443
7453
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7557,18 +7567,7 @@ class RefreshTokenClient extends BaseClient {
|
|
|
7557
7567
|
const endpoint = UrlString.appendQueryString(authority.tokenEndpoint, queryParametersString);
|
|
7558
7568
|
const requestBody = await invokeAsync(this.createTokenRequestBody.bind(this), PerformanceEvents.RefreshTokenClientCreateTokenRequestBody, this.logger, this.performanceClient, request.correlationId)(request);
|
|
7559
7569
|
const headers = this.createTokenRequestHeaders(request.ccsCredential);
|
|
7560
|
-
const thumbprint =
|
|
7561
|
-
clientId: request.tokenBodyParameters?.clientId ||
|
|
7562
|
-
this.config.authOptions.clientId,
|
|
7563
|
-
authority: authority.canonicalAuthority,
|
|
7564
|
-
scopes: request.scopes,
|
|
7565
|
-
claims: request.claims,
|
|
7566
|
-
authenticationScheme: request.authenticationScheme,
|
|
7567
|
-
resourceRequestMethod: request.resourceRequestMethod,
|
|
7568
|
-
resourceRequestUri: request.resourceRequestUri,
|
|
7569
|
-
shrClaims: request.shrClaims,
|
|
7570
|
-
sshKid: request.sshKid,
|
|
7571
|
-
};
|
|
7570
|
+
const thumbprint = getRequestThumbprint(this.config.authOptions.clientId, request);
|
|
7572
7571
|
return invokeAsync(this.executePostToTokenEndpoint.bind(this), PerformanceEvents.RefreshTokenClientExecutePostToTokenEndpoint, this.logger, this.performanceClient, request.correlationId)(endpoint, requestBody, headers, thumbprint, request.correlationId, PerformanceEvents.RefreshTokenClientExecutePostToTokenEndpoint);
|
|
7573
7572
|
}
|
|
7574
7573
|
/**
|
|
@@ -7660,7 +7659,7 @@ class RefreshTokenClient extends BaseClient {
|
|
|
7660
7659
|
}
|
|
7661
7660
|
}
|
|
7662
7661
|
|
|
7663
|
-
/*! @azure/msal-common v15.
|
|
7662
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
7664
7663
|
|
|
7665
7664
|
/*
|
|
7666
7665
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7758,7 +7757,7 @@ class SilentFlowClient extends BaseClient {
|
|
|
7758
7757
|
}
|
|
7759
7758
|
}
|
|
7760
7759
|
|
|
7761
|
-
/*! @azure/msal-common v15.
|
|
7760
|
+
/*! @azure/msal-common v15.2.1 2025-03-11 */
|
|
7762
7761
|
|
|
7763
7762
|
/*
|
|
7764
7763
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8782,82 +8781,6 @@ class ManagedIdentityId {
|
|
|
8782
8781
|
}
|
|
8783
8782
|
}
|
|
8784
8783
|
|
|
8785
|
-
/*
|
|
8786
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
8787
|
-
* Licensed under the MIT License.
|
|
8788
|
-
*/
|
|
8789
|
-
class LinearRetryPolicy {
|
|
8790
|
-
constructor(maxRetries, retryDelay, httpStatusCodesToRetryOn) {
|
|
8791
|
-
this.maxRetries = maxRetries;
|
|
8792
|
-
this.retryDelay = retryDelay;
|
|
8793
|
-
this.httpStatusCodesToRetryOn = httpStatusCodesToRetryOn;
|
|
8794
|
-
}
|
|
8795
|
-
retryAfterMillisecondsToSleep(retryHeader) {
|
|
8796
|
-
if (!retryHeader) {
|
|
8797
|
-
return 0;
|
|
8798
|
-
}
|
|
8799
|
-
// retry-after header is in seconds
|
|
8800
|
-
let millisToSleep = Math.round(parseFloat(retryHeader) * 1000);
|
|
8801
|
-
/*
|
|
8802
|
-
* retry-after header is in HTTP Date format
|
|
8803
|
-
* <day-name>, <day> <month> <year> <hour>:<minute>:<second> GMT
|
|
8804
|
-
*/
|
|
8805
|
-
if (isNaN(millisToSleep)) {
|
|
8806
|
-
millisToSleep = Math.max(0,
|
|
8807
|
-
// .valueOf() is needed to subtract dates in TypeScript
|
|
8808
|
-
new Date(retryHeader).valueOf() - new Date().valueOf());
|
|
8809
|
-
}
|
|
8810
|
-
return millisToSleep;
|
|
8811
|
-
}
|
|
8812
|
-
async pauseForRetry(httpStatusCode, currentRetry, retryAfterHeader) {
|
|
8813
|
-
if (this.httpStatusCodesToRetryOn.includes(httpStatusCode) &&
|
|
8814
|
-
currentRetry < this.maxRetries) {
|
|
8815
|
-
const retryAfterDelay = this.retryAfterMillisecondsToSleep(retryAfterHeader);
|
|
8816
|
-
await new Promise((resolve) => {
|
|
8817
|
-
// retryAfterHeader value of 0 evaluates to false, and this.retryDelay will be used
|
|
8818
|
-
return setTimeout(resolve, retryAfterDelay || this.retryDelay);
|
|
8819
|
-
});
|
|
8820
|
-
return true;
|
|
8821
|
-
}
|
|
8822
|
-
return false;
|
|
8823
|
-
}
|
|
8824
|
-
}
|
|
8825
|
-
|
|
8826
|
-
/*
|
|
8827
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
8828
|
-
* Licensed under the MIT License.
|
|
8829
|
-
*/
|
|
8830
|
-
class HttpClientWithRetries {
|
|
8831
|
-
constructor(httpClientNoRetries, retryPolicy) {
|
|
8832
|
-
this.httpClientNoRetries = httpClientNoRetries;
|
|
8833
|
-
this.retryPolicy = retryPolicy;
|
|
8834
|
-
}
|
|
8835
|
-
async sendNetworkRequestAsyncHelper(httpMethod, url, options) {
|
|
8836
|
-
if (httpMethod === HttpMethod.GET) {
|
|
8837
|
-
return this.httpClientNoRetries.sendGetRequestAsync(url, options);
|
|
8838
|
-
}
|
|
8839
|
-
else {
|
|
8840
|
-
return this.httpClientNoRetries.sendPostRequestAsync(url, options);
|
|
8841
|
-
}
|
|
8842
|
-
}
|
|
8843
|
-
async sendNetworkRequestAsync(httpMethod, url, options) {
|
|
8844
|
-
// the underlying network module (custom or HttpClient) will make the call
|
|
8845
|
-
let response = await this.sendNetworkRequestAsyncHelper(httpMethod, url, options);
|
|
8846
|
-
let currentRetry = 0;
|
|
8847
|
-
while (await this.retryPolicy.pauseForRetry(response.status, currentRetry, response.headers[HeaderNames.RETRY_AFTER])) {
|
|
8848
|
-
response = await this.sendNetworkRequestAsyncHelper(httpMethod, url, options);
|
|
8849
|
-
currentRetry++;
|
|
8850
|
-
}
|
|
8851
|
-
return response;
|
|
8852
|
-
}
|
|
8853
|
-
async sendGetRequestAsync(url, options) {
|
|
8854
|
-
return this.sendNetworkRequestAsync(HttpMethod.GET, url, options);
|
|
8855
|
-
}
|
|
8856
|
-
async sendPostRequestAsync(url, options) {
|
|
8857
|
-
return this.sendNetworkRequestAsync(HttpMethod.POST, url, options);
|
|
8858
|
-
}
|
|
8859
|
-
}
|
|
8860
|
-
|
|
8861
8784
|
/*
|
|
8862
8785
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
8863
8786
|
* Licensed under the MIT License.
|
|
@@ -9047,17 +8970,13 @@ function buildManagedIdentityConfiguration({ managedIdentityIdParams, system, })
|
|
|
9047
8970
|
else {
|
|
9048
8971
|
networkClient = new HttpClient(system?.proxyUrl, system?.customAgentOptions);
|
|
9049
8972
|
}
|
|
9050
|
-
// wrap the network client with a retry policy if the developer has not disabled the option to do so
|
|
9051
|
-
if (!system?.disableInternalRetries) {
|
|
9052
|
-
const linearRetryPolicy = new LinearRetryPolicy(MANAGED_IDENTITY_MAX_RETRIES, MANAGED_IDENTITY_RETRY_DELAY, MANAGED_IDENTITY_HTTP_STATUS_CODES_TO_RETRY_ON);
|
|
9053
|
-
networkClient = new HttpClientWithRetries(networkClient, linearRetryPolicy);
|
|
9054
|
-
}
|
|
9055
8973
|
return {
|
|
9056
8974
|
managedIdentityId: managedIdentityId,
|
|
9057
8975
|
system: {
|
|
9058
8976
|
loggerOptions,
|
|
9059
8977
|
networkClient,
|
|
9060
8978
|
},
|
|
8979
|
+
disableInternalRetries: system?.disableInternalRetries || false,
|
|
9061
8980
|
};
|
|
9062
8981
|
}
|
|
9063
8982
|
|
|
@@ -10131,7 +10050,7 @@ class ClientAssertion {
|
|
|
10131
10050
|
|
|
10132
10051
|
/* eslint-disable header/header */
|
|
10133
10052
|
const name = "@azure/msal-node";
|
|
10134
|
-
const version = "3.
|
|
10053
|
+
const version = "3.3.0";
|
|
10135
10054
|
|
|
10136
10055
|
/*
|
|
10137
10056
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -10141,6 +10060,7 @@ const version = "3.2.2";
|
|
|
10141
10060
|
* Oauth2.0 Password grant client
|
|
10142
10061
|
* Note: We are only supporting public clients for password grant and for purely testing purposes
|
|
10143
10062
|
* @public
|
|
10063
|
+
* @deprecated - Use a more secure flow instead
|
|
10144
10064
|
*/
|
|
10145
10065
|
class UsernamePasswordClient extends BaseClient {
|
|
10146
10066
|
constructor(configuration) {
|
|
@@ -10408,6 +10328,7 @@ class ClientApplication {
|
|
|
10408
10328
|
* https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-authentication-flows#usernamepassword
|
|
10409
10329
|
*
|
|
10410
10330
|
* @param request - UsenamePasswordRequest
|
|
10331
|
+
* @deprecated - Use a more secure flow instead
|
|
10411
10332
|
*/
|
|
10412
10333
|
async acquireTokenByUsernamePassword(request) {
|
|
10413
10334
|
this.logger.info("acquireTokenByUsernamePassword called", request.correlationId);
|
|
@@ -11730,6 +11651,41 @@ function isIso8601(dateString) {
|
|
|
11730
11651
|
return !isNaN(date.getTime()) && date.toISOString() === dateString;
|
|
11731
11652
|
}
|
|
11732
11653
|
|
|
11654
|
+
/*
|
|
11655
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
11656
|
+
* Licensed under the MIT License.
|
|
11657
|
+
*/
|
|
11658
|
+
class HttpClientWithRetries {
|
|
11659
|
+
constructor(httpClientNoRetries, retryPolicy) {
|
|
11660
|
+
this.httpClientNoRetries = httpClientNoRetries;
|
|
11661
|
+
this.retryPolicy = retryPolicy;
|
|
11662
|
+
}
|
|
11663
|
+
async sendNetworkRequestAsyncHelper(httpMethod, url, options) {
|
|
11664
|
+
if (httpMethod === HttpMethod.GET) {
|
|
11665
|
+
return this.httpClientNoRetries.sendGetRequestAsync(url, options);
|
|
11666
|
+
}
|
|
11667
|
+
else {
|
|
11668
|
+
return this.httpClientNoRetries.sendPostRequestAsync(url, options);
|
|
11669
|
+
}
|
|
11670
|
+
}
|
|
11671
|
+
async sendNetworkRequestAsync(httpMethod, url, options) {
|
|
11672
|
+
// the underlying network module (custom or HttpClient) will make the call
|
|
11673
|
+
let response = await this.sendNetworkRequestAsyncHelper(httpMethod, url, options);
|
|
11674
|
+
let currentRetry = 0;
|
|
11675
|
+
while (await this.retryPolicy.pauseForRetry(response.status, currentRetry, response.headers[HeaderNames.RETRY_AFTER])) {
|
|
11676
|
+
response = await this.sendNetworkRequestAsyncHelper(httpMethod, url, options);
|
|
11677
|
+
currentRetry++;
|
|
11678
|
+
}
|
|
11679
|
+
return response;
|
|
11680
|
+
}
|
|
11681
|
+
async sendGetRequestAsync(url, options) {
|
|
11682
|
+
return this.sendNetworkRequestAsync(HttpMethod.GET, url, options);
|
|
11683
|
+
}
|
|
11684
|
+
async sendPostRequestAsync(url, options) {
|
|
11685
|
+
return this.sendNetworkRequestAsync(HttpMethod.POST, url, options);
|
|
11686
|
+
}
|
|
11687
|
+
}
|
|
11688
|
+
|
|
11733
11689
|
/*
|
|
11734
11690
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
11735
11691
|
* Licensed under the MIT License.
|
|
@@ -11744,11 +11700,12 @@ const ManagedIdentityUserAssignedIdQueryParameterNames = {
|
|
|
11744
11700
|
MANAGED_IDENTITY_RESOURCE_ID_NON_IMDS: "mi_res_id",
|
|
11745
11701
|
};
|
|
11746
11702
|
class BaseManagedIdentitySource {
|
|
11747
|
-
constructor(logger, nodeStorage, networkClient, cryptoProvider) {
|
|
11703
|
+
constructor(logger, nodeStorage, networkClient, cryptoProvider, disableInternalRetries) {
|
|
11748
11704
|
this.logger = logger;
|
|
11749
11705
|
this.nodeStorage = nodeStorage;
|
|
11750
11706
|
this.networkClient = networkClient;
|
|
11751
11707
|
this.cryptoProvider = cryptoProvider;
|
|
11708
|
+
this.disableInternalRetries = disableInternalRetries;
|
|
11752
11709
|
}
|
|
11753
11710
|
async getServerTokenResponseAsync(response,
|
|
11754
11711
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -11805,18 +11762,26 @@ class BaseManagedIdentitySource {
|
|
|
11805
11762
|
networkRequestOptions.body =
|
|
11806
11763
|
networkRequest.computeParametersBodyString();
|
|
11807
11764
|
}
|
|
11765
|
+
/**
|
|
11766
|
+
* Initializes the network client helper based on the retry policy configuration.
|
|
11767
|
+
* If internal retries are disabled, it uses the provided network client directly.
|
|
11768
|
+
* Otherwise, it wraps the network client with an HTTP client that supports retries.
|
|
11769
|
+
*/
|
|
11770
|
+
const networkClientHelper = this.disableInternalRetries
|
|
11771
|
+
? this.networkClient
|
|
11772
|
+
: new HttpClientWithRetries(this.networkClient, networkRequest.retryPolicy);
|
|
11808
11773
|
const reqTimestamp = nowSeconds();
|
|
11809
11774
|
let response;
|
|
11810
11775
|
try {
|
|
11811
11776
|
// Sources that send POST requests: Cloud Shell
|
|
11812
11777
|
if (networkRequest.httpMethod === HttpMethod.POST) {
|
|
11813
11778
|
response =
|
|
11814
|
-
await
|
|
11779
|
+
await networkClientHelper.sendPostRequestAsync(networkRequest.computeUri(), networkRequestOptions);
|
|
11815
11780
|
// Sources that send GET requests: App Service, Azure Arc, IMDS, Service Fabric
|
|
11816
11781
|
}
|
|
11817
11782
|
else {
|
|
11818
11783
|
response =
|
|
11819
|
-
await
|
|
11784
|
+
await networkClientHelper.sendGetRequestAsync(networkRequest.computeUri(), networkRequestOptions);
|
|
11820
11785
|
}
|
|
11821
11786
|
}
|
|
11822
11787
|
catch (error) {
|
|
@@ -11828,7 +11793,7 @@ class BaseManagedIdentitySource {
|
|
|
11828
11793
|
}
|
|
11829
11794
|
}
|
|
11830
11795
|
const responseHandler = new ResponseHandler(managedIdentityId.id, this.nodeStorage, this.cryptoProvider, this.logger, null, null);
|
|
11831
|
-
const serverTokenResponse = await this.getServerTokenResponseAsync(response,
|
|
11796
|
+
const serverTokenResponse = await this.getServerTokenResponseAsync(response, networkClientHelper, networkRequest, networkRequestOptions);
|
|
11832
11797
|
responseHandler.validateTokenResponse(serverTokenResponse, refreshAccessToken);
|
|
11833
11798
|
// caches the token
|
|
11834
11799
|
return responseHandler.handleServerTokenResponse(serverTokenResponse, fakeAuthority, reqTimestamp, managedIdentityRequest);
|
|
@@ -11861,17 +11826,60 @@ BaseManagedIdentitySource.getValidatedEnvVariableUrlString = (envVariableStringN
|
|
|
11861
11826
|
}
|
|
11862
11827
|
};
|
|
11863
11828
|
|
|
11829
|
+
/*
|
|
11830
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
11831
|
+
* Licensed under the MIT License.
|
|
11832
|
+
*/
|
|
11833
|
+
class LinearRetryPolicy {
|
|
11834
|
+
constructor(maxRetries, retryDelay, httpStatusCodesToRetryOn) {
|
|
11835
|
+
this.maxRetries = maxRetries;
|
|
11836
|
+
this.retryDelay = retryDelay;
|
|
11837
|
+
this.httpStatusCodesToRetryOn = httpStatusCodesToRetryOn;
|
|
11838
|
+
}
|
|
11839
|
+
retryAfterMillisecondsToSleep(retryHeader) {
|
|
11840
|
+
if (!retryHeader) {
|
|
11841
|
+
return 0;
|
|
11842
|
+
}
|
|
11843
|
+
// retry-after header is in seconds
|
|
11844
|
+
let millisToSleep = Math.round(parseFloat(retryHeader) * 1000);
|
|
11845
|
+
/*
|
|
11846
|
+
* retry-after header is in HTTP Date format
|
|
11847
|
+
* <day-name>, <day> <month> <year> <hour>:<minute>:<second> GMT
|
|
11848
|
+
*/
|
|
11849
|
+
if (isNaN(millisToSleep)) {
|
|
11850
|
+
millisToSleep = Math.max(0,
|
|
11851
|
+
// .valueOf() is needed to subtract dates in TypeScript
|
|
11852
|
+
new Date(retryHeader).valueOf() - new Date().valueOf());
|
|
11853
|
+
}
|
|
11854
|
+
return millisToSleep;
|
|
11855
|
+
}
|
|
11856
|
+
async pauseForRetry(httpStatusCode, currentRetry, retryAfterHeader) {
|
|
11857
|
+
if (this.httpStatusCodesToRetryOn.includes(httpStatusCode) &&
|
|
11858
|
+
currentRetry < this.maxRetries) {
|
|
11859
|
+
const retryAfterDelay = this.retryAfterMillisecondsToSleep(retryAfterHeader);
|
|
11860
|
+
await new Promise((resolve) => {
|
|
11861
|
+
// retryAfterHeader value of 0 evaluates to false, and this.retryDelay will be used
|
|
11862
|
+
return setTimeout(resolve, retryAfterDelay || this.retryDelay);
|
|
11863
|
+
});
|
|
11864
|
+
return true;
|
|
11865
|
+
}
|
|
11866
|
+
return false;
|
|
11867
|
+
}
|
|
11868
|
+
}
|
|
11869
|
+
|
|
11864
11870
|
/*
|
|
11865
11871
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
11866
11872
|
* Licensed under the MIT License.
|
|
11867
11873
|
*/
|
|
11868
11874
|
class ManagedIdentityRequestParameters {
|
|
11869
|
-
constructor(httpMethod, endpoint) {
|
|
11875
|
+
constructor(httpMethod, endpoint, retryPolicy) {
|
|
11870
11876
|
this.httpMethod = httpMethod;
|
|
11871
11877
|
this._baseEndpoint = endpoint;
|
|
11872
11878
|
this.headers = {};
|
|
11873
11879
|
this.bodyParameters = {};
|
|
11874
11880
|
this.queryParameters = {};
|
|
11881
|
+
const defaultRetryPolicy = new LinearRetryPolicy(MANAGED_IDENTITY_MAX_RETRIES, MANAGED_IDENTITY_RETRY_DELAY, MANAGED_IDENTITY_HTTP_STATUS_CODES_TO_RETRY_ON);
|
|
11882
|
+
this.retryPolicy = retryPolicy || defaultRetryPolicy;
|
|
11875
11883
|
}
|
|
11876
11884
|
computeUri() {
|
|
11877
11885
|
const parameterBuilder = new RequestParameterBuilder();
|
|
@@ -11900,8 +11908,8 @@ const APP_SERVICE_MSI_API_VERSION = "2019-08-01";
|
|
|
11900
11908
|
* Original source of code: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/src/AppServiceManagedIdentitySource.cs
|
|
11901
11909
|
*/
|
|
11902
11910
|
class AppService extends BaseManagedIdentitySource {
|
|
11903
|
-
constructor(logger, nodeStorage, networkClient, cryptoProvider, identityEndpoint, identityHeader) {
|
|
11904
|
-
super(logger, nodeStorage, networkClient, cryptoProvider);
|
|
11911
|
+
constructor(logger, nodeStorage, networkClient, cryptoProvider, disableInternalRetries, identityEndpoint, identityHeader) {
|
|
11912
|
+
super(logger, nodeStorage, networkClient, cryptoProvider, disableInternalRetries);
|
|
11905
11913
|
this.identityEndpoint = identityEndpoint;
|
|
11906
11914
|
this.identityHeader = identityHeader;
|
|
11907
11915
|
}
|
|
@@ -11910,7 +11918,7 @@ class AppService extends BaseManagedIdentitySource {
|
|
|
11910
11918
|
const identityHeader = process.env[ManagedIdentityEnvironmentVariableNames.IDENTITY_HEADER];
|
|
11911
11919
|
return [identityEndpoint, identityHeader];
|
|
11912
11920
|
}
|
|
11913
|
-
static tryCreate(logger, nodeStorage, networkClient, cryptoProvider) {
|
|
11921
|
+
static tryCreate(logger, nodeStorage, networkClient, cryptoProvider, disableInternalRetries) {
|
|
11914
11922
|
const [identityEndpoint, identityHeader] = AppService.getEnvironmentVariables();
|
|
11915
11923
|
// if either of the identity endpoint or identity header variables are undefined, this MSI provider is unavailable.
|
|
11916
11924
|
if (!identityEndpoint || !identityHeader) {
|
|
@@ -11919,7 +11927,7 @@ class AppService extends BaseManagedIdentitySource {
|
|
|
11919
11927
|
}
|
|
11920
11928
|
const validatedIdentityEndpoint = AppService.getValidatedEnvVariableUrlString(ManagedIdentityEnvironmentVariableNames.IDENTITY_ENDPOINT, identityEndpoint, ManagedIdentitySourceNames.APP_SERVICE, logger);
|
|
11921
11929
|
logger.info(`[Managed Identity] Environment variables validation passed for ${ManagedIdentitySourceNames.APP_SERVICE} managed identity. Endpoint URI: ${validatedIdentityEndpoint}. Creating ${ManagedIdentitySourceNames.APP_SERVICE} managed identity.`);
|
|
11922
|
-
return new AppService(logger, nodeStorage, networkClient, cryptoProvider, identityEndpoint, identityHeader);
|
|
11930
|
+
return new AppService(logger, nodeStorage, networkClient, cryptoProvider, disableInternalRetries, identityEndpoint, identityHeader);
|
|
11923
11931
|
}
|
|
11924
11932
|
createRequest(resource, managedIdentityId) {
|
|
11925
11933
|
const request = new ManagedIdentityRequestParameters(HttpMethod.GET, this.identityEndpoint);
|
|
@@ -11955,8 +11963,8 @@ const AZURE_ARC_FILE_DETECTION = {
|
|
|
11955
11963
|
* Original source of code: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/src/AzureArcManagedIdentitySource.cs
|
|
11956
11964
|
*/
|
|
11957
11965
|
class AzureArc extends BaseManagedIdentitySource {
|
|
11958
|
-
constructor(logger, nodeStorage, networkClient, cryptoProvider, identityEndpoint) {
|
|
11959
|
-
super(logger, nodeStorage, networkClient, cryptoProvider);
|
|
11966
|
+
constructor(logger, nodeStorage, networkClient, cryptoProvider, disableInternalRetries, identityEndpoint) {
|
|
11967
|
+
super(logger, nodeStorage, networkClient, cryptoProvider, disableInternalRetries);
|
|
11960
11968
|
this.identityEndpoint = identityEndpoint;
|
|
11961
11969
|
}
|
|
11962
11970
|
static getEnvironmentVariables() {
|
|
@@ -11984,7 +11992,7 @@ class AzureArc extends BaseManagedIdentitySource {
|
|
|
11984
11992
|
}
|
|
11985
11993
|
return [identityEndpoint, imdsEndpoint];
|
|
11986
11994
|
}
|
|
11987
|
-
static tryCreate(logger, nodeStorage, networkClient, cryptoProvider, managedIdentityId) {
|
|
11995
|
+
static tryCreate(logger, nodeStorage, networkClient, cryptoProvider, disableInternalRetries, managedIdentityId) {
|
|
11988
11996
|
const [identityEndpoint, imdsEndpoint] = AzureArc.getEnvironmentVariables();
|
|
11989
11997
|
// if either of the identity or imds endpoints are undefined (even after himds file detection)
|
|
11990
11998
|
if (!identityEndpoint || !imdsEndpoint) {
|
|
@@ -12008,7 +12016,7 @@ class AzureArc extends BaseManagedIdentitySource {
|
|
|
12008
12016
|
if (managedIdentityId.idType !== ManagedIdentityIdType.SYSTEM_ASSIGNED) {
|
|
12009
12017
|
throw createManagedIdentityError(unableToCreateAzureArc);
|
|
12010
12018
|
}
|
|
12011
|
-
return new AzureArc(logger, nodeStorage, networkClient, cryptoProvider, identityEndpoint);
|
|
12019
|
+
return new AzureArc(logger, nodeStorage, networkClient, cryptoProvider, disableInternalRetries, identityEndpoint);
|
|
12012
12020
|
}
|
|
12013
12021
|
createRequest(resource) {
|
|
12014
12022
|
const request = new ManagedIdentityRequestParameters(HttpMethod.GET, this.identityEndpoint.replace("localhost", "127.0.0.1"));
|
|
@@ -12098,15 +12106,15 @@ class AzureArc extends BaseManagedIdentitySource {
|
|
|
12098
12106
|
* Original source of code: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/src/CloudShellManagedIdentitySource.cs
|
|
12099
12107
|
*/
|
|
12100
12108
|
class CloudShell extends BaseManagedIdentitySource {
|
|
12101
|
-
constructor(logger, nodeStorage, networkClient, cryptoProvider, msiEndpoint) {
|
|
12102
|
-
super(logger, nodeStorage, networkClient, cryptoProvider);
|
|
12109
|
+
constructor(logger, nodeStorage, networkClient, cryptoProvider, disableInternalRetries, msiEndpoint) {
|
|
12110
|
+
super(logger, nodeStorage, networkClient, cryptoProvider, disableInternalRetries);
|
|
12103
12111
|
this.msiEndpoint = msiEndpoint;
|
|
12104
12112
|
}
|
|
12105
12113
|
static getEnvironmentVariables() {
|
|
12106
12114
|
const msiEndpoint = process.env[ManagedIdentityEnvironmentVariableNames.MSI_ENDPOINT];
|
|
12107
12115
|
return [msiEndpoint];
|
|
12108
12116
|
}
|
|
12109
|
-
static tryCreate(logger, nodeStorage, networkClient, cryptoProvider, managedIdentityId) {
|
|
12117
|
+
static tryCreate(logger, nodeStorage, networkClient, cryptoProvider, disableInternalRetries, managedIdentityId) {
|
|
12110
12118
|
const [msiEndpoint] = CloudShell.getEnvironmentVariables();
|
|
12111
12119
|
// if the msi endpoint environment variable is undefined, this MSI provider is unavailable.
|
|
12112
12120
|
if (!msiEndpoint) {
|
|
@@ -12118,7 +12126,7 @@ class CloudShell extends BaseManagedIdentitySource {
|
|
|
12118
12126
|
if (managedIdentityId.idType !== ManagedIdentityIdType.SYSTEM_ASSIGNED) {
|
|
12119
12127
|
throw createManagedIdentityError(unableToCreateCloudShell);
|
|
12120
12128
|
}
|
|
12121
|
-
return new CloudShell(logger, nodeStorage, networkClient, cryptoProvider, msiEndpoint);
|
|
12129
|
+
return new CloudShell(logger, nodeStorage, networkClient, cryptoProvider, disableInternalRetries, msiEndpoint);
|
|
12122
12130
|
}
|
|
12123
12131
|
createRequest(resource) {
|
|
12124
12132
|
const request = new ManagedIdentityRequestParameters(HttpMethod.POST, this.msiEndpoint);
|
|
@@ -12139,11 +12147,11 @@ const DEFAULT_IMDS_ENDPOINT = `http://169.254.169.254${IMDS_TOKEN_PATH}`;
|
|
|
12139
12147
|
const IMDS_API_VERSION = "2018-02-01";
|
|
12140
12148
|
// Original source of code: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/src/ImdsManagedIdentitySource.cs
|
|
12141
12149
|
class Imds extends BaseManagedIdentitySource {
|
|
12142
|
-
constructor(logger, nodeStorage, networkClient, cryptoProvider, identityEndpoint) {
|
|
12143
|
-
super(logger, nodeStorage, networkClient, cryptoProvider);
|
|
12150
|
+
constructor(logger, nodeStorage, networkClient, cryptoProvider, disableInternalRetries, identityEndpoint) {
|
|
12151
|
+
super(logger, nodeStorage, networkClient, cryptoProvider, disableInternalRetries);
|
|
12144
12152
|
this.identityEndpoint = identityEndpoint;
|
|
12145
12153
|
}
|
|
12146
|
-
static tryCreate(logger, nodeStorage, networkClient, cryptoProvider) {
|
|
12154
|
+
static tryCreate(logger, nodeStorage, networkClient, cryptoProvider, disableInternalRetries) {
|
|
12147
12155
|
let validatedIdentityEndpoint;
|
|
12148
12156
|
if (process.env[ManagedIdentityEnvironmentVariableNames
|
|
12149
12157
|
.AZURE_POD_IDENTITY_AUTHORITY_HOST]) {
|
|
@@ -12156,7 +12164,7 @@ class Imds extends BaseManagedIdentitySource {
|
|
|
12156
12164
|
logger.info(`[Managed Identity] Unable to find ${ManagedIdentityEnvironmentVariableNames.AZURE_POD_IDENTITY_AUTHORITY_HOST} environment variable for ${ManagedIdentitySourceNames.IMDS}, using the default endpoint.`);
|
|
12157
12165
|
validatedIdentityEndpoint = DEFAULT_IMDS_ENDPOINT;
|
|
12158
12166
|
}
|
|
12159
|
-
return new Imds(logger, nodeStorage, networkClient, cryptoProvider, validatedIdentityEndpoint);
|
|
12167
|
+
return new Imds(logger, nodeStorage, networkClient, cryptoProvider, disableInternalRetries, validatedIdentityEndpoint);
|
|
12160
12168
|
}
|
|
12161
12169
|
createRequest(resource, managedIdentityId) {
|
|
12162
12170
|
const request = new ManagedIdentityRequestParameters(HttpMethod.GET, this.identityEndpoint);
|
|
@@ -12184,8 +12192,8 @@ const SERVICE_FABRIC_MSI_API_VERSION = "2019-07-01-preview";
|
|
|
12184
12192
|
* Original source of code: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/src/ServiceFabricManagedIdentitySource.cs
|
|
12185
12193
|
*/
|
|
12186
12194
|
class ServiceFabric extends BaseManagedIdentitySource {
|
|
12187
|
-
constructor(logger, nodeStorage, networkClient, cryptoProvider, identityEndpoint, identityHeader) {
|
|
12188
|
-
super(logger, nodeStorage, networkClient, cryptoProvider);
|
|
12195
|
+
constructor(logger, nodeStorage, networkClient, cryptoProvider, disableInternalRetries, identityEndpoint, identityHeader) {
|
|
12196
|
+
super(logger, nodeStorage, networkClient, cryptoProvider, disableInternalRetries);
|
|
12189
12197
|
this.identityEndpoint = identityEndpoint;
|
|
12190
12198
|
this.identityHeader = identityHeader;
|
|
12191
12199
|
}
|
|
@@ -12196,7 +12204,7 @@ class ServiceFabric extends BaseManagedIdentitySource {
|
|
|
12196
12204
|
.IDENTITY_SERVER_THUMBPRINT];
|
|
12197
12205
|
return [identityEndpoint, identityHeader, identityServerThumbprint];
|
|
12198
12206
|
}
|
|
12199
|
-
static tryCreate(logger, nodeStorage, networkClient, cryptoProvider, managedIdentityId) {
|
|
12207
|
+
static tryCreate(logger, nodeStorage, networkClient, cryptoProvider, disableInternalRetries, managedIdentityId) {
|
|
12200
12208
|
const [identityEndpoint, identityHeader, identityServerThumbprint] = ServiceFabric.getEnvironmentVariables();
|
|
12201
12209
|
/*
|
|
12202
12210
|
* if either of the identity endpoint, identity header, or identity server thumbprint
|
|
@@ -12211,7 +12219,7 @@ class ServiceFabric extends BaseManagedIdentitySource {
|
|
|
12211
12219
|
if (managedIdentityId.idType !== ManagedIdentityIdType.SYSTEM_ASSIGNED) {
|
|
12212
12220
|
logger.warning(`[Managed Identity] ${ManagedIdentitySourceNames.SERVICE_FABRIC} user assigned managed identity is configured in the cluster, not during runtime. See also: https://learn.microsoft.com/en-us/azure/service-fabric/configure-existing-cluster-enable-managed-identity-token-service.`);
|
|
12213
12221
|
}
|
|
12214
|
-
return new ServiceFabric(logger, nodeStorage, networkClient, cryptoProvider, identityEndpoint, identityHeader);
|
|
12222
|
+
return new ServiceFabric(logger, nodeStorage, networkClient, cryptoProvider, disableInternalRetries, identityEndpoint, identityHeader);
|
|
12215
12223
|
}
|
|
12216
12224
|
createRequest(resource, managedIdentityId) {
|
|
12217
12225
|
const request = new ManagedIdentityRequestParameters(HttpMethod.GET, this.identityEndpoint);
|
|
@@ -12234,8 +12242,8 @@ class ServiceFabric extends BaseManagedIdentitySource {
|
|
|
12234
12242
|
*/
|
|
12235
12243
|
const MACHINE_LEARNING_MSI_API_VERSION = "2017-09-01";
|
|
12236
12244
|
class MachineLearning extends BaseManagedIdentitySource {
|
|
12237
|
-
constructor(logger, nodeStorage, networkClient, cryptoProvider, msiEndpoint, secret) {
|
|
12238
|
-
super(logger, nodeStorage, networkClient, cryptoProvider);
|
|
12245
|
+
constructor(logger, nodeStorage, networkClient, cryptoProvider, disableInternalRetries, msiEndpoint, secret) {
|
|
12246
|
+
super(logger, nodeStorage, networkClient, cryptoProvider, disableInternalRetries);
|
|
12239
12247
|
this.msiEndpoint = msiEndpoint;
|
|
12240
12248
|
this.secret = secret;
|
|
12241
12249
|
}
|
|
@@ -12244,7 +12252,7 @@ class MachineLearning extends BaseManagedIdentitySource {
|
|
|
12244
12252
|
const secret = process.env[ManagedIdentityEnvironmentVariableNames.MSI_SECRET];
|
|
12245
12253
|
return [msiEndpoint, secret];
|
|
12246
12254
|
}
|
|
12247
|
-
static tryCreate(logger, nodeStorage, networkClient, cryptoProvider) {
|
|
12255
|
+
static tryCreate(logger, nodeStorage, networkClient, cryptoProvider, disableInternalRetries) {
|
|
12248
12256
|
const [msiEndpoint, secret] = MachineLearning.getEnvironmentVariables();
|
|
12249
12257
|
// if either of the MSI endpoint or MSI secret variables are undefined, this MSI provider is unavailable.
|
|
12250
12258
|
if (!msiEndpoint || !secret) {
|
|
@@ -12253,7 +12261,7 @@ class MachineLearning extends BaseManagedIdentitySource {
|
|
|
12253
12261
|
}
|
|
12254
12262
|
const validatedMsiEndpoint = MachineLearning.getValidatedEnvVariableUrlString(ManagedIdentityEnvironmentVariableNames.MSI_ENDPOINT, msiEndpoint, ManagedIdentitySourceNames.MACHINE_LEARNING, logger);
|
|
12255
12263
|
logger.info(`[Managed Identity] Environment variables validation passed for ${ManagedIdentitySourceNames.MACHINE_LEARNING} managed identity. Endpoint URI: ${validatedMsiEndpoint}. Creating ${ManagedIdentitySourceNames.MACHINE_LEARNING} managed identity.`);
|
|
12256
|
-
return new MachineLearning(logger, nodeStorage, networkClient, cryptoProvider, msiEndpoint, secret);
|
|
12264
|
+
return new MachineLearning(logger, nodeStorage, networkClient, cryptoProvider, disableInternalRetries, msiEndpoint, secret);
|
|
12257
12265
|
}
|
|
12258
12266
|
createRequest(resource, managedIdentityId) {
|
|
12259
12267
|
const request = new ManagedIdentityRequestParameters(HttpMethod.GET, this.msiEndpoint);
|
|
@@ -12280,16 +12288,17 @@ class MachineLearning extends BaseManagedIdentitySource {
|
|
|
12280
12288
|
* Original source of code: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/src/ManagedIdentityClient.cs
|
|
12281
12289
|
*/
|
|
12282
12290
|
class ManagedIdentityClient {
|
|
12283
|
-
constructor(logger, nodeStorage, networkClient, cryptoProvider) {
|
|
12291
|
+
constructor(logger, nodeStorage, networkClient, cryptoProvider, disableInternalRetries) {
|
|
12284
12292
|
this.logger = logger;
|
|
12285
12293
|
this.nodeStorage = nodeStorage;
|
|
12286
12294
|
this.networkClient = networkClient;
|
|
12287
12295
|
this.cryptoProvider = cryptoProvider;
|
|
12296
|
+
this.disableInternalRetries = disableInternalRetries;
|
|
12288
12297
|
}
|
|
12289
12298
|
async sendManagedIdentityTokenRequest(managedIdentityRequest, managedIdentityId, fakeAuthority, refreshAccessToken) {
|
|
12290
12299
|
if (!ManagedIdentityClient.identitySource) {
|
|
12291
12300
|
ManagedIdentityClient.identitySource =
|
|
12292
|
-
this.selectManagedIdentitySource(this.logger, this.nodeStorage, this.networkClient, this.cryptoProvider, managedIdentityId);
|
|
12301
|
+
this.selectManagedIdentitySource(this.logger, this.nodeStorage, this.networkClient, this.cryptoProvider, this.disableInternalRetries, managedIdentityId);
|
|
12293
12302
|
}
|
|
12294
12303
|
return ManagedIdentityClient.identitySource.acquireTokenWithManagedIdentity(managedIdentityRequest, managedIdentityId, fakeAuthority, refreshAccessToken);
|
|
12295
12304
|
}
|
|
@@ -12321,13 +12330,13 @@ class ManagedIdentityClient {
|
|
|
12321
12330
|
* Tries to create a managed identity source for all sources
|
|
12322
12331
|
* @returns the managed identity Source
|
|
12323
12332
|
*/
|
|
12324
|
-
selectManagedIdentitySource(logger, nodeStorage, networkClient, cryptoProvider, managedIdentityId) {
|
|
12325
|
-
const source = ServiceFabric.tryCreate(logger, nodeStorage, networkClient, cryptoProvider, managedIdentityId) ||
|
|
12326
|
-
AppService.tryCreate(logger, nodeStorage, networkClient, cryptoProvider) ||
|
|
12327
|
-
MachineLearning.tryCreate(logger, nodeStorage, networkClient, cryptoProvider) ||
|
|
12328
|
-
CloudShell.tryCreate(logger, nodeStorage, networkClient, cryptoProvider, managedIdentityId) ||
|
|
12329
|
-
AzureArc.tryCreate(logger, nodeStorage, networkClient, cryptoProvider, managedIdentityId) ||
|
|
12330
|
-
Imds.tryCreate(logger, nodeStorage, networkClient, cryptoProvider);
|
|
12333
|
+
selectManagedIdentitySource(logger, nodeStorage, networkClient, cryptoProvider, disableInternalRetries, managedIdentityId) {
|
|
12334
|
+
const source = ServiceFabric.tryCreate(logger, nodeStorage, networkClient, cryptoProvider, disableInternalRetries, managedIdentityId) ||
|
|
12335
|
+
AppService.tryCreate(logger, nodeStorage, networkClient, cryptoProvider, disableInternalRetries) ||
|
|
12336
|
+
MachineLearning.tryCreate(logger, nodeStorage, networkClient, cryptoProvider, disableInternalRetries) ||
|
|
12337
|
+
CloudShell.tryCreate(logger, nodeStorage, networkClient, cryptoProvider, disableInternalRetries, managedIdentityId) ||
|
|
12338
|
+
AzureArc.tryCreate(logger, nodeStorage, networkClient, cryptoProvider, disableInternalRetries, managedIdentityId) ||
|
|
12339
|
+
Imds.tryCreate(logger, nodeStorage, networkClient, cryptoProvider, disableInternalRetries);
|
|
12331
12340
|
if (!source) {
|
|
12332
12341
|
throw createManagedIdentityError(unableToCreateSource);
|
|
12333
12342
|
}
|
|
@@ -12370,7 +12379,7 @@ class ManagedIdentityApplication {
|
|
|
12370
12379
|
authority: this.fakeAuthority,
|
|
12371
12380
|
},
|
|
12372
12381
|
});
|
|
12373
|
-
this.managedIdentityClient = new ManagedIdentityClient(this.logger, ManagedIdentityApplication.nodeStorage, this.networkClient, this.cryptoProvider);
|
|
12382
|
+
this.managedIdentityClient = new ManagedIdentityClient(this.logger, ManagedIdentityApplication.nodeStorage, this.networkClient, this.cryptoProvider, this.config.disableInternalRetries);
|
|
12374
12383
|
}
|
|
12375
12384
|
/**
|
|
12376
12385
|
* Acquire an access token from the cache or the managed identity
|