-
Notifications
You must be signed in to change notification settings - Fork 16
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
Deno 1.13: Argument of type "jwk" is not assignable to parameter of type "raw" #39
Comments
Maybe it is related to denoland/deno#11481. denoland/deno#11662 |
I have the same error |
Whats the solution to this |
this problem happened for me and I solved it in these steps: 1.because I had used "djwt" https://deno.land/x/[email protected] so I had to update it to the last release. 2.in the new release of djwt the format of the key has changed! and you should declare key using a function(according to djwt documentation). `const key = await crypto.subtle.generateKey( const jwt = await create({ alg: "HS512", typ: "JWT" }, { foo: "bar" }, key); now you are done! **look which library have you used in your project(like denon,djwt,...), update them after upgrading deno ** |
As this library directly uses deno's web crypto api, there's no solution yet because it's an upstream issue: |
The unfortunate thing is that this library doesn't need WebCrypto at all. It was written to automatically switch to subtle crypto when available. Which didn't go well when subtle crypto was added with none of the expected algorithms, and similarly limited types as well. Perhaps a good route to restore this library's function would be removing the unsupported subtle crypto codepaths & restoring them once Deno ships a release with the needed features. I see It seems |
It should be fixed for next deno release though. It has been implemented on canary since from what I seen. I don't remember the release cycle but I think it's 2-4 weeks for minors so eventually it'll autofix with time |
Ok so there's two different types of problem resulting from Deno implementing Subtle Crypto. The first is the typecheck issue described in this issue. Supposedly the fix denoland/deno#11716 will be in the next Deno canary. It doesn't seem to be in the latest canary, but the merge was recent. So apps depending on signing things with external RSA keys will just need to skip the current Deno release. (though The second issue is that In my previous comment I hadn't yet untangled the two different regressions. It's more clear now that the second issue would be a second ticket. It hasn't triggered yet as of Deno 1.13.2 and the codepath is only used for encrypt/decrypt operations, so it's not a problem for JWTs & maybe the API will be ready by the next Deno minor. 🤷 |
@danopia Thanks a lot for the additional details 👍 |
Does the new release of Deno v1.14 help with fixing this? |
@laughedelic actually it got rid of that crypto bugs. i see deno is growing fast |
Yes, Deno v1.14 includes enough types for god_crypto to pass typecheck again. Also, as I warned above, Deno v1.14 now includes enough WebCrypto for god_crypto's encryption/decryption to fail. This is reproducible with the god_crypto test suite. test results
So for JWT stuff aka signing/verifying if you want to stick with god_crypto just skip Deno v1.13 and use Deno v1.14 |
After upgrading to Deno v1.13.0 released today this library, specifically RSA can no longer be imported due to a typescript error.
in deno interpreter
this works fine in Deno 1.12.x
The text was updated successfully, but these errors were encountered: