feat: add Google Vertex AI service account JSON authentication#6287
Open
sandys wants to merge 8 commits intoanomalyco:devfrom
Open
feat: add Google Vertex AI service account JSON authentication#6287sandys wants to merge 8 commits intoanomalyco:devfrom
sandys wants to merge 8 commits intoanomalyco:devfrom
Conversation
Add support for authenticating to Google Vertex AI using service account JSON credentials, with proper credential separation from regular Google (Gemini) API keys. Changes: - Add service account JSON auth flow in CLI (`opencode auth login`) - Add TUI dialog for pasting service account JSON with location input - Update provider loaders to use stored credentials with googleAuthOptions - Explicitly set `key: undefined` and `apiKey: null` in Vertex loaders to prevent credential leakage from other providers - Rename "Vertex" to "Google Vertex AI" consistently across UI: - /connect menu - Model selection dialog - Status bar below text entry - Add comprehensive tests verifying credential separation between google, google-vertex, and google-vertex-anthropic providers The three providers (google, google-vertex, google-vertex-anthropic) are now completely independent and can be configured simultaneously without credentials leaking between them.
Collaborator
|
/review |
packages/opencode/src/cli/cmd/tui/component/dialog-provider.tsx
Outdated
Show resolved
Hide resolved
- Fix textareaRef any type in dialog-provider.tsx - Extract PROVIDER_DISPLAY_NAMES to shared display-names.ts module - Extract createGoogleVertexLoader helper to reduce code duplication - Fix test to clear all Google env vars that could affect provider loading 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
# Conflicts: # packages/opencode/src/cli/cmd/auth.ts # packages/opencode/src/cli/cmd/tui/component/dialog-provider.tsx # packages/opencode/test/provider/provider.test.ts
# Conflicts: # packages/opencode/src/cli/cmd/auth.ts # packages/opencode/src/cli/cmd/tui/component/dialog-model.tsx # packages/opencode/src/cli/cmd/tui/component/dialog-provider.tsx
Contributor
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
# Conflicts: # packages/opencode/src/cli/cmd/tui/component/dialog-provider.tsx
|
are we going to push this over the hump? it's unblocking a big share of models used via Vertex.AI. They simply are blocked today otherwise. |
# Conflicts: # packages/opencode/src/provider/provider.ts # packages/opencode/test/preload.ts
00637c0 to
71e0ba2
Compare
f1ae801 to
08fa7f7
Compare
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.
Add support for authenticating to Google Vertex AI using service account JSON credentials, with proper credential separation from regular Google (Gemini) API keys.
Google Cloud actively makes it hard to use api keys with Vertex - with a complicated permission grant structure. The preferred mechanism is service accounts with json tokens. Not supporting it is a huge problem.
Changes:
opencode auth login)key: undefinedandapiKey: nullin Vertex loaders to prevent credential leakage from other providersThe three providers (google, google-vertex, google-vertex-anthropic) are now completely independent and can be configured simultaneously without credentials leaking between them.
for issues
#5712
#6280
#5711
#3586
#5097
#4282
#272
#553
#402
#1204