Skip to content

fix(gemini): accept AQ.-prefixed keys in Settings validation - #3193

Merged
vybe merged 1 commit into
Abilityai:devfrom
Suraj370:fix/gemini-aq-key-validation
Oct 3, 2026
Merged

vybe merged 1 commit into
Abilityai:devfrom
Suraj370:fix/gemini-aq-key-validation

Conversation

@Suraj370

@Suraj370 Suraj370 commented Oct 3, 2026

Copy link
Copy Markdown

Summary

PUT/POST /api/settings/api-keys/gemini rejected every key that did not start with AIza, before the live model-list check ever ran. Google AI Studio now also issues AQ.-prefixed "Auth keys", so a freshly created key could not be saved even though it was valid. Accept both prefixes in the format check (backend and onboarding client-side check) and update the docs/tests accordingly.

Description

Brief description of changes.

Related Issue

Fixes #3192

Test plan

  • Added test_gemini_key_accepts_the_newer_aq_prefix confirming PUT /api/settings/api-keys/gemini with an AQ. key returns 200 and is resolvable via settings_service.get_gemini_api_key().
  • Added a parametrized case to the frontend keyFormatError spec for the AQ. prefix.
  • Updated user docs to mention both prefixes.

PUT/POST /api/settings/api-keys/gemini rejected every key that did
not start with AIza, before the live model-list check ever ran.
Google AI Studio now also issues AQ.-prefixed "Auth keys", so a
freshly created key could not be saved even though it was valid.
Accept both prefixes in the format check (backend and onboarding
client-side check) and update the docs/tests accordingly.
@vybe
vybe changed the base branch from main to dev October 3, 2026 08:18
@vybe vybe closed this Oct 3, 2026
@vybe vybe reopened this Oct 3, 2026
@vybe vybe closed this Oct 3, 2026
@vybe vybe reopened this Oct 3, 2026

@vybe vybe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

/validate-pr: Lane B. Retargeted to dev. The new test is a genuine regression test: with the backend fix reverted, test_gemini_key_accepts_the_newer_aq_prefix goes red. Backend and onboarding format checks updated together; no other AIza gate exists (the remaining AIza patterns are secret scanners). Tier 1 green against dev. Thanks @Suraj370!

@vybe
vybe merged commit a8ee53a into Abilityai:dev Oct 3, 2026
51 of 52 checks passed
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.

Gemini platform key is rejected because the AIza prefix check predates Google's new AQ. key format

2 participants