Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 20 additions & 5 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018
"ecmaVersion": 2020,
"sourceType": "module",
"project": "./tsconfig.json"
},
"plugins": ["@typescript-eslint"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"rules": {
"array-bracket-spacing": [2, "always"],
"comma-dangle": [2, "never"],
Expand All @@ -11,7 +19,15 @@
}],
"jsx-quotes": [2, "prefer-double"],
"no-multiple-empty-lines": 2,
"no-unused-vars": 2,
// Disable base no-unused-vars, use TS version
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{ "argsIgnorePattern": "^_", "varsIgnorePattern": "^_", "caughtErrorsIgnorePattern": "^_" }
],
// Allow bare expressions (needed for chai.expect)
"no-unused-expressions": "off",
"@typescript-eslint/no-unused-expressions": "off",
"no-var": 2,
"no-extra-semi": 2,
"object-curly-spacing": [2, "always"],
Expand All @@ -23,7 +39,6 @@
"env": {
"node": true,
"mocha": true,
"es6": true
},
"extends": "eslint:recommended"
"es2020": true
}
}
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Log

## Unreleased

**Changed**
- Bump jose from 4.15.4 to 6.1.0

## [v3.2.0](https://github.com/auth0/node-jwks-rsa/tree/v3.2.0) (2025-03-18)
[Full Changelog](https://github.com/auth0/node-jwks-rsa/compare/v3.1.0...v3.2.0)

Expand Down
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ npm install --save jwks-rsa

Supports all currently registered JWK types and JWS Algorithms, see [panva/jose#262](https://github.com/panva/jose/issues/262) for more information.

Note latest version will require node@^20.19.0 or node@^22.12.0 or newer.

### Configure the client

Provide a JWKS endpoint which exposes your signing keys.
Expand All @@ -49,6 +51,36 @@ const key = await client.getSigningKey(kid);
const signingKey = key.getPublicKey();
````

## Known Issues

### Workaround Jest ESM issue

Downstream repositories using Jest may not support ESM fully.

One way to work around this issue is to add the following to your `jest.config.ts`:

```
moduleNameMapper: {
'^jwks-rsa$': '<rootDir>/__mocks__/jwks-rsa.ts',
},
```

and add the `__mocks__/jwks-rsa.ts` file with the following content:

```ts
// Provide a fake implementation of the secret provider, repeat for other methods that your app imports from jwks-rsa
export const passportJwtSecret = jest.fn(() => {
// return a fake key provider function
return (req: any, header: any, cb: any) => {
cb(null, 'fake-secret')
}
})

export default {
passportJwtSecret,
}
```

## Feedback

### Contributing
Expand Down
Loading