Skip to content

fix(google): use header authentication by default - #1139

Merged
mikehostetler merged 1 commit into
mainfrom
sec/google-header-auth
Oct 22, 2026
Merged

mikehostetler merged 1 commit into
mainfrom
sec/google-header-auth

Conversation

@neilberkman

@neilberkman neilberkman commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Google requests sent API credentials in URL query parameters, exposing them to URL-based proxy/access logs and request telemetry. Only streaming requests supported optional header authentication; non-streaming requests and cached-content operations always used query authentication.

Use x-goog-api-key by default for generation, streaming, single/batch embeddings, image generation, and all Google AI Studio cached-content operations. Keep query authentication available through google_auth_header: false. Update the provider documentation and guide.

Non-streaming fixture replay compares the method, URL, and request body, while streaming replay selects the named fixture. Ignore only Google's authentication query parameter when comparing URLs; headers are already excluded from comparison. Preserve all other request comparisons. Add Google header redaction to streaming metadata, fixture capture, and billing test artifacts. No recorded fixtures were changed or re-recorded.

Verification:

  • mix format: passed.
  • mix compile --warnings-as-errors: passed.
  • mix credo --strict: passed; no issues across 626 source files.
  • Focused provider, authentication, cached-content, fixture, streaming-metadata, and transcript tests: 203 passed, 3 skipped.
  • mix test: 5,366 passed, 11 skipped, 240 excluded.
  • mix test --only provider:google: failed; 43 passed, 11 failed, 4 skipped, 5,559 excluded. Four failures are missing fixtures (embedding basic/batch and context append), five are existing maxOutputTokens mismatches, one is responseSchema.propertyOrdering, and one is candidateCount. The same 11 failures reproduce in the four affected coverage modules after loading the original Google provider and fixture matcher from the branch baseline in memory (5 passed, 11 failed). The default full suite excludes coverage tests. No authentication URL mismatches remain.

The initial mix compile failed because copied dependencies differed from mix.lock; mix deps.get fetched the locked versions without changing the lockfile, and compilation then passed. No live requests were run.

Compatibility decision: proxies that only accept query authentication now require an explicit opt-out. For provider calls use provider_options: [google_auth_header: false]; for Google.CachedContent calls pass google_auth_header: false directly. Maintainers should decide how to coordinate this default change and the existing coverage-fixture failures for release.

🤖 Generated with Codex and Claude Code

@neilberkman neilberkman added needs_work Changes requested before merge and removed needs_work Changes requested before merge labels Oct 22, 2026
@mikehostetler
mikehostetler merged commit d9f322b into main Oct 22, 2026
21 checks passed
@mikehostetler
mikehostetler deleted the sec/google-header-auth branch October 22, 2026 19:45
neilberkman added a commit that referenced this pull request Oct 22, 2026
…ader

#1139 switched Google to header authentication by default, so the redirect
test from #1136 no longer finds the key in the query string. Each passed on
its own branch; together on main the Google case fails.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants