node-jwks-rsa icon indicating copy to clipboard operation
node-jwks-rsa copied to clipboard

jwksUri option should be optional

Open webJose opened this issue 9 months ago • 0 comments

Checklist

  • [x] I have looked into the Readme and Examples, and have not found a suitable solution or answer.
  • [x] I have searched the issues and have not found a suitable solution or answer.
  • [x] I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • [x] I agree to the terms within the Auth0 Code of Conduct.

Description

When setting a custom fetcher via the options' fetcher property, the jwksUri option is not needed. Right now, jwksUri is not optional, so this raises a TS error.

Reproduction

const expressJwt = jwksClient.expressJwtSecret({
    jwksUri: undefined!, // Look how I had to add (!) to suppress the TS error
    fetcher: () => getAzureKeys(),
    cache: true,
    rateLimit: false,
});

Additional context

No response

jwks-rsa version

3.2.0

Node.js version

22

webJose avatar Apr 04 '25 16:04 webJose