Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.3k
crypto: clarify require("crypto").getRandomValues is Node.js specific#41782
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
nodejs-github-bot commented Jan 31, 2022
Review requested:
|
Uh oh!
There was an error while loading. Please reload this page.
aduh95 commented Feb 2, 2022
@jasnell could you help us here? It seems there is a confusion on what is the plan for exposing a
If it's the latter, then I guess we should land this PR, as well as #41760, but this would need your input to move forward. |
jasnell commented Feb 2, 2022
My preference is exposing |
aduh95 commented Feb 2, 2022
This is going to create all sort of compatibility problems (I've been myself affected by #41760), I'm -1 on this idea. Adding it to the TSC agenda so we can discuss this further. |
tniessen commented Feb 2, 2022 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
I suggested this when talking to @jasnell earlier, except that I'd maybe add the aliases to |
jasnell commented Feb 5, 2022
One possible approach we can take here is to modify Node.js' |
aduh95 commented Feb 6, 2022 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
It wouldn't help folks doing Could you maybe explain why we wouldn't expose |
tniessen commented Feb 10, 2022
Yes, I think that was the motivation behind #41266 (see #41266 (comment)). |
aduh95 commented Feb 11, 2022
FYI, I've opened #41938 to suggest exposing the Web Crypto on the global scope instead of the Node.js one. |
PR-URL: #41938 Refs: https://developer.mozilla.org/en-US/docs/Web/API/crypto_property Refs: #41782 Refs: https://w3c.github.io/webcrypto Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Filip Skokan <[email protected]>
tniessen commented Feb 16, 2022
aduh95 commented Feb 16, 2022
I don't think we get much value from having
Whatever we decide to do we the alias, I think we should land this ASAP: all this PR is doing is documenting that the shortcut is not exactly the same as the web version, and it unblocks #41760. Currently our docs for Web crypto are "broken", for example here we tell the user to use object destructuring to get a reference to Lines 128 to 159 in b8de7aa
If the user tries to use this code in a browser or Deno, it will throw an arguably quite surprising error (e.g. Chromium throws TypeError: Illegal invocation). |
mcollina left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
mcollina commented Feb 16, 2022
@jasnell have you got any concerns in landing this as-is? |
Uh oh!
There was an error while loading. Please reload this page.
nodejs-github-bot commented Feb 19, 2022
nodejs-github-bot commented Feb 19, 2022
nodejs-github-bot commented Feb 19, 2022
nodejs-github-bot commented Feb 19, 2022
PR-URL: nodejs#41938 Refs: https://developer.mozilla.org/en-US/docs/Web/API/crypto_property Refs: nodejs#41782 Refs: https://w3c.github.io/webcrypto Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Filip Skokan <[email protected]>
PR-URL: #41938 Refs: https://developer.mozilla.org/en-US/docs/Web/API/crypto_property Refs: #41782 Refs: https://w3c.github.io/webcrypto Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Filip Skokan <[email protected]>
PR-URL: #41938 Refs: https://developer.mozilla.org/en-US/docs/Web/API/crypto_property Refs: #41782 Refs: https://w3c.github.io/webcrypto Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Filip Skokan <[email protected]>
aduh95 commented Feb 22, 2022
Landed in 470c284 |
Refs: nodejs#41779 Refs: nodejs#41760 PR-URL: nodejs#41782 Reviewed-By: Matteo Collina <[email protected]>
danielleadams commented Apr 19, 2022
@aduh95 this doesn't land cleanly on v16.x-staging. Can you make a backport for this? Thank you |
PR-URL: nodejs#41938 Refs: https://developer.mozilla.org/en-US/docs/Web/API/crypto_property Refs: nodejs#41782 Refs: https://w3c.github.io/webcrypto Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Filip Skokan <[email protected]>
PR-URL: #41938 Refs: https://developer.mozilla.org/en-US/docs/Web/API/crypto_property Refs: #41782 Refs: https://w3c.github.io/webcrypto Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Filip Skokan <[email protected]>
Refs: #41779
Refs: #41760