Skip to content

fix(vertex): bind model discovery to Google destinations - #8802

Merged
lidge-jun merged 1 commit into
lidge-jun:devfrom
luvs01:fix/vertex-discovery-authority
Nov 17, 2026
Merged

lidge-jun merged 1 commit into
lidge-jun:devfrom
luvs01:fix/vertex-discovery-authority

Conversation

@luvs01

@luvs01 luvs01 commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Reject unsafe Vertex model-discovery destinations before reading ADC or ambient Google credentials. Discovery accepts HTTPS Google AI Platform authorities with the configured location; user information, nonstandard ports, fragments, and non-Google destinations are refused.
  • Bind asynchronously resolved credentials to the validated origin and check the exact outgoing URL immediately before every initial or paginated request. Provider configuration changes while credentials are resolving cannot redirect those credentials.
  • Apply the same checks to catalog discovery and the management discovery route. Add regression coverage and update the Vertex user guides and owning provider contracts.

Verification

Recorded local validation:

  • bun scripts/test.ts --parallel=1 tests/adapters/google/vertex-model-discovery.test.ts tests/adapters/google/vertex-catalog.test.ts tests/server/management-provider-model-discovery.test.ts: 56 passed, 0 failed, 312 assertions on the final staged tree.
  • The final focused security regressions passed 9 tests / 109 assertions. An earlier seven-case regression comparison against unchanged production code produced 5 failures and 2 passes, demonstrating that the new cases exercise the original unsafe behavior.
  • bun run typecheck (2,533 files), bun run structure:check, bun run privacy:scan, and diff checks passed.
  • Documentation build passed: 775 pages / 117,806 internal links.
  • Independent read-only source review traced credential resolution, destination mutation, both discovery callers, every page, and the outbound transport guard. No concrete blocker was identified.

Posted-head CI 43812045079 passed, including the Typecheck step and test changed job. Catalog checks also passed. This is exact-head hosted evidence; the local results above are retained prior validation and were not rerun for this status change.

A source comparison against dev c36793a9336b70cfe5bc3b7f6e6f751e730fb6fc found no duplicate implementation or incompatible contract change requiring a rebase. Maintainer security review and installed/live application validation remain separate; review readiness does not claim merge or release acceptance.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

The security checkbox records implementation review; explicit maintainer security review and the repository's maintainer-sponsored requirement for authentication surfaces remain required before merge.

Summary by CodeRabbit

  • Bug Fixes
    • Vertex AI credentials are now sent only to approved Google HTTPS endpoints, preventing authentication from being shared with custom gateways or other unverified destinations.
    • Live model discovery and connection tests now verify request destinations, including paginated requests. If a destination cannot be verified, discovery is unavailable, while already configured models remain available.
  • Documentation
    • Updated the Vertex AI guides to explain supported endpoint formats and what to expect when a destination cannot be verified.

Validate the discovery destination before resolving ADC or ambient credentials, bind asynchronous credentials to that origin, and recheck the exact outgoing URL for initial and paginated catalog requests. Add regressions for hostile destinations and provider changes during credential resolution.
@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Vertex discovery and connection tests now accept credentials only for approved Google HTTPS origins. Credential freshness and outbound checks bind to each request URL, including paginated requests. Documentation describes endpoint requirements and behavior when destination verification fails.

Changes: Vertex discovery authority

Layer / File(s) Summary
Validate origins and bind credentials
src/providers/google-vertex-model-discovery.ts, tests/adapters/google/vertex-model-discovery.test.ts, docs-site/src/content/docs/.../google-vertex.md, structure/providers/google.md, structure/providers-and-adapters.md
Discovery accepts approved Google HTTPS origins and binds credentials to the accepted origin. Send-time checks validate the request URL and credential authority. Tests cover rejected destinations, credential changes, and catalog fallback. Documentation describes endpoint requirements and unverified destinations.
Validate initial and paginated request URLs
src/codex/catalog/provider-models.ts, src/server/management/provider-routes.ts, tests/server/management-provider-model-discovery.test.ts
Catalog and management outbound checks now use each request URL, including paginated requests. Tests cover untrusted destinations and approved regional pagination.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Possibly related PRs

  • lidge-jun/opencodex#8583: Adds the live Publisher Models discovery paths that this change updates with destination and outgoing-URL checks.
Merge Risk: Minimal · up to 65db6

Vertex model discovery now sends Google credentials only to approved HTTPS Google AI Platform origins and checks each paginated request URL. Unapproved destinations resolve no credentials, and configured models remain available. No concrete merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "fix(vertex): bind model discovery to Google destinations" matches the main change. The raw summary and PR objectives both describe Vertex model discovery being limited to approved Google HT…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "fix(vertex): bind model discovery to Google destinations" matches the main change. The raw summary and PR objectives both describe Vertex model discovery being limited to approved Google HTTPS origins, with credentials bound to the validated origin and checks applied to each outgoing URL. The title is concise, specific, and follows a conventional commit style. It names the scope (vertex), the component (model discovery), and the core intent (destination binding).

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 595de1e and 65db672.

Files selected for processing: 9

  • docs-site/src/content/docs/es/guides/google-vertex.md
  • docs-site/src/content/docs/guides/google-vertex.md
  • src/codex/catalog/provider-models.ts
  • src/providers/google-vertex-model-discovery.ts
  • src/server/management/provider-routes.ts
  • structure/providers-and-adapters.md
  • structure/providers/google.md
  • tests/adapters/google/vertex-model-discovery.test.ts
  • tests/server/management-provider-model-discovery.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@lidge-jun

Copy link
Copy Markdown
Owner

Maintainer integration into dev under MAINTAINERS.md (not an approving review), 2026-11-17 triage round.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants