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

feat!: use Web Crypto API #41

Merged
merged 3 commits into from
Nov 27, 2023
Merged

feat!: use Web Crypto API #41

merged 3 commits into from
Nov 27, 2023

Conversation

rexxars
Copy link
Member

@rexxars rexxars commented Nov 22, 2023

Supersedes #40
Fixes #38

While the idea of using the Web Crypto API is fine, it requires a significant amount of changes due to the async nature of the API. I still think it is worth moving to however, since it broadens the range of ecosystems we can support (Browser, Deno, Bun, workers etc) so this PR switches to it and moves to async functions.

Also removes the base64url dependency, since we can achieve the same in plain JS and avoid having to bundle.

Now requires Node 18 or higher.

BREAKING CHANGE: Replace the Node.js `crypto` API with the Web Crypto API,
enabling usage in more environments. All assertion/checking functions are
now async, eg return Promises instead of straight booleans.

BREAKING CHANGE: Only Node.js version 18 and higher is now supported.
@rexxars rexxars requested a review from stipsan November 22, 2023 21:52
@rexxars rexxars mentioned this pull request Nov 22, 2023
Copy link
Member

@stipsan stipsan left a comment

Choose a reason for hiding this comment

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

Awesome rewrite 🥳

Comment on lines 60 to +61
- os: ubuntu-latest
node: lts/-1
node: lts/*
Copy link
Member

Choose a reason for hiding this comment

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

This block can be deleted as it's already included in the base matrix 😌

@stipsan stipsan merged commit fb19bac into main Nov 27, 2023
8 checks passed
@stipsan stipsan deleted the feat/web-crypto-api branch November 27, 2023 08:44
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incompatible with edge environment due to "crypto" import
2 participants