[GH-ISSUE #2290] [Issue]: Google Vertex AI connections send no authentication (service-account JWT auth dropped), returning 401 #1126

Closed
opened 2026-10-21 05:27:26 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @Romuromylus on GitHub (Jun 5, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2290

Originally assigned to: @SpicyMarinara on GitHub.

Summary

A google_vertex connection is selectable in the UI but sends no auth in the refactor. The service-account JWT signing and bearer-token flow from main is gone, so every Vertex generation/stream is unauthenticated and returns HTTP 401.

Expected behavior

A Google Vertex AI connection should authenticate via a service-account JWT exchanged for an OAuth2 bearer access token (as on main), and send that bearer on every request to the aiplatform endpoint.

Actual behavior

The refactor's google_vertex endpoint adds no query key and no auth header, and complete_google/stream_google post with no bearer_auth, no Authorization, and no x-goog-api-key. Since the Vertex base requires an OAuth2 bearer and rejects API keys, the provider is non-functional.

Steps to reproduce

  1. Add a Google Vertex AI connection with service-account credentials.
  2. Attempt any generation or stream against it.
  3. Observe an unauthenticated request and HTTP 401.

Impact area

  • Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime

Environment provider note

Provider: Google Vertex AI (google_vertex).

Regression notes

Worked on main. Main signs an RS256 JWT from the service-account private_key and exchanges it for a cached bearer token (packages/server/src/services/llm/providers/google.provider.ts:66-114,116-130), applied when providerKind is google_vertex (:266-269). In the refactor, google_vertex_endpoint adds no key/auth (src-tauri/crates/llm/src/lib.rs:2396-2402, vs the plain-google ?key= at :2442), and complete_google/stream_google send with no bearer (:2540-2547,2581-2588). A full grep across src + src-tauri + crates returns zero hits for RS256/jwt-bearer/private_key/client_email/token_uri/service_account; the only auth in the crate is OpenAI bearer, claude_subscription OAuth, and Anthropic x-api-key. The Vertex default base is the real aiplatform.googleapis.com endpoint (:226-229).

Environment

  • Branch or commit: refactor @ 5ddb9840 (compared against main @ b4ab97f)
  • Run mode: Tauri desktop
  • OS + version: Windows 11
  • Node + pnpm versions: not relevant (static source comparison)
  • Rust version, if relevant: not relevant (static source comparison)
  • Remote Runtime URL configured? not relevant
  • Provider, model, or integration, if relevant: see body

Template check

Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @Romuromylus on GitHub (Jun 5, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2290 Originally assigned to: @SpicyMarinara on GitHub. ## Summary A google_vertex connection is selectable in the UI but sends no auth in the refactor. The service-account JWT signing and bearer-token flow from main is gone, so every Vertex generation/stream is unauthenticated and returns HTTP 401. ## Expected behavior A Google Vertex AI connection should authenticate via a service-account JWT exchanged for an OAuth2 bearer access token (as on main), and send that bearer on every request to the aiplatform endpoint. ## Actual behavior The refactor's google_vertex endpoint adds no query key and no auth header, and complete_google/stream_google post with no bearer_auth, no Authorization, and no x-goog-api-key. Since the Vertex base requires an OAuth2 bearer and rejects API keys, the provider is non-functional. ## Steps to reproduce 1. Add a Google Vertex AI connection with service-account credentials. 2. Attempt any generation or stream against it. 3. Observe an unauthenticated request and HTTP 401. ## Impact area - [x] Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime ## Environment provider note Provider: Google Vertex AI (google_vertex). ## Regression notes Worked on main. Main signs an RS256 JWT from the service-account private_key and exchanges it for a cached bearer token (`packages/server/src/services/llm/providers/google.provider.ts:66-114,116-130`), applied when providerKind is google_vertex (`:266-269`). In the refactor, `google_vertex_endpoint` adds no key/auth (`src-tauri/crates/llm/src/lib.rs:2396-2402`, vs the plain-google `?key=` at `:2442`), and `complete_google`/`stream_google` send with no bearer (`:2540-2547,2581-2588`). A full grep across src + src-tauri + crates returns zero hits for RS256/jwt-bearer/private_key/client_email/token_uri/service_account; the only auth in the crate is OpenAI bearer, claude_subscription OAuth, and Anthropic x-api-key. The Vertex default base is the real aiplatform.googleapis.com endpoint (`:226-229`). ## Environment - Branch or commit: refactor @ 5ddb9840 (compared against main @ b4ab97f) - Run mode: Tauri desktop - OS + version: Windows 11 - Node + pnpm versions: not relevant (static source comparison) - Rust version, if relevant: not relevant (static source comparison) - Remote Runtime URL configured? not relevant - Provider, model, or integration, if relevant: see body ## Template check Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 05:27:26 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (Jun 6, 2026):

Yeah, needs fixing.
https://docs.cloud.google.com/gemini-enterprise-agent-platform/machine-learning/authentication

<!-- gh-comment-id:4637999082 --> @SpicyMarinara commented on GitHub (Jun 6, 2026): Yeah, needs fixing. https://docs.cloud.google.com/gemini-enterprise-agent-platform/machine-learning/authentication
Author
Owner

@SpicyMarinara commented on GitHub (Jun 6, 2026):

Fixed on refactor in commit 1a18f83d.

What changed:

  • Restored Google Vertex auth for service-account JSON saved in the encrypted credential field.
  • Signs an RS256 service-account JWT, exchanges it for an OAuth access token, caches it until near expiry, and sends Authorization: Bearer on Vertex generateContent and streamGenerateContent requests.
  • Reused the same Vertex auth header helper for live model discovery and Google Vertex embeddings.
  • Preserved legacy fallback handling for direct bearer tokens and x-goog-api-key credentials.

Verification:

  • Temporary local proof: service-account JSON exchanged against a fake token endpoint and final Vertex generation request carried Authorization: Bearer ya29.vertex-test; proof removed before commit.
  • cargo test --manifest-path src-tauri/Cargo.toml -p marinara-llm google_vertex -- --nocapture
  • cargo check --manifest-path src-tauri/Cargo.toml --workspace
  • pnpm check:architecture
<!-- gh-comment-id:4638335002 --> @SpicyMarinara commented on GitHub (Jun 6, 2026): Fixed on refactor in commit 1a18f83d. What changed: - Restored Google Vertex auth for service-account JSON saved in the encrypted credential field. - Signs an RS256 service-account JWT, exchanges it for an OAuth access token, caches it until near expiry, and sends Authorization: Bearer on Vertex generateContent and streamGenerateContent requests. - Reused the same Vertex auth header helper for live model discovery and Google Vertex embeddings. - Preserved legacy fallback handling for direct bearer tokens and x-goog-api-key credentials. Verification: - Temporary local proof: service-account JSON exchanged against a fake token endpoint and final Vertex generation request carried Authorization: Bearer ya29.vertex-test; proof removed before commit. - cargo test --manifest-path src-tauri/Cargo.toml -p marinara-llm google_vertex -- --nocapture - cargo check --manifest-path src-tauri/Cargo.toml --workspace - pnpm check:architecture
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#1126
No description provided.