fix(apollo): use X-Api-Key header instead of Authorization: Bearer - #81
Conversation
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.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
Summary by CodeRabbit
WalkthroughThe Apollo request helper now sends the provided API key in the 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches✨ Simplify 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. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (1)
src/providers/apollo/executors.ts
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>
|
@hyrious sync to oomol-hosted |
Fixes #80.
Apollo's REST API requires the API key in the
X-Api-Keyheader.requestApolloJson(src/providers/apollo/executors.ts) was sendingAuthorization: Bearer, so all five Apollo actions and the credential validator failed withInvalid access credentials.One-line header swap. Verified against
/api/v1/usage_stats/api_usage_statswith the same master key:X-Api-Keyreturns 200,Authorization: Bearerreturns 401.