(keyId, cacheMaxEntries, cacheMaxAge)
| 54 | const HTTPS_TOKEN_ISSUER = 'https://accounts.google.com'; |
| 55 | |
| 56 | const getGoogleKeyByKeyId = async (keyId, cacheMaxEntries, cacheMaxAge) => { |
| 57 | const client = jwksClient({ |
| 58 | jwksUri: 'https://www.googleapis.com/oauth2/v3/certs', |
| 59 | cache: true, |
| 60 | cacheMaxEntries, |
| 61 | cacheMaxAge, |
| 62 | }); |
| 63 | |
| 64 | let key; |
| 65 | try { |
| 66 | key = await authUtils.getSigningKey(client, keyId); |
| 67 | } catch { |
| 68 | throw new Parse.Error( |
| 69 | Parse.Error.OBJECT_NOT_FOUND, |
| 70 | `Unable to find matching key for Key ID: ${keyId}` |
| 71 | ); |
| 72 | } |
| 73 | return key; |
| 74 | }; |
| 75 | |
| 76 | async function verifyIdToken({ id_token: token, id }, { clientId, cacheMaxEntries, cacheMaxAge }) { |
| 77 | if (!clientId) { |
no outgoing calls
no test coverage detected
searching dependent graphs…