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

bug: Can't sign or encrypt on Node v11.14.0 #43

Closed
1 of 2 tasks
niekvb opened this issue Sep 16, 2019 · 1 comment
Closed
1 of 2 tasks

bug: Can't sign or encrypt on Node v11.14.0 #43

niekvb opened this issue Sep 16, 2019 · 1 comment
Labels
wontfix This will not be worked on

Comments

@niekvb
Copy link

niekvb commented Sep 16, 2019

Describe the bug
This package does not work properly on Node v11.14.0. Using the JWT.sign() and/or JWE.encrypt() method(s) result in the following exception:

TypeError: keyObject.asInput is not a function
    at sign (/node_modules/@panva/jose/lib/jwa/rsassa_pss.js:25:27)
    at sign (/node_modules/@panva/jose/lib/jwa/index.js:58:29)
    at Sign.[PROCESS_RECIPIENT] (/node_modules/@panva/jose/lib/jws/sign.js:108:50)
    at Array.forEach (<anonymous>)
    at Sign.sign (/node_modules/@panva/jose/lib/jws/sign.js:126:24)
    at single (/node_modules/@panva/jose/lib/jws/index.js:7:14)
    at Object.module.exports [as sign] (/node_modules/@panva/jose/lib/jwt/sign.js:77:14)
    at Object.<anonymous> (/dist/modules/authorize/index.js:12:24)
    at Module._compile (internal/modules/cjs/loader.js:816:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
    at Module.load (internal/modules/cjs/loader.js:685:32)
    at Function.Module._load (internal/modules/cjs/loader.js:620:12)
    at Module.require (internal/modules/cjs/loader.js:723:19)
    at require (internal/modules/cjs/helpers.js:14:16)
    at Object.<anonymous> (/dist/server.js:8:21)
    at Module._compile (internal/modules/cjs/loader.js:816:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
    at Module.load (internal/modules/cjs/loader.js:685:32)
    at Function.Module._load (internal/modules/cjs/loader.js:620:12)
    at Function.Module.runMain (internal/modules/cjs/loader.js:877:12)
    at internal/main/run_main_module.js:21:11

To Reproduce

Steps to reproduce the behaviour:

const jose = require('@panva/jose');

const jwk = jose.JWK.generate("RSA");
const jwt = jose.JWT.sign({ abc: 123 }, jwk);
const jwe = jose.JWE.encrypt(jwt, jwk);

Expected behaviour
Proper signing and encryption of the token.

Environment:

  • @panva/jose version: 1.9.1
  • node version: v11.14.0

Additional context
The README file states that Node >= v12.0.0 is recommended, so this might be a wontfix. BUT the information in this issue might be useful to others.

  • the bug is happening on latest @panva/jose too.
  • i have searched the issues tracker on github for similar issues and couldn't find anything related.
@niekvb niekvb added the bug Something isn't working label Sep 16, 2019
@panva
Copy link
Owner

panva commented Sep 16, 2019

The supported runtime is ^10.13.0 || >=12.0.0

11.x is not something i will be figuring out backports for since it has reached its end of life in June

@panva panva closed this as completed Sep 16, 2019
@panva panva added wontfix This will not be worked on and removed bug Something isn't working labels Sep 16, 2019
@github-actions github-actions bot locked and limited conversation to collaborators Apr 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants