Skip to content

Commit 25e29ef

Browse files
konradreBlackHole1
andauthored
fix(apollo): use X-Api-Key header instead of Authorization: Bearer (#81)
Fixes #80. Apollo's REST API requires the API key in the `X-Api-Key` header. `requestApolloJson` (`src/providers/apollo/executors.ts`) was sending `Authorization: Bearer`, so all five Apollo actions and the credential validator failed with `Invalid access credentials`. One-line header swap. Verified against `/api/v1/usage_stats/api_usage_stats` with the same master key: `X-Api-Key` returns 200, `Authorization: Bearer` returns 401. --------- Signed-off-by: Kevin Cui <bh@bugs.cc> Co-authored-by: konradre <konradre@users.noreply.github.com> Co-authored-by: Kevin Cui <bh@bugs.cc>
1 parent 62796b0 commit 25e29ef

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/providers/apollo/definition.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const provider: ProviderDefinition = {
1515
label: "API Key",
1616
placeholder: "APOLLO_API_KEY",
1717
description:
18-
"Apollo API key sent with the Authorization Bearer header. Create it in Settings > Integrations > API Keys: https://docs.apollo.io/docs/create-api-key. The first-pass actions require a master API key.",
18+
"Apollo API key sent with the x-api-key header. Create it in Settings > Integrations > API Keys: https://docs.apollo.io/docs/create-api-key. The first-pass actions require a master API key.",
1919
extraFields: [],
2020
},
2121
],

src/providers/apollo/executors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ async function requestApolloJson(input: {
172172
try {
173173
const headers: Record<string, string> = {
174174
accept: "application/json",
175-
authorization: `Bearer ${input.apiKey}`,
175+
"x-api-key": input.apiKey,
176176
"user-agent": providerUserAgent,
177177
};
178178
if (input.body) {

0 commit comments

Comments
 (0)