MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / looksLikeApiKey

Function looksLikeApiKey

packages/cli/src/auth/store.ts:457–464  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

455 * leading `{`, so this path can't swallow a JSON fragment.
456 */
457function 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}

Callers 1

readStoreFunction · 0.85

Calls 1

isHeaderSafeFunction · 0.85

Tested by

no test coverage detected