Skip to content

Commit a6cba61

Browse files
committed
Use jwks-rsa 2.0.2, with async/await support
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
1 parent a080e4c commit a6cba61

File tree

5 files changed

+26
-70
lines changed

5 files changed

+26
-70
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ ___
119119
- LDAP: Properly unbind client on group search error (Diamond Lewis) [#7265](https://github.com/parse-community/parse-server/pull/7265)
120120
- Improve data consistency in Push and Job Status update (Diamond Lewis) [#7267](https://github.com/parse-community/parse-server/pull/7267)
121121
- Excluding keys that have trailing edges.node when performing GraphQL resolver (Chris Bland) [#7273](https://github.com/parse-community/parse-server/pull/7273)
122+
- Use jwks-rsa 2.x (Olle Jonsson) [#7305](https://github.com/parse-community/parse-server/pull/7305)
122123
___
123124
## 4.5.0
124125
[Full Changelog](https://github.com/parse-community/parse-server/compare/4.4.0...4.5.0)

package-lock.json

Lines changed: 21 additions & 60 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"graphql-upload": "11.0.0",
4343
"intersect": "1.0.1",
4444
"jsonwebtoken": "8.5.1",
45-
"jwks-rsa": "1.12.3",
45+
"jwks-rsa": "2.0.2",
4646
"ldapjs": "2.2.4",
4747
"lodash": "4.17.21",
4848
"lru-cache": "5.1.1",
@@ -125,7 +125,7 @@
125125
"postinstall": "node -p 'require(\"./postinstall.js\")()'"
126126
},
127127
"engines": {
128-
"node": ">= 8"
128+
"node": ">= 10"
129129
},
130130
"bin": {
131131
"parse-server": "bin/parse-server"

src/Adapters/Auth/apple.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
const Parse = require('parse/node').Parse;
55
const jwksClient = require('jwks-rsa');
6-
const util = require('util');
76
const jwt = require('jsonwebtoken');
87

98
const TOKEN_ISSUER = 'https://appleid.apple.com';
@@ -16,11 +15,9 @@ const getAppleKeyByKeyId = async (keyId, cacheMaxEntries, cacheMaxAge) => {
1615
cacheMaxAge,
1716
});
1817

19-
const asyncGetSigningKeyFunction = util.promisify(client.getSigningKey);
20-
2118
let key;
2219
try {
23-
key = await asyncGetSigningKeyFunction(keyId);
20+
key = await client.getSigningKey(keyId);
2421
} catch (error) {
2522
throw new Parse.Error(
2623
Parse.Error.OBJECT_NOT_FOUND,

src/Adapters/Auth/facebook.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
const Parse = require('parse/node').Parse;
33
const crypto = require('crypto');
44
const jwksClient = require('jwks-rsa');
5-
const util = require('util');
65
const jwt = require('jsonwebtoken');
76
const httpsRequest = require('./httpsRequest');
87

@@ -58,11 +57,9 @@ const getFacebookKeyByKeyId = async (keyId, cacheMaxEntries, cacheMaxAge) => {
5857
cacheMaxAge,
5958
});
6059

61-
const asyncGetSigningKeyFunction = util.promisify(client.getSigningKey);
62-
6360
let key;
6461
try {
65-
key = await asyncGetSigningKeyFunction(keyId);
62+
key = await client.getSigningKey(keyId);
6663
} catch (error) {
6764
throw new Parse.Error(
6865
Parse.Error.OBJECT_NOT_FOUND,

0 commit comments

Comments
 (0)