Skip to content

crypto.hkdf support for PASETO token support #15371

@airhorns

Description

@airhorns

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/paseto@3.1.0/node_modules/paseto/lib/help/crypto_worker.js:14:17
      at anonymous (native:1:1)
      at /Users/airhorns/Code/gadget/node_modules/.pnpm/paseto@3.1.0/node_modules/paseto/lib/help/sign.js:1:9
      at anonymous (native:1:1)
      at /Users/airhorns/Code/gadget/node_modules/.pnpm/paseto@3.1.0/node_modules/paseto/lib/v1/sign.js:8:1
      at anonymous (native:1:1)
      at /Users/airhorns/Code/gadget/node_modules/.pnpm/paseto@3.1.0/node_modules/paseto/lib/v1/index.js:1:7
      at anonymous (native:1:1)
      at /Users/airhorns/Code/gadget/node_modules/.pnpm/paseto@3.1.0/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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingconfirmed bugWe can reproduce this issuenode.jsCompatibility with Node.js APIsnode:crypto

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions