@azure/msal-node 3.8.1 → 3.8.3

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.
Files changed (60) hide show
  1. package/dist/cache/CacheHelpers.mjs +1 -1
  2. package/dist/cache/NodeStorage.mjs +1 -1
  3. package/dist/cache/TokenCache.mjs +1 -1
  4. package/dist/cache/distributed/DistributedCachePlugin.mjs +1 -1
  5. package/dist/cache/serializer/Deserializer.mjs +1 -1
  6. package/dist/cache/serializer/Serializer.mjs +1 -1
  7. package/dist/client/ClientApplication.mjs +1 -1
  8. package/dist/client/ClientAssertion.mjs +1 -1
  9. package/dist/client/ClientCredentialClient.mjs +1 -1
  10. package/dist/client/ConfidentialClientApplication.mjs +1 -1
  11. package/dist/client/DeviceCodeClient.mjs +1 -1
  12. package/dist/client/ManagedIdentityApplication.mjs +1 -1
  13. package/dist/client/ManagedIdentityClient.mjs +1 -1
  14. package/dist/client/ManagedIdentitySources/AppService.mjs +1 -1
  15. package/dist/client/ManagedIdentitySources/AzureArc.mjs +1 -1
  16. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs +1 -1
  17. package/dist/client/ManagedIdentitySources/CloudShell.mjs +1 -1
  18. package/dist/client/ManagedIdentitySources/Imds.mjs +1 -1
  19. package/dist/client/ManagedIdentitySources/MachineLearning.mjs +1 -1
  20. package/dist/client/ManagedIdentitySources/ServiceFabric.mjs +1 -1
  21. package/dist/client/OnBehalfOfClient.mjs +1 -1
  22. package/dist/client/PublicClientApplication.mjs +1 -1
  23. package/dist/client/UsernamePasswordClient.mjs +1 -1
  24. package/dist/config/Configuration.mjs +1 -1
  25. package/dist/config/ManagedIdentityId.mjs +1 -1
  26. package/dist/config/ManagedIdentityRequestParameters.mjs +1 -1
  27. package/dist/crypto/CryptoProvider.mjs +1 -1
  28. package/dist/crypto/GuidGenerator.mjs +1 -1
  29. package/dist/crypto/HashUtils.mjs +1 -1
  30. package/dist/crypto/PkceGenerator.mjs +1 -1
  31. package/dist/error/ManagedIdentityError.mjs +1 -1
  32. package/dist/error/ManagedIdentityErrorCodes.mjs +1 -1
  33. package/dist/error/NodeAuthError.mjs +1 -1
  34. package/dist/index.mjs +1 -1
  35. package/dist/internals.mjs +1 -1
  36. package/dist/network/HttpClient.d.ts +29 -2
  37. package/dist/network/HttpClient.d.ts.map +1 -1
  38. package/dist/network/HttpClient.mjs +296 -250
  39. package/dist/network/HttpClient.mjs.map +1 -1
  40. package/dist/network/HttpClientWithRetries.mjs +1 -1
  41. package/dist/network/LoopbackClient.mjs +1 -1
  42. package/dist/packageMetadata.d.ts +1 -1
  43. package/dist/packageMetadata.mjs +2 -2
  44. package/dist/protocol/Authorize.mjs +1 -1
  45. package/dist/retry/DefaultManagedIdentityRetryPolicy.mjs +1 -1
  46. package/dist/retry/ExponentialRetryStrategy.mjs +1 -1
  47. package/dist/retry/ImdsRetryPolicy.mjs +1 -1
  48. package/dist/retry/LinearRetryStrategy.mjs +1 -1
  49. package/dist/utils/Constants.mjs +1 -1
  50. package/dist/utils/EncodingUtils.mjs +1 -1
  51. package/dist/utils/NetworkUtils.mjs +1 -1
  52. package/dist/utils/TimeUtils.mjs +1 -1
  53. package/lib/msal-node.cjs +365 -313
  54. package/lib/msal-node.cjs.map +1 -1
  55. package/lib/types/network/HttpClient.d.ts +29 -2
  56. package/lib/types/network/HttpClient.d.ts.map +1 -1
  57. package/lib/types/packageMetadata.d.ts +1 -1
  58. package/package.json +2 -2
  59. package/src/network/HttpClient.ts +399 -314
  60. package/src/packageMetadata.ts +1 -1
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" resolution-mode="require"/>
2
2
  /// <reference types="node" resolution-mode="require"/>
