Skip to content

fix(apollo): use X-Api-Key header instead of Authorization: Bearer - #81

Merged
BlackHole1 merged 2 commits into
oomol-lab:mainfrom
konradre:fix/apollo-x-api-key-header
Jul 12, 2026
Merged

fix(apollo): use X-Api-Key header instead of Authorization: Bearer#81
BlackHole1 merged 2 commits into
oomol-lab:mainfrom
konradre:fix/apollo-x-api-key-header

Conversation

@konradre

Copy link
Copy Markdown
Contributor

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.

Apollo's REST API reads the key from X-Api-Key. requestApolloJson sent Authorization: Bearer, so every Apollo action and the credential validator failed with "Invalid access credentials". Same key: X-Api-Key -> 200, Bearer -> 401.
@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 67e961b1-4f80-45c7-82cb-91daec8445ce

📥 Commits

Reviewing files that changed from the base of the PR and between ce13cbb and f7f633a.

📒 Files selected for processing (1)
  • src/providers/apollo/definition.ts

Summary by CodeRabbit

  • Bug Fixes
    • Updated Apollo API requests to use the correct API key header format (x-api-key), improving authentication compatibility.
    • Refreshed the Apollo provider’s API key description to match the new outbound header behavior.

Walkthrough

The Apollo request helper now sends the provided API key in the x-api-key HTTP header instead of the Authorization: Bearer header. The provider authentication description was updated to document the new header format.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title follows the required type(scope): subject format and accurately describes the Apollo auth header change.
Description check ✅ Passed The description is directly related to the Apollo header fix and explains the credential failures and verification.
Linked Issues check ✅ Passed The change replaces the bearer header with X-Api-Key and updates the docs, matching issue #80's required fix.
Out of Scope Changes check ✅ Passed The PR stays within the Apollo auth-header fix and a matching documentation update, with no unrelated changes shown.
✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/providers/apollo/executors.ts`:
- Around line 173-177: Update the Apollo authentication description in the
definition configuration to state that the API key is sent using the x-api-key
header, replacing the stale Authorization Bearer wording. Locate the relevant
description symbol in the Apollo definition and keep the existing credential
behavior unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 359bdcb2-c612-4823-b690-325a827da736

📥 Commits

Reviewing files that changed from the base of the PR and between 62796b0 and ce13cbb.

📒 Files selected for processing (1)
  • src/providers/apollo/executors.ts

Comment thread src/providers/apollo/executors.ts
@BlackHole1
BlackHole1 self-requested a review July 12, 2026 04:39
@BlackHole1 BlackHole1 self-assigned this Jul 12, 2026
@BlackHole1 BlackHole1 added the bug Something isn't working label Jul 12, 2026
The credential setup hint stated the Apollo API key is sent with the
Authorization Bearer header, but Apollo's REST API requires the key in
the `x-api-key` header. The executor was corrected to send `x-api-key`
(see oomol-lab#80), which left this user-facing description stale and
misleading about how the credential is actually used.

Update the description to match the header the provider now sends.

Refs oomol-lab#80

Signed-off-by: Kevin Cui <bh@bugs.cc>
@BlackHole1
BlackHole1 merged commit 25e29ef into oomol-lab:main Jul 12, 2026
2 checks passed
@BlackHole1

Copy link
Copy Markdown
Member

@hyrious sync to oomol-hosted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Apollo provider uses Authorization: Bearer; Apollo API requires X-Api-Key (all actions fail with "Invalid access credentials")

2 participants