fix: use x-goog-api-key header instead of URL query param for Gemini API#12190
Open
continue[bot] wants to merge 4 commits intomainfrom
Open
fix: use x-goog-api-key header instead of URL query param for Gemini API#12190continue[bot] wants to merge 4 commits intomainfrom
continue[bot] wants to merge 4 commits intomainfrom
Conversation
Move API key from URL query string to x-goog-api-key header when fetching Gemini models. This prevents credentials from being exposed in server logs, browser history, or referrer headers. Generated with [Continue](https://continue.dev) Co-Authored-By: Continue <noreply@continue.dev> Co-authored-by: bekah-hawrot-weigel <bekah@continue.dev>
Contributor
Author
Docs ReviewNo documentation updates needed for this PR. Reason: This is an internal security fix that changes how the Gemini API key is transmitted (from URL query parameter to Good security improvement! 🔐 |
The claude-3-haiku-20240307 model has been deprecated by Anthropic and now returns not_found_error. Updated to claude-3-5-haiku-latest which is the current replacement. Generated with [Continue](https://continue.dev) Co-Authored-By: Continue <noreply@continue.dev> Co-authored-by: bekah-hawrot-weigel <bekah@continue.dev>
The model naming convention has changed - claude-3-5-haiku-latest is not a valid model name. Updated to use claude-haiku-4-5-20251001 which is the correct current Anthropic haiku model. Generated with [Continue](https://continue.dev) Co-Authored-By: Continue <noreply@continue.dev> Co-authored-by: bekah-hawrot-weigel <bekah@continue.dev>
Contributor
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="extensions/cli/src/smoke-api/smoke-api-helpers.ts">
<violation number="1" location="extensions/cli/src/smoke-api/smoke-api-helpers.ts:51">
P3: The fallback-model comment no longer matches the actual default value, which can mislead future maintenance and debugging.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.
Updated the comment to match the exact model name claude-haiku-4-5-20251001 to prevent confusion during maintenance. Generated with [Continue](https://continue.dev) Co-Authored-By: Continue <noreply@continue.dev> Co-authored-by: bekah-hawrot-weigel <bekah@continue.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes a security issue where the Gemini API key was being passed as a URL query parameter when fetching available models, and also fixes a CI failure caused by a deprecated Anthropic model.
Changes
1. Security Fix: Gemini API Key Exposure (Medium Severity)
File:
core/llm/fetchModels.ts:181-182Before (Insecure)
After (Secure)
Why This Matters
API keys in URL query strings can be exposed through:
The
x-goog-api-keyheader is the secure method used elsewhere in this codebase (seepackages/openai-adapters/src/apis/Gemini.ts) and is the recommended authentication method for Google APIs.2. CI Fix: Update Deprecated Anthropic Model
File:
extensions/cli/src/smoke-api/smoke-api-helpers.tsUpdated the default smoke test model from
claude-3-haiku-20240307(deprecated, returnsnot_found_error) toclaude-3-5-haiku-latest.Generated with Continue
Co-authored-by: bekah-hawrot-weigel bekah@continue.dev