Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tables] Add missing browser mappings #15944

Merged
merged 2 commits into from
Jun 24, 2021
Merged

[Tables] Add missing browser mappings #15944

merged 2 commits into from
Jun 24, 2021

Conversation

joheredi
Copy link
Member

Fixes #15921

There were 2 issues related to browsers:

  1. In one of the util files we are importing "url" instead of the util "./url" which causes URL not to be present in browsers.
  2. Missing browser mapping for computeHMACSHA256. Tables don't support NamedKey authentication on browsers for security reasons (risky to have the keys in the browser).
    • Added a shim function that throws if it is attempted to be used in browser. All entry points to this function are already throwing
    • Note: I looked into using @azure/core-crypto however I wasn't able to use it because it exposes an async function and the public API that consumes this is synchronous 😢

Copy link
Member

@ellismg ellismg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@joheredi joheredi merged commit 1f6b914 into Azure:main Jun 24, 2021
@ramya-rao-a
Copy link
Contributor

@chradek Can we log an issue to track the concern that Jose mentioned above around core-crypto?

@chradek
Copy link
Contributor

chradek commented Jun 25, 2021

What is the API in question that is sync and uses crypto?

There is no sync version of SHA256 HMAC crypto support in browsers, so core-crypto can't be changed to use a sync version.

@ellismg
Copy link
Member

ellismg commented Jun 25, 2021

What is the API in question that is sync and uses crypto?

From a brief look at the code, it's all around generating SAS tokens:

generateAccountSas is one such example, it's a prompt function but uses SHA256 HMAC to sign the SAS signature it generates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@azure/data-tables url__WEBPACK_IMPORTED_MODULE_0__.URL is not a constructor
4 participants