fix: correct Adobe Analytics missing header and Clearbit auth method
- Adobe Analytics: add required x-proxy-global-company-id header (Adobe Analytics 2.0 API rejects requests without this header) - Clearbit: change from Bearer to Basic auth (API key as username) per Clearbit API documentation Found by codex review of all 47 CLI tools. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
2c26f8497b
commit
8ce007c983
2 changed files with 4 additions and 2 deletions
|
|
@ -13,13 +13,14 @@ const BASE_URL = `https://analytics.adobe.io/api/${COMPANY_ID}`
|
|||
|
||||
async function api(method, path, body) {
|
||||
if (args['dry-run']) {
|
||||
return { _dry_run: true, method, url: `${BASE_URL}${path}`, headers: { 'Authorization': '***', 'x-api-key': '***', 'Content-Type': 'application/json' }, body: body || undefined }
|
||||
return { _dry_run: true, method, url: `${BASE_URL}${path}`, headers: { 'Authorization': '***', 'x-api-key': '***', 'x-proxy-global-company-id': COMPANY_ID, 'Content-Type': 'application/json' }, body: body || undefined }
|
||||
}
|
||||
const res = await fetch(`${BASE_URL}${path}`, {
|
||||
method,
|
||||
headers: {
|
||||
'Authorization': `Bearer ${ACCESS_TOKEN}`,
|
||||
'x-api-key': CLIENT_ID,
|
||||
'x-proxy-global-company-id': COMPANY_ID,
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: body ? JSON.stringify(body) : undefined,
|
||||
|
|
|
|||
|
|
@ -8,13 +8,14 @@ if (!API_KEY) {
|
|||
}
|
||||
|
||||
async function api(method, baseUrl, path, body) {
|
||||
const auth = 'Basic ' + Buffer.from(`${API_KEY}:`).toString('base64')
|
||||
if (args['dry-run']) {
|
||||
return { _dry_run: true, method, url: `${baseUrl}${path}`, headers: { 'Authorization': '***', 'Content-Type': 'application/json', 'Accept': 'application/json' }, body: body || undefined }
|
||||
}
|
||||
const res = await fetch(`${baseUrl}${path}`, {
|
||||
method,
|
||||
headers: {
|
||||
'Authorization': `Bearer ${API_KEY}`,
|
||||
'Authorization': auth,
|
||||
'Content-Type': 'application/json',
|
||||
'Accept': 'application/json',
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue