Repository navigation
feat(auth/grpctransport): support DirectPath over Interconnect - #20559
Conversation
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]
There was a problem hiding this comment.
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.
[Generated-by: AI]
…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]
…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
left a comment
There was a problem hiding this comment.
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.
…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]
|
Thank you for the thorough review, @alvarowolfx! Per your feedback:
Storage no longer signals Interconnect via a Merge/release order: #20559 (auth) → google-api-go-client#3742 → #20561 (storage). Co-authored by AI Agent |
Summary
Adds support for DirectPath over Google Cloud Interconnect in
cloud.google.com/go/auth/grpctransport(andauth/internal/transport) for on-premises and hybrid environments.(Note: The
cloud.google.com/go/storagechanges have been split out into a separate dependent PR so thatcloud.google.com/go/authcan be merged and released first.)Changes in
authauth/grpctransport&auth/internal/transport:InternalOptions.EnableDirectPathXdsOverInterconnectand environment variable overrideGOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS_OVER_INTERCONNECT.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).<service>.googleapis.comendpoints togoogle-c2p:///<service>-direct.googleapis.com?force-xdsand setsgrpc.WithAuthority("<service>.googleapis.com")insideconfigureDirectPathwhen DirectPath over Interconnect is eligible.canUseDirectPathreturnsfalse.?force-xds) inextractHostPortand allowsgoogle-c2p:///target URIs incheckDirectPathEndPoint.