(req: ProxyRequest)
| 43 | } |
| 44 | |
| 45 | function tokenCacheKey(req: ProxyRequest): string { |
| 46 | const secretHash = req.clientSecret |
| 47 | ? createHash('sha256').update(req.clientSecret).digest('hex').slice(0, 16) |
| 48 | : '' |
| 49 | return `${resolveTokenUrl(req)}::${req.clientId ?? ''}::${secretHash}` |
| 50 | } |
| 51 | |
| 52 | function rememberToken(key: string, token: CachedToken): void { |
| 53 | if (TOKEN_CACHE.has(key)) TOKEN_CACHE.delete(key) |
no test coverage detected