From 6a6363848e0a8d2e519b6ca9b6c90512c657ed81 Mon Sep 17 00:00:00 2001 From: Jose Manuel Heredia Hidalgo Date: Wed, 23 Jun 2021 21:46:36 -0700 Subject: [PATCH 1/2] Add missing browser mappings --- sdk/tables/data-tables/package.json | 1 + .../data-tables/src/utils/computeHMACSHA256.browser.ts | 6 ++++++ sdk/tables/data-tables/src/utils/isCosmosEndpoint.ts | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 sdk/tables/data-tables/src/utils/computeHMACSHA256.browser.ts diff --git a/sdk/tables/data-tables/package.json b/sdk/tables/data-tables/package.json index 531c45096fae..cc8659d93f78 100644 --- a/sdk/tables/data-tables/package.json +++ b/sdk/tables/data-tables/package.json @@ -9,6 +9,7 @@ "./dist-esm/src/tablesNamedCredentialPolicy.js": "./dist-esm/src/tablesNamedCredentialPolicy.browser.js", "./dist-esm/src/utils/accountConnectionString.js": "./dist-esm/src/utils/accountConnectionString.browser.js", "./dist-esm/src/utils/url.js": "./dist-esm/src/utils/url.browser.js", + "./dist-esm/src/utils/computeHMACSHA256.js": "./dist-esm/src/utils/computeHMACSHA256.browser.js", "./dist-esm/src/utils/bufferSerializer.js": "./dist-esm/src/utils/bufferSerializer.browser.js", "./dist-esm/src/utils/transactionHeaders.js": "./dist-esm/src/utils/transactionHeaders.browser.js", "./dist-esm/test/public/utils/env.js": "./dist-esm/test/public/utils/env.browser.js" diff --git a/sdk/tables/data-tables/src/utils/computeHMACSHA256.browser.ts b/sdk/tables/data-tables/src/utils/computeHMACSHA256.browser.ts new file mode 100644 index 000000000000..531c57276276 --- /dev/null +++ b/sdk/tables/data-tables/src/utils/computeHMACSHA256.browser.ts @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +export function computeHMACSHA256(_stringToSign: string, _accountKey: string): string { + throw new Error("computeHMACSHA256 is not supported in the browser"); +} diff --git a/sdk/tables/data-tables/src/utils/isCosmosEndpoint.ts b/sdk/tables/data-tables/src/utils/isCosmosEndpoint.ts index 86d1b4d30425..5ae4984b7fc8 100644 --- a/sdk/tables/data-tables/src/utils/isCosmosEndpoint.ts +++ b/sdk/tables/data-tables/src/utils/isCosmosEndpoint.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { URL } from "url"; +import { URL } from "./url"; export function isCosmosEndpoint(url: string): boolean { const parsedURL = new URL(url); From 8cc9108931ad39122654c8f5a7c68d4154a2314e Mon Sep 17 00:00:00 2001 From: Jose Manuel Heredia Hidalgo Date: Wed, 23 Jun 2021 21:55:10 -0700 Subject: [PATCH 2/2] Update changelog --- sdk/tables/data-tables/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/tables/data-tables/CHANGELOG.md b/sdk/tables/data-tables/CHANGELOG.md index 089855f3f593..47ecf664cf82 100644 --- a/sdk/tables/data-tables/CHANGELOG.md +++ b/sdk/tables/data-tables/CHANGELOG.md @@ -16,6 +16,7 @@ Thank you to our developer community members who helped to make the Azure Tables - Fix [#15664](https://github.com/Azure/azure-sdk-for-js/issues/15701), adding check to make sure we always have only one forward slash (`/`) added to the end of the URL [#15698](https://github.com/Azure/azure-sdk-for-js/pull/15698) (A community contribution, courtesy of _[eestein](https://github.com/eestein))_ - Fix [#15701](https://github.com/Azure/azure-sdk-for-js/issues/15701) by improving error handling and reporting on `submitTransaction`. [#15852](https://github.com/Azure/azure-sdk-for-js/pull/15852) +- Fix [#15921](https://github.com/Azure/azure-sdk-for-js/issues/15921) incorrect `url` import and missing browser mapping for `computeHMACSHA256` [#15944](https://github.com/Azure/azure-sdk-for-js/pull/15944) ## 12.0.0 (2021-06-09)