Skip to content

Commit

Permalink
Use jwks-rsa 2.0.2, with async/await support
Browse files Browse the repository at this point in the history
This pushes up to declare Node 10+ as a requirement, but we were using
that in practice, before, too.

jwks-rsa CHANGELOG mentions this upgrade guide:
https://github.com/auth0/node-jwks-rsa/blob/master/CHANGELOG.md#migrated-callbacks-to-asyncawait
  • Loading branch information
olleolleolle committed Mar 30, 2021
1 parent a080e4c commit 871e4c5
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 68 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ ___
- LDAP: Properly unbind client on group search error (Diamond Lewis) [#7265](https://github.com/parse-community/parse-server/pull/7265)
- Improve data consistency in Push and Job Status update (Diamond Lewis) [#7267](https://github.com/parse-community/parse-server/pull/7267)
- Excluding keys that have trailing edges.node when performing GraphQL resolver (Chris Bland) [#7273](https://github.com/parse-community/parse-server/pull/7273)
- Use jwks-rsa 2.x (Olle Jonsson) [#7305](https://github.com/parse-community/parse-server/pull/7305)
___
## 4.5.0
[Full Changelog](https://github.com/parse-community/parse-server/compare/4.4.0...4.5.0)
Expand Down
81 changes: 21 additions & 60 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"graphql-upload": "11.0.0",
"intersect": "1.0.1",
"jsonwebtoken": "8.5.1",
"jwks-rsa": "1.12.3",
"jwks-rsa": "2.0.2",
"ldapjs": "2.2.4",
"lodash": "4.17.21",
"lru-cache": "5.1.1",
Expand Down Expand Up @@ -125,7 +125,7 @@
"postinstall": "node -p 'require(\"./postinstall.js\")()'"
},
"engines": {
"node": ">= 8"
"node": ">= 10"
},
"bin": {
"parse-server": "bin/parse-server"
Expand Down
4 changes: 1 addition & 3 deletions src/Adapters/Auth/apple.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ const getAppleKeyByKeyId = async (keyId, cacheMaxEntries, cacheMaxAge) => {
cacheMaxAge,
});

const asyncGetSigningKeyFunction = util.promisify(client.getSigningKey);

let key;
try {
key = await asyncGetSigningKeyFunction(keyId);
key = await client.getSigningKey(keyId);
} catch (error) {
throw new Parse.Error(
Parse.Error.OBJECT_NOT_FOUND,
Expand Down
4 changes: 1 addition & 3 deletions src/Adapters/Auth/facebook.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,9 @@ const getFacebookKeyByKeyId = async (keyId, cacheMaxEntries, cacheMaxAge) => {
cacheMaxAge,
});

const asyncGetSigningKeyFunction = util.promisify(client.getSigningKey);

let key;
try {
key = await asyncGetSigningKeyFunction(keyId);
key = await client.getSigningKey(keyId);
} catch (error) {
throw new Parse.Error(
Parse.Error.OBJECT_NOT_FOUND,
Expand Down

0 comments on commit 871e4c5

Please sign in to comment.