feat(storage): support DirectPath over Interconnect in GCS gRPC - #18431
Open
nidhiii-27 wants to merge 5 commits into
Open
nidhiii-27 wants to merge 5 commits into
nidhiii-27 wants to merge 5 commits into
Conversation
Add support for DirectPath over Cloud Interconnect (DP over GCI) across google.api_core.grpc_helpers, google.api_core.grpc_helpers_async, google.cloud.storage.grpc_client.GrpcClient, and google.cloud.storage.asyncio.async_grpc_client.AsyncGrpcClient. - Add attempt_direct_path_xds_over_interconnect option and GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS_OVER_INTERCONNECT env override. - Synthesize standard TLS composite credentials instead of GCE ALTS when DirectPath over Interconnect is enabled. - Rewrite storage.googleapis.com to storage-direct.googleapis.com and append ?force-xds to google-c2p:/// target URIs. [Generated-by: AI]
Contributor
There was a problem hiding this comment.
Code Review
This pull request adds support for DirectPath over Cloud Interconnect using xDS and standard TLS credentials across both synchronous and asynchronous gRPC helpers in google-api-core and the gRPC client in google-cloud-storage. Key feedback includes fixing a target rewriting bug where dns:/// prefixes cause conversion to be skipped, restricting the unsafe replacement of -direct. to only target -direct.googleapis.com to avoid corrupting custom user endpoints, and improving environment variable parsing to handle case-insensitivity and raise errors on invalid configuration values.
Ensure 100% test coverage for _resolve_direct_path_interconnect and _create_composite_credentials in google.api_core.grpc_helpers. [Generated-by: AI]
Contributor
Author
|
/gcbrun |
…authority override - Normalize casing and whitespace in _resolve_direct_path_interconnect and raise ValueError on invalid values - Inject grpc.ssl_target_name_override authority override for -direct.googleapis.com endpoints when DirectPath over Interconnect is enabled - Restrict CloudPath fallback host replacement to -direct.googleapis.com -> .googleapis.com - Strip dns:///, https://, and http:// scheme prefixes and path components in _modify_target_for_direct_path - Forward credentials and quota_project_id in GrpcClient._create_gapic_client when attempt_direct_path_xds_over_interconnect is enabled [Generated-by: AI]
…erride branches Add unit tests for _extract_direct_path_authority and authority override branches in grpc_helpers and grpc_helpers_async to restore 100% coverage. [Generated-by: AI]
nidhiii-27
marked this pull request as ready for review
September 23, 2026 06:09
Contributor
Author
|
/gcbrun(d8a2d4e) |
Contributor
Author
|
/gcbrun(0596f2e) |
Contributor
Author
|
/gcbrun |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds support for DirectPath over Cloud Interconnect (
attempt_direct_path_xds_over_interconnect/GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS_OVER_INTERCONNECT) acrossgoogle-api-coreandgoogle-cloud-storage(GrpcClientandAsyncGrpcClient), aligned with Go (googleapis/google-cloud-go#20559), Java (googleapis/google-cloud-java#14006), and C++ (googleapis/google-cloud-cpp#16408).Key Changes
google-api-core(grpc_helpers.py&grpc_helpers_async.py):attempt_direct_path_xds_over_interconnectparameter andGOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS_OVER_INTERCONNECTenvironment variable resolution (_resolve_direct_path_interconnect) with case-insensitive/whitespace-normalized boolean parsing ("true"/"false") and fast-failValueErroron invalid values.grpc.ssl_channel_credentials()) by default whenattempt_direct_path_xds_over_interconnectis enabled while allowing customssl_credentials.?force-xds(or&force-xds) togoogle-c2p:///targets in_modify_target_for_direct_path, and stripsdns:///,https://, andhttp://scheme prefixes as well as path segments before port splitting.("grpc.ssl_target_name_override", authority)(e.g.storage.googleapis.com) into channeloptionswhen connecting to-direct.googleapis.comendpoints over DirectPath over Cloud Interconnect.-direct.googleapis.comendpoints back to.googleapis.comwhen falling back to CloudPath (attempt_direct_path=Falseandattempt_direct_path_xds_over_interconnect=False).google-cloud-storage(GrpcClient&AsyncGrpcClient):attempt_direct_path_xds_over_interconnectandGOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS_OVER_INTERCONNECT, rewritesstorage.googleapis.comtostorage-direct.googleapis.com, and forwardscredentialsandquota_project_idtotransport_cls.create_channel.test_grpc_helpers.py,test_grpc_helpers_async.py,test_grpc_client.py, andtest_async_grpc_client.py.Generated by AI Agent