@azure/core-client 1.3.3-alpha.20211101.2 → 1.4.0-alpha.20211214.4

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/CHANGELOG.md CHANGED
@@ -1,11 +1,11 @@
1
1
  # Release History
2
2
 
3
- ## 1.3.3 (Unreleased)
3
+ ## 1.4.0 (Unreleased)
4
4
 
5
5
  ### Features Added
6
6
 
7
7
  - Added a new function `authorizeRequestOnClaimChallenge`, that can be used with the `@azure/core-rest-pipeline`'s `bearerTokenAuthenticationPolicy` to support [Continuous Access Evaluation (CAE) challenges](https://docs.microsoft.com/azure/active-directory/conditional-access/concept-continuous-access-evaluation).
8
- - Call the `bearerTokenAuthenticationPolicy` with the following options: `bearerTokenAuthenticationPolicy({ authorizeRequestOnChallenge: authorizeRequestOnClaimChallenge })`. Once provided, the `bearerTokenAuthenticationPolicy` policy will internally handle Continuous Access Evaluation (CAE) challenges. When it can't complete a challenge it will return the 401 (unauthorized) response from ARM.
8
+ - Call the `bearerTokenAuthenticationPolicy` with the following options: `bearerTokenAuthenticationPolicy({ authorizeRequestOnChallenge: authorizeRequestOnClaimChallenge })`. Once provided, the `bearerTokenAuthenticationPolicy` policy will internally handle Continuous Access Evaluation (CAE) challenges. When it can't complete a challenge it will return the 401 (unauthorized) response from ARM.
9
9
 
10
10
  ### Breaking Changes
11
11
 
@@ -13,6 +13,12 @@
13
13
 
14
14
  ### Other Changes
15
15
 
16
+ ## 1.3.3 (2021-12-02)
17
+
18
+ ### Bugs Fixed
19
+
20
+ - Added a check to handle undefined value during the parsing of query parameters. Please refer to [PR #18621](https://github.com/Azure/azure-sdk-for-js/pull/18621) for further details.
21
+
16
22
  ## 1.3.2 (2021-10-25)
17
23
 
18
24
  ### Bugs Fixed
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Azure Core Service client library for JavaScript (Experimental)
1
+ # Azure Core Service client library for JavaScript
2
2
 
3
3
  This library is primarily intended to be used in code generated by [AutoRest](https://github.com/Azure/Autorest) and [`autorest.typescript`](https://github.com/Azure/autorest.typescript).
4
4
 
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var coreRestPipeline = require('@azure/core-rest-pipeline');
6
- var logger$1 = require('@azure/logger');
6
+ var logger = require('@azure/logger');
7
7
  require('@azure/core-asynciterator-polyfill');
8
8
 
9
9
  // Copyright (c) Microsoft Corporation.
@@ -144,6 +144,7 @@ function decodeString(value) {
144
144
  /**
145
145
  * Decodes a base64 string into a string.
146
146
  * @param value - the base64 string to decode
147
+ * @internal
147
148
  */
148
149
  function decodeStringToString(value) {
149
150
  return Buffer.from(value, "base64").toString();
@@ -1354,12 +1355,15 @@ function appendQueryParams(url, queryParams, sequenceParams, noOverwrite = false
1354
1355
  if (typeof value === "string") {
1355
1356
  searchPieces.push(`${name}=${value}`);
1356
1357
  }
1357
- else {
1358
+ else if (Array.isArray(value)) {
1358
1359
  // QUIRK: If we get an array of values, include multiple key/value pairs
1359
1360
  for (const subValue of value) {
1360
1361
  searchPieces.push(`${name}=${subValue}`);
1361
1362
  }
1362
1363
  }
1364
+ else {
1365
+ searchPieces.push(`${name}=${value}`);
1366
+ }
1363
1367
  }
1364
1368
  // QUIRK: we have to set search manually as searchParams will encode comma when it shouldn't.
1365
1369
  parsedUrl.search = searchPieces.length ? `?${searchPieces.join("&")}` : "";
@@ -1892,7 +1896,7 @@ function getCredentialScopes(options) {
1892
1896
  }
1893
1897
 
1894
1898
  // Copyright (c) Microsoft Corporation.
1895
- const logger = logger$1.createClientLogger("authorizeRequestOnClaimChallenge");
1899
+ const defaultLogger = logger.createClientLogger("authorizeRequestOnClaimChallenge");
1896
1900
  /**
1897
1901
  * Converts: `Bearer a="b", c="d", Bearer d="e", f="g"`.
1898
1902
  * Into: `[ { a: 'b', c: 'd' }, { d: 'e', f: 'g' } ]`.
@@ -1936,6 +1940,7 @@ function parseCAEChallenge(challenges) {
1936
1940
  */
1937
1941
  async function authorizeRequestOnClaimChallenge(onChallengeOptions) {
1938
1942
  const { scopes, response } = onChallengeOptions;
1943
+ const logger = onChallengeOptions.logger || defaultLogger;
1939
1944
  const challenge = response.headers.get("WWW-Authenticate");
1940
1945
  if (!challenge) {
1941
1946
  logger.info(`The WWW-Authenticate header was missing. Failed to perform the Continuous Access Evaluation authentication flow.`);