(serverId: string)
| 278 | } |
| 279 | |
| 280 | async function isMcpAuthCached(serverId: string): Promise<boolean> { |
| 281 | const cache = await getMcpAuthCache() |
| 282 | const entry = cache[serverId] |
| 283 | if (!entry) { |
| 284 | return false |
| 285 | } |
| 286 | return Date.now() - entry.timestamp < MCP_AUTH_CACHE_TTL_MS |
| 287 | } |
| 288 | |
| 289 | // Serialize cache writes through a promise chain to prevent concurrent |
| 290 | // read-modify-write races when multiple servers return 401 in the same batch |
no test coverage detected