(req: SapConcurAuth)
| 168 | export const SAP_CONCUR_OUTBOUND_FETCH_TIMEOUT_MS = 30_000 |
| 169 | |
| 170 | function tokenCacheKey(req: SapConcurAuth): string { |
| 171 | const secretHash = createHash('sha256').update(req.clientSecret).digest('hex').slice(0, 16) |
| 172 | const userHash = req.username |
| 173 | ? createHash('sha256').update(req.username).digest('hex').slice(0, 12) |
| 174 | : '' |
| 175 | return `${req.datacenter}::${req.grantType}::${req.clientId}::${secretHash}::${userHash}` |
| 176 | } |
| 177 | |
| 178 | function rememberToken(key: string, token: CachedToken): void { |
| 179 | if (TOKEN_CACHE.has(key)) TOKEN_CACHE.delete(key) |
no outgoing calls
no test coverage detected