3
- import { INetworkModule, NetworkRequestOptions, NetworkResponse } from "@azure/msal-common/node";
3
+ import { INetworkModule, NetworkRequestOptions, NetworkResponse, LoggerOptions } from "@azure/msal-common/node";
4
4
  import http from "http";
5
5
  import https from "https";
6
6
  /**
@@ -9,7 +9,9 @@ import https from "https";
9
9
  export declare class HttpClient implements INetworkModule {
10
10
  private proxyUrl;
11
11
  private customAgentOptions;
12
- constructor(proxyUrl?: string, customAgentOptions?: http.AgentOptions | https.AgentOptions);
12
+ private logger;
13
+ private isPiiEnabled;
14
+ constructor(proxyUrl?: string, customAgentOptions?: http.AgentOptions | https.AgentOptions, loggerOptions?: LoggerOptions);
13
15
  /**
14
16
  * Http Get request
15
17
  * @param url
@@ -22,5 +24,30 @@ export declare class HttpClient implements INetworkModule {
22
24
  * @param options
23
25
  */
24
26
  sendPostRequestAsync<T>(url: string, options?: NetworkRequestOptions): Promise<NetworkResponse<T>>;
27
+ private networkRequestViaProxy;
28
+ private networkRequestViaHttps;
29
+ /**
30
+ * Check if extra parsing is needed on the repsonse from the server
31
+ * @param statusCode {number} the status code of the response from the server
32
+ * @param statusMessage {string | undefined} the status message of the response from the server
33
+ * @param headers {Record<string, string>} the headers of the response from the server
34
+ * @param body {string} the body from the response of the server
35
+ * @returns {Object} JSON parsed body or error object
36
+ */
37
+ private parseBody;
38
+ /**
39
+ * Helper function to log a formatted message containing URLs, with PII-aware sanitization
40
+ * @param label {string} the label for the log message
41
+ * @param urlString {string} the URL to log
42
+ */
43
+ private logUrlWithPiiAwareness;
44
+ /**
45
+ * Helper function to determine if a request should be destroyed based on status code and response body.
46
+ * Checks if the response is an error and not part of the device code flow (authorization_pending).
47
+ * @param statusCode {number} the status code of the response
48
+ * @param networkResponse {NetworkResponse<T>} the network response object
49
+ * @returns {boolean} true if the request should be destroyed, false otherwise
50
+ */
51
+ private shouldDestroyRequest;
25
52
  }
26
53
  //# sourceMappingURL=HttpClient.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"HttpClient.d.ts","sourceRoot":"","sources":["../../../src/network/HttpClient.ts"],"names":[],"mappings":";;AAKA,OAAO,EACH,cAAc,EACd,qBAAqB,EACrB,eAAe,EAElB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAA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AE,MAAM,GACjB,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IAkB9B;;;;OAIG;IACU,oBAAoB,CAAC,CAAC,EAC/B,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,qBAAqB,GAChC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IAQ9B,OAAO,CAAC,sBAAsB,CAwM5B;IAEF,OAAO,CAAC,sBAAsB,CAmH5B;IAEF;;;;;;;OAOG;IACH,OAAO,CAAC,SAAS,CA8Cf;IAEF;;;;OAIG;IACH,OAAO,CAAC,sBAAsB,CAoB5B;IAEF;;;;;;OAMG;IACH,OAAO,CAAC,oBAAoB,CAgB1B;CACL"}
@@ -1,3 +1,3 @@
1
1
  export declare const name = "@azure/msal-node";
2
- export declare const version = "3.8.1";
2
+ export declare const version = "3.8.3";
3
3
  //# sourceMappingURL=packageMetadata.d.ts.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@azure/msal-node",
4
- "version": "3.8.1",
4
+ "version": "3.8.3",
5
5
  "author": {
6
6
  "name": "Microsoft",
7
7
  "email": "nugetaad@microsoft.com",
@@ -83,7 +83,7 @@
83
83
  "yargs": "^17.3.1"
84
84
  },
85
85
  "dependencies": {
86
- "@azure/msal-common": "15.13.1",
86
+ "@azure/msal-common": "15.13.2",
87
87
  "jsonwebtoken": "^9.0.0",
88
88
  "uuid": "^8.3.0"
89
89
  },