Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Thank you for the fantastic library of JSON Web functions.
I have been trying to use
jose-browser-runtime/jwks/remote
inside Cloudflare workersAlthough the code executes server side, the Cloudflare workers environment lacks many of node-js libraries. The environment is much more similar to a web worker running insider a browser.
Cloudflare provides a fetch function very similar to the standard fetch function, however Cloudflare's Request parameter lacks some of the properties in the standard Request parameter.
Unfortunately, if the user provides Request parameter options such as
mode
,credentials
orreferrerPolicy
, then Cloudflare's fetch function will throw an error of the formOther libraries such as the aws sdk have encounter similar issues while being used inside cloudflare workers.
aws/aws-sdk-js-v3#1165
Currently these parameters are specified by the library and can not be configured.
https://github.com/panva/jose/blob/main/src/runtime/browser/fetch_jwks.ts#L15-L17
This pull request allows the user to configure/override these default parameters with
undefined
values, so that it can be used inside cloudflare workers.