@azure/msal-node 3.2.3 → 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/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.mjs +1 -1
- package/dist/client/DeviceCodeClient.mjs +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.mjs +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 +225 -218
- package/lib/msal-node.cjs.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/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/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/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
|
@@ -31,10 +31,17 @@ export class MachineLearning extends BaseManagedIdentitySource {
|
|
|
31
31
|
nodeStorage: NodeStorage,
|
|
32
32
|
networkClient: INetworkModule,
|
|
33
33
|
cryptoProvider: CryptoProvider,
|
|
34
|
+
disableInternalRetries: boolean,
|
|
34
35
|
msiEndpoint: string,
|
|
35
36
|
secret: string
|
|
36
37
|
) {
|
|
37
|
-
super(
|
|
38
|
+
super(
|
|
39
|
+
logger,
|
|
40
|
+
nodeStorage,
|
|
41
|
+
networkClient,
|
|
42
|
+
cryptoProvider,
|
|
43
|
+
disableInternalRetries
|
|
44
|
+
);
|
|
38
45
|
|
|
39
46
|
this.msiEndpoint = msiEndpoint;
|
|
40
47
|
this.secret = secret;
|
|
@@ -54,7 +61,8 @@ export class MachineLearning extends BaseManagedIdentitySource {
|
|
|
54
61
|
logger: Logger,
|
|
55
62
|
nodeStorage: NodeStorage,
|
|
56
63
|
networkClient: INetworkModule,
|
|
57
|
-
cryptoProvider: CryptoProvider
|
|
64
|
+
cryptoProvider: CryptoProvider,
|
|
65
|
+
disableInternalRetries: boolean
|
|
58
66
|
): MachineLearning | null {
|
|
59
67
|
const [msiEndpoint, secret] = MachineLearning.getEnvironmentVariables();
|
|
60
68
|
|
|
@@ -83,6 +91,7 @@ export class MachineLearning extends BaseManagedIdentitySource {
|
|
|
83
91
|
nodeStorage,
|
|
84
92
|
networkClient,
|
|
85
93
|
cryptoProvider,
|
|
94
|
+
disableInternalRetries,
|
|
86
95
|
msiEndpoint,
|
|
87
96
|
secret
|
|
88
97
|
);
|
|
@@ -34,10 +34,17 @@ export class ServiceFabric extends BaseManagedIdentitySource {
|
|
|
34
34
|
nodeStorage: NodeStorage,
|
|
35
35
|
networkClient: INetworkModule,
|
|
36
36
|
cryptoProvider: CryptoProvider,
|
|
37
|
+
disableInternalRetries: boolean,
|
|
37
38
|
identityEndpoint: string,
|
|
38
39
|
identityHeader: string
|
|
39
40
|
) {
|
|
40
|
-
super(
|
|
41
|
+
super(
|
|
42
|
+
logger,
|
|
43
|
+
nodeStorage,
|
|
44
|
+
networkClient,
|
|
45
|
+
cryptoProvider,
|
|
46
|
+
disableInternalRetries
|
|
47
|
+
);
|
|
41
48
|
|
|
42
49
|
this.identityEndpoint = identityEndpoint;
|
|
43
50
|
this.identityHeader = identityHeader;
|
|
@@ -66,6 +73,7 @@ export class ServiceFabric extends BaseManagedIdentitySource {
|
|
|
66
73
|
nodeStorage: NodeStorage,
|
|
67
74
|
networkClient: INetworkModule,
|
|
68
75
|
cryptoProvider: CryptoProvider,
|
|
76
|
+
disableInternalRetries: boolean,
|
|
69
77
|
managedIdentityId: ManagedIdentityId
|
|
70
78
|
): ServiceFabric | null {
|
|
71
79
|
const [identityEndpoint, identityHeader, identityServerThumbprint] =
|
|
@@ -107,6 +115,7 @@ export class ServiceFabric extends BaseManagedIdentitySource {
|
|
|
107
115
|
nodeStorage,
|
|
108
116
|
networkClient,
|
|
109
117
|
cryptoProvider,
|
|
118
|
+
disableInternalRetries,
|
|
110
119
|
identityEndpoint,
|
|
111
120
|
identityHeader
|
|
112
121
|
);
|
|
@@ -20,13 +20,6 @@ import { HttpClient } from "../network/HttpClient.js";
|
|
|
20
20
|
import http from "http";
|
|
21
21
|
import https from "https";
|
|
22
22
|
import { ManagedIdentityId } from "./ManagedIdentityId.js";
|
|
23
|
-
import {
|
|
24
|
-
MANAGED_IDENTITY_HTTP_STATUS_CODES_TO_RETRY_ON,
|
|
25
|
-
MANAGED_IDENTITY_MAX_RETRIES,
|
|
26
|
-
MANAGED_IDENTITY_RETRY_DELAY,
|
|
27
|
-
} from "../utils/Constants.js";
|
|
28
|
-
import { LinearRetryPolicy } from "../retry/LinearRetryPolicy.js";
|
|
29
|
-
import { HttpClientWithRetries } from "../network/HttpClientWithRetries.js";
|
|
30
23
|
import { NodeAuthError } from "../error/NodeAuthError.js";
|
|
31
24
|
|
|
32
25
|
/**
|
|
@@ -251,6 +244,7 @@ export type ManagedIdentityNodeConfiguration = {
|
|
|
251
244
|
system: Required<
|
|
252
245
|
Pick<NodeSystemOptions, "loggerOptions" | "networkClient">
|
|
253
246
|
>;
|
|
247
|
+
disableInternalRetries: boolean;
|
|
254
248
|
};
|
|
255
249
|
|
|
256
250
|
export function buildManagedIdentityConfiguration({
|
|
@@ -276,24 +270,12 @@ export function buildManagedIdentityConfiguration({
|
|
|
276
270
|
);
|
|
277
271
|
}
|
|
278
272
|
|
|
279
|
-
// wrap the network client with a retry policy if the developer has not disabled the option to do so
|
|
280
|
-
if (!system?.disableInternalRetries) {
|
|
281
|
-
const linearRetryPolicy: LinearRetryPolicy = new LinearRetryPolicy(
|
|
282
|
-
MANAGED_IDENTITY_MAX_RETRIES,
|
|
283
|
-
MANAGED_IDENTITY_RETRY_DELAY,
|
|
284
|
-
MANAGED_IDENTITY_HTTP_STATUS_CODES_TO_RETRY_ON
|
|
285
|
-
);
|
|
286
|
-
networkClient = new HttpClientWithRetries(
|
|
287
|
-
networkClient,
|
|
288
|
-
linearRetryPolicy
|
|
289
|
-
);
|
|
290
|
-
}
|
|
291
|
-
|
|
292
273
|
return {
|
|
293
274
|
managedIdentityId: managedIdentityId,
|
|
294
275
|
system: {
|
|
295
276
|
loggerOptions,
|
|
296
277
|
networkClient,
|
|
297
278
|
},
|
|
279
|
+
disableInternalRetries: system?.disableInternalRetries || false,
|
|
298
280
|
};
|
|
299
281
|
}
|
|
@@ -4,7 +4,14 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { RequestParameterBuilder, UrlString } from "@azure/msal-common/node";
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
HttpMethod,
|
|
9
|
+
MANAGED_IDENTITY_HTTP_STATUS_CODES_TO_RETRY_ON,
|
|
10
|
+
MANAGED_IDENTITY_MAX_RETRIES,
|
|
11
|
+
MANAGED_IDENTITY_RETRY_DELAY,
|
|
12
|
+
RetryPolicies,
|
|
13
|
+
} from "../utils/Constants.js";
|
|
14
|
+
import { LinearRetryPolicy } from "../retry/LinearRetryPolicy.js";
|
|
8
15
|
|
|
9
16
|
export class ManagedIdentityRequestParameters {
|
|
10
17
|
private _baseEndpoint: string;
|
|
@@ -12,13 +19,25 @@ export class ManagedIdentityRequestParameters {
|
|
|
12
19
|
public headers: Record<string, string>;
|
|
13
20
|
public bodyParameters: Record<string, string>;
|
|
14
21
|
public queryParameters: Record<string, string>;
|
|
22
|
+
public retryPolicy: RetryPolicies;
|
|
15
23
|
|
|
16
|
-
constructor(
|
|
24
|
+
constructor(
|
|
25
|
+
httpMethod: HttpMethod,
|
|
26
|
+
endpoint: string,
|
|
27
|
+
retryPolicy?: RetryPolicies
|
|
28
|
+
) {
|
|
17
29
|
this.httpMethod = httpMethod;
|
|
18
30
|
this._baseEndpoint = endpoint;
|
|
19
31
|
this.headers = {} as Record<string, string>;
|
|
20
32
|
this.bodyParameters = {} as Record<string, string>;
|
|
21
33
|
this.queryParameters = {} as Record<string, string>;
|
|
34
|
+
|
|
35
|
+
const defaultRetryPolicy: LinearRetryPolicy = new LinearRetryPolicy(
|
|
36
|
+
MANAGED_IDENTITY_MAX_RETRIES,
|
|
37
|
+
MANAGED_IDENTITY_RETRY_DELAY,
|
|
38
|
+
MANAGED_IDENTITY_HTTP_STATUS_CODES_TO_RETRY_ON
|
|
39
|
+
);
|
|
40
|
+
this.retryPolicy = retryPolicy || defaultRetryPolicy;
|
|
22
41
|
}
|
|
23
42
|
|
|
24
43
|
public computeUri(): string {
|
package/src/packageMetadata.ts
CHANGED
package/src/utils/Constants.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { HttpStatus } from "@azure/msal-common/node";
|
|
7
|
+
import { LinearRetryPolicy } from "../retry/LinearRetryPolicy.js";
|
|
7
8
|
|
|
8
9
|
// MSI Constants. Docs for MSI are available here https://docs.microsoft.com/azure/app-service/overview-managed-identity
|
|
9
10
|
export const AUTHORIZATION_HEADER_NAME: string = "Authorization";
|
|
@@ -178,3 +179,8 @@ export const MANAGED_IDENTITY_HTTP_STATUS_CODES_TO_RETRY_ON = [
|
|
|
178
179
|
HttpStatus.SERVICE_UNAVAILABLE,
|
|
179
180
|
HttpStatus.GATEWAY_TIMEOUT,
|
|
180
181
|
];
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Retry Policy Types
|
|
185
|
+
*/
|
|
186
|
+
export type RetryPolicies = LinearRetryPolicy;
|