* Legacy-plaintext heuristic. HeyGen API keys come in multiple formats * (`sk_V2_…`, historic `hg_…`, partner keys, etc.) and the CLI should * NOT shape-check them — the backend's `/v3/users/me` is the source of * truth and the existing `auth login` rollback handles bad keys cleanly. * We only r
(s: string)
| 455 | * leading `{`, so this path can't swallow a JSON fragment. |
| 456 | */ |
| 457 | function looksLikeApiKey(s: string): boolean { |
| 458 | if (s.length < 8) return false; |
| 459 | if (!isHeaderSafe(s)) return false; |
| 460 | // Single line of printable ASCII (excluding space, since real keys |
| 461 | // don't contain spaces — a space-bearing blob is almost certainly |
| 462 | // not a credential). |
| 463 | return /^[!-~]+$/.test(s); |
| 464 | } |
no test coverage detected