-
Notifications
You must be signed in to change notification settings - Fork 56
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
feat(core): crypto compatibility for Workers #547
Conversation
docs: mention correct default value for COOP
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Co-authored-by: Jakub Andrzejewski <[email protected]>
@Baroshem for some reason I had troubles rebasing the branch onto 2.1.0 - sorrry the commit timeline looks awful, but actually the amount of changes is very small |
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.
Nice job @vejja !
No worries about the commit history. Glad you have managed to make it work. Proceed with merging when you feel ready. @brewwa would you be able to test this branch? :)
Hey Jakub, I tested it on a private repo that @brewaa provided, and it works on Cloudflare. Will merge |
Resolves #541
Types of changes
Description
This PR replaces the NodeJS cryptographic primitives used in this codebase by their equivalents from the Javascript WebCrypto API.
The fundamental reason for this rewrite is to provide full compatibility with Worker-based environments, where Node's crypto module might not always be available.
The issue was first raised with Cloudflare's Workers. While manual configuration of Cloudflare worker settings (via their nodejs_compatibility flag) is possible, we believe it is better to offer a universal approach that will offer strong cryptographic guarantees in all environments.
Note: as part of this update, the NodeJS minimal version needs to be updated to v20. This is required to ensure that
crypto
is available in the global scope.Checklist: