Skip to content

feat(auth/grpctransport): support DirectPath over Interconnect - #20559

Merged
nidhiii-27 merged 6 commits into
mainfrom
feat/storage-directpath-interconnect
Oct 1, 2026
Merged

nidhiii-27 merged 6 commits into
mainfrom
feat/storage-directpath-interconnect

Conversation

@nidhiii-27

@nidhiii-27 nidhiii-27 commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds support for DirectPath over Google Cloud Interconnect in cloud.google.com/go/auth/grpctransport (and auth/internal/transport) for on-premises and hybrid environments.

(Note: The cloud.google.com/go/storage changes have been split out into a separate dependent PR so that cloud.google.com/go/auth can be merged and released first.)

Changes in auth

  • auth/grpctransport & auth/internal/transport:
    • Adds InternalOptions.EnableDirectPathXdsOverInterconnect and environment variable override GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS_OVER_INTERCONNECT.
    • Bypasses GCE residency (compute.OnComputeEngine()) and GCE metadata default service account constraints when DirectPath over Interconnect is enabled and valid credentials are provided within the Google Default Universe (googleapis.com).
    • Rewrites standard <service>.googleapis.com endpoints to google-c2p:///<service>-direct.googleapis.com?force-xds and sets grpc.WithAuthority("<service>.googleapis.com") inside configureDirectPath when DirectPath over Interconnect is eligible.
    • Preserves the original endpoint unmodified when canUseDirectPath returns false.
    • Skips S2A mTLS and ALTS hard-bound token probing when DirectPath over Interconnect is enabled.
    • Strips query parameters (such as ?force-xds) in extractHostPort and allows google-c2p:/// target URIs in checkDirectPathEndPoint.

Add WithDirectPathXdsOverInterconnect() client option (and experimental.WithDirectPathXdsOverInterconnect()) and GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS_OVER_INTERCONNECT environment variable support for DirectPath over Google Cloud Interconnect in storage and auth/grpctransport.

[Generated-by: AI]
@product-auto-label product-auto-label Bot added the api: storage Issues related to the Cloud Storage API. label Sep 20, 2026

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request introduces support for DirectPath over Google Cloud Interconnect (on-premises xDS) across the auth and storage packages. It adds a new client option WithDirectPathXdsOverInterconnect (and its experimental counterpart), along with the environment variable GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS_OVER_INTERCONNECT. The changes include endpoint rewriting to use storage-direct.googleapis.com with the force-xds parameter, bypassing GCE-specific environment and metadata checks when Interconnect is active, and updating the corresponding diagnostic tools and unit tests. There are no review comments provided, so I have no feedback to evaluate.

…ption.go and delegate transport C2P logic to auth/grpctransport

Remove duplicate experimental option wrapper and simplify configureDirectPathInterconnectOptions in storage/grpc_client.go to only rewrite the default storage host to storage-direct.googleapis.com while keeping transport-layer C2P URI construction, authority override, and CloudPath fallback in auth/grpctransport.

[Generated-by: AI]
@nidhiii-27
nidhiii-27 marked this pull request as ready for review September 21, 2026 08:23
@nidhiii-27
nidhiii-27 requested review from a team as code owners September 21, 2026 08:23
Comment thread storage/grpc_client.go Resolved
Comment thread storage/grpc_dp_diag.go Resolved
Comment thread storage/grpc_dp_diag.go Resolved
Comment thread storage/grpc_dp_diag.go Resolved
Comment thread storage/grpc_client.go Resolved
…rconnect

Use strconv.ParseBool for GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS_OVER_INTERCONNECT, check isDirectPathXdsOverInterconnectEnabled before calling configureDirectPathInterconnectOptions, and simplify directPathDiagnostic without mutating opts or authDiagnostic.

[Generated-by: AI]

@alvarowolfx alvarowolfx 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.

Added some comments, but this touches a lot of aspects of auth that I'm not very familiar with. One blocking point is one that I had a hunch before, which is that this needs to be shipped separately for auth and storage.

cloud.google.com/go/storage (storage/go.mod) and cloud.google.com/go/auth (auth/go.mod) are released independently (storage uses individual release PRs; auth is in bulk release-please). Currently, storage/go.mod requires cloud.google.com/go/auth v0.20.0.

If they are release separately and storage is used with cloud.google.com/go/auth v0.20.0 (which Go's Minimal Version Selection will select unless storage/go.mod requires the newly released auth version):

We probably need to land and release the cloud.google.com/go/auth changes first and bump cloud.google.com/go/auth in storage/go.mod before merging the storage changes, or avoid mutating option.WithEndpoint("storage-direct.googleapis.com:443") in storage until the new auth module version is required in storage/go.mod.

Comment thread auth/grpctransport/directpath.go Resolved
Comment thread auth/grpctransport/directpath.go Resolved
Comment thread auth/grpctransport/grpctransport.go Resolved
Comment thread storage/option.go Resolved
Comment thread storage/grpc_client.go Resolved
…omments

- Remove storage/ changes from this PR (moved to a separate dependent storage PR)
- Rewrite standard <service>.googleapis.com endpoints to <service>-direct.googleapis.com with grpc.WithAuthority(<service>.googleapis.com) inside configureDirectPath when DirectPath over Interconnect is eligible
- Preserve the original endpoint unmodified when canUseDirectPath returns false
- Remove fallback transportCreds.Endpoint mutations in dial()
- Skip ALTS hard-bound token probing when Interconnect is enabled

[Generated-by: AI]
@nidhiii-27 nidhiii-27 changed the title feat(storage): support DirectPath over Interconnect in GCS gRPC feat(auth/grpctransport): support DirectPath over Interconnect Sep 22, 2026
@nidhiii-27

nidhiii-27 commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor Author

Thank you for the thorough review, @alvarowolfx!

Per your feedback:

  1. Scoped this PR to auth changes only (commit 6c19dd8) and resolved all comments
  2. Created dependent Draft PR feat(storage): support DirectPath over Interconnect in GCS gRPC #20561 for the storage changes
  3. Created Draft PR feat(option/internaloption): add EnableDirectPathXdsOverInterconnect google-api-go-client#3742 to add internaloption.EnableDirectPathXdsOverInterconnect()

Storage no longer signals Interconnect via a -direct. endpoint string. The flag is plumbed through internaloption instead, so storage doesn't duplicate the eligibility checks canUseDirectPath already owns.

Merge/release order: #20559 (auth) → google-api-go-client#3742 → #20561 (storage).

Co-authored by AI Agent

Comment thread auth/grpctransport/directpath.go Resolved
Comment thread auth/grpctransport/directpath.go Resolved
Comment thread auth/grpctransport/directpath.go Resolved
Comment thread auth/grpctransport/directpath.go Resolved
Comment thread auth/grpctransport/directpath.go Resolved
Comment thread auth/grpctransport/directpath.go Resolved
@nidhiii-27
nidhiii-27 merged commit dbc2606 into main Oct 1, 2026
17 checks passed
@nidhiii-27
nidhiii-27 deleted the feat/storage-directpath-interconnect branch October 1, 2026 05:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-generated api: storage Issues related to the Cloud Storage API. storage-feature-parity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants