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

crypto.hkdf support for PASETO token support #15371

Open
airhorns opened this issue Nov 23, 2024 · 0 comments
Open

crypto.hkdf support for PASETO token support #15371

airhorns opened this issue Nov 23, 2024 · 0 comments
Labels
bug Something isn't working confirmed bug We can reproduce this issue node:crypto

Comments

@airhorns
Copy link

airhorns commented Nov 23, 2024

What version of Bun is running?

1.1.36+ededc168c

What platform is your computer?

Darwin 24.1.0 arm64 arm

What steps can reproduce the bug?

Import the paseto module from NPM (a better version of jwt), get this error:

18 | export default "internal:promisify";
           ^
TypeError: The "original" argument must be of type Function
      at promisify2 (internal:promisify:18:7)
      at /Users/airhorns/Code/gadget/node_modules/.pnpm/[email protected]/node_modules/paseto/lib/help/crypto_worker.js:14:17
      at anonymous (native:1:1)
      at /Users/airhorns/Code/gadget/node_modules/.pnpm/[email protected]/node_modules/paseto/lib/help/sign.js:1:9
      at anonymous (native:1:1)
      at /Users/airhorns/Code/gadget/node_modules/.pnpm/[email protected]/node_modules/paseto/lib/v1/sign.js:8:1
      at anonymous (native:1:1)
      at /Users/airhorns/Code/gadget/node_modules/.pnpm/[email protected]/node_modules/paseto/lib/v1/index.js:1:7
      at anonymous (native:1:1)
      at /Users/airhorns/Code/gadget/node_modules/.pnpm/[email protected]/node_modules/paseto/lib/index.js:1:1
      at unknown:11:43
      at processTicksAndRejections (unknown:7:39)

Bun v1.1.36 (macOS arm64)

the error comes from paseto calling utils.promisify(crypto.hkdf), which is undefined in bun

What is the expected behavior?

Module requires just fine because crypto.hkdf is defined.

What do you see instead?

The above error

Additional information

PASETO calls itself a modern replacement to JWT and claims to be better in just about every way -- it'd be great to get support for it for those of us with existing projects using it in Node!

@airhorns airhorns added bug Something isn't working needs triage labels Nov 23, 2024
@airhorns airhorns changed the title crypto.hkdf support for PASETO token support crypto.hkdf support for PASETO token support Nov 23, 2024
@RiskyMH RiskyMH added node:crypto confirmed bug We can reproduce this issue and removed needs triage labels Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working confirmed bug We can reproduce this issue node:crypto
Projects
None yet
Development

No branches or pull requests

2 participants