feat!: Using jose instead of jws#494
Conversation
|
🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use -- conventional-commit-lint bot |
a2fb6b4 to
85be330
Compare
| "@types/mocha": "^9.0.0", | ||
| "@types/node": "^20.0.0", | ||
| "c8": "^9.0.0", | ||
| "cheerio": "1.0.0-rc.12", |
|
Hey folks, we just bumped into this. Would be really valuable to the increasing number of cloudflare users to merge this ❤️ |
1 similar comment
|
Hey folks, we just bumped into this. Would be really valuable to the increasing number of cloudflare users to merge this ❤️ |
|
I'm going to rebase this soon, so that it'd be easier to merge if needed. |
Can't open an issue on the fork so hoping this is the correct place. I've been using your fork for the past few months in a cloudflare worker and it's been great. I started getting the error "Error: unsupported_grant_type: Invalid grant_type:" and suspect the last commit was the cause because it was so recent. It could be something else but just thought I'd let you know. Thanks |
Sorry for potentially breaking something for you. I'll make sure that doesn't happen in the future. For now, make sure that you update the googleapis package that you are using. And let me know if the issue presists. If it does, please make a repo for it so I could test it out. |
All good, managed to find a workaround using the crypto subtle api. |
|
Unfortunately I think I will have to wait on considering this change for later this year (not the 8 release). We use this code in auth and currently don't really have good enough integration tests to consider the full ramifications of this type of breaking change. I will, however, make sure to discuss with the team and consider it for the Node 20 change (later this year). Apologies for the delay! Closing for cleanliness but will keep the issue open. |
|
No problem, I appreciate the response! In the meantime I'll revert my fork to use the old code so that it works with v7. |
|
For those coming here from BjornTheProgrammer's blogpost (here), a Cloudflare engineer's stand-alone OAuth2 impl for |
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes googleapis/google-cloud-node-core#872 🦕
This pull request would change to using
jose, a cross-runtime library for web tokens, instead ofjws. The significance of this has been described in the issue. But it would make most if not allgoogleapisavailable on platforms like Cloudfare workers.BREAKING CHANGE:
There are possible breaking changes. The test had to be modified to comply with pkcs8 and 2048 bits long. I could make this support pkcs1 and convert it to pkcs8, but it looks like the actual private keys returned by Google are pkcs8, and this might've been an artifact of just testing. Verification should be done about that before hand. Additionally node support has been bumped to >= 15, as that is when the WebCrypto api's were added to node.