fix: harden CLI tools against credential leakage

Move Supermetrics API key from query string to x-api-key header.
Mask ZoomInfo JWT by default in auth command (use --show-token to reveal).

Cherry-picked from #201.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Corey Haines
2026-04-21 13:32:33 -07:00
parent c8e2d11556
commit 9698318a30
2 changed files with 17 additions and 9 deletions
+9 -2
View File
@@ -92,7 +92,14 @@ async function main() {
break
}
const token = await authenticate()
result = { jwt: token }
if (args['show-token']) {
result = { jwt: token }
} else {
const masked = token.length > 12
? token.slice(0, 6) + '…' + token.slice(-6)
: '***'
result = { jwt: masked, hint: 'Use --show-token to reveal full JWT' }
}
break
}
@@ -188,7 +195,7 @@ async function main() {
result = {
error: 'Unknown command',
usage: {
auth: 'auth — authenticate and get JWT token',
auth: 'auth [--show-token] — authenticate and get JWT token (masked by default)',
contacts: {
search: 'contacts search [--job-title <t>] [--company <c>] [--location <l>] [--seniority <s>] [--department <d>] [--page <n>]',
enrich: 'contacts enrich --email <email> | --person-id <id>',