Skip to content

Port upstream v0.60.1 Vertex OAuth validation - #494

Merged
Finesssee merged 2 commits into
port/upstream-0.60.0from
port/micro-0.60.1-vertex-oauth
Sep 13, 2026
Merged

Finesssee merged 2 commits into
port/upstream-0.60.0from
port/micro-0.60.1-vertex-oauth

Conversation

@Finesssee

Copy link
Copy Markdown
Collaborator

Summary

Port the Windows equivalent of upstream CodexBar v0.60.1 commit 237bf22a1.

A successful Vertex AI OAuth refresh now requires a usable access_token. Missing, empty, and whitespace-only tokens are rejected instead of silently reusing the previous access token.

Scope

  • Added a small response parser seam in rust/src/providers/vertexai/token_refresher.rs.
  • Preserved existing expiry and ID-token email handling.
  • Added focused coverage for valid, missing, empty, whitespace-only, and malformed refresh responses.
  • Confirmed the upstream form-encoding portion is already covered by the local reqwest form builder.

Other v0.60.1 upstream changes were audited and left out because the Windows implementation already covers them or uses a platform-specific design.

Validation

  • cargo fmt --all
  • cargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warnings
  • cargo clippy --manifest-path apps/desktop-tauri/src-tauri/Cargo.toml --all-targets -- -D warnings
  • cargo test --manifest-path rust/Cargo.toml vertexai::token_refresher — 7 passed
  • cargo test --manifest-path apps/desktop-tauri/src-tauri/Cargo.toml — passed
  • git diff --check
  • Full Rust suite: 1,772 passed, 1 unrelated existing cost_scanner::codex::tests::reasoning_survives_scan_rebuild_and_cache_reload failure; the failing test also fails when rerun alone.

@coderabbitai

coderabbitai Bot commented Sep 13, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 4eb8a538-3345-473c-82bc-ae5a4e54cf68

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@tlq5l

tlq5l commented Sep 13, 2026

Copy link
Copy Markdown

Thermo-nuclear code-quality review (Oracle-coordinated read-only swarm)

Verdict: BLOCKED pending live-path ownership and lifetime validation.

Merge-blocking finding: rust/src/providers/vertexai/token_refresher.rs:181-198 validates the response only inside VertexAITokenRefresher, but rust/src/providers/vertexai/mod.rs:104-179 shows the production path uses VertexAIProvider::refresh_access_token and its own serde_json::Value parsing. The new validation therefore does not protect the live OAuth request and adds a second refresh implementation. Make one owner canonical: wire the refresher into the provider path and remove the duplicate, or move the typed validation into the provider method and delete the unused implementation.

A second merge-blocking boundary is rust/src/providers/vertexai/token_refresher.rs:77, 159-160, 193: expires_in remains an unchecked f64 with a silent default and an unconditional cast. Validate a finite, bounded whole-second lifetime before constructing expiry state, or explicitly preserve a documented default only when the field is absent. Focused parser tests pass, but they do not prove the live path until the ownership issue is repaired.

@tlq5l

tlq5l commented Sep 13, 2026

Copy link
Copy Markdown

Thermo verdict confirmed — BLOCKED.

Oracle’s adjudication confirms that the typed response validation added here is isolated to VertexAITokenRefresher, which is not on the production path. The live provider still uses VertexAIProvider::refresh_access_token in rust/src/providers/vertexai/mod.rs:104-179 and parses through serde_json::Value. Harden that live path with one typed response parser and remove or defer the unused parallel implementation so the port changes production behavior.

@tlq5l

tlq5l commented Sep 13, 2026

Copy link
Copy Markdown

Thermo follow-up: blocker fixed and validated.

Oracle had blocked this PR because typed validation was added only to the unused VertexAITokenRefresher while the live VertexAIProvider::refresh_access_token path still parsed serde_json::Value. Commit 60aa1df83 puts the typed response parser on the live bytes path, rejects malformed/missing/empty tokens, and restores the dead refresher file to its base implementation.

Validation: Vertex live response tests 4/4; Rust clippy with -D warnings; cargo fmt --all -- --check; and the base comparison confirms token_refresher.rs has no diff against port/upstream-0.60.0.

Oracle post-fix verdict: PASS. Hosted CI remains a separate process gate.

@Finesssee
Finesssee merged commit 93742d3 into port/upstream-0.60.0 Sep 13, 2026
1 check passed
@Finesssee Finesssee mentioned this pull request Sep 15, 2026
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