Skip to content

feat(storage): support DirectPath over Interconnect in gRPC client - #18482

Open
nidhiii-27 wants to merge 2 commits into
googleapis:mainfrom
nidhiii-27:feat/storage-directpath-interconnect-storage
Open

nidhiii-27 wants to merge 2 commits into
googleapis:mainfrom
nidhiii-27:feat/storage-directpath-interconnect-storage

Conversation

@nidhiii-27

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

Copy link
Copy Markdown
Contributor

Summary

Adds support for DirectPath over Cloud Interconnect (GCI) to the Google Cloud Storage Python client veneer across packages/google-cloud-storage (GrpcClient and AsyncGrpcClient).

This PR contains the veneer client changes separated from companion PR #18431 (packages/google-api-core).

Key Changes

  • DirectPath over Interconnect Configuration:
    • Adds attempt_direct_path_xds_over_interconnect parameter to GrpcClient.__init__ and AsyncGrpcClient.__init__.
    • Supports GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS_OVER_INTERCONNECT environment variable override with case-insensitive and whitespace-normalized boolean parsing ("true" / "false"), raising ValueError on invalid values.
  • Endpoint Rewriting:
    • Automatically and safely rewrites default endpoint storage.googleapis.com to storage-direct.googleapis.com when DirectPath over Interconnect is enabled (preserving ports, paths, queries, and fragments).
  • Transport Channel Passthrough:
    • Forwards attempt_direct_path_xds_over_interconnect=True to transport_cls.create_channel.
    • Forwards credentials and quota_project_id to the underlying GAPIC channel creation.
  • Unit & AsyncIO Test Coverage:
    • Full unit test coverage for sync (test_grpc_client.py) and async (test_async_grpc_client.py) clients verifying channel creation, environment overrides, fallback host rewriting, and error handling.

References


[Generated-by: AI]

Add support for DirectPath over Cloud Interconnect in GCS gRPC client
(GrpcClient and AsyncGrpcClient).

- Add attempt_direct_path_xds_over_interconnect parameter and
  GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS_OVER_INTERCONNECT env var override.
- Rewrite default endpoint to storage-direct.googleapis.com when enabled.
- Forward credentials, quota_project_id, and attempt_direct_path_xds_over_interconnect
  to GAPIC transport.
- Unit tests for sync and async gRPC client.

[Generated-by: AI]
@nidhiii-27
nidhiii-27 requested a review from a team as a code owner September 28, 2026 06:05

@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 Cloud Interconnect using xDS and standard TLS in both the synchronous and asynchronous Google Cloud Storage gRPC clients. It adds the attempt_direct_path_xds_over_interconnect option, environment variable resolution, host rewriting logic, and corresponding unit tests. The feedback suggests simplifying a redundant boolean expression to True in both async_grpc_client.py and grpc_client.py since the conditional block guarantees that the flag is already enabled.

Comment thread packages/google-cloud-storage/google/cloud/storage/asyncio/async_grpc_client.py Outdated
Comment thread packages/google-cloud-storage/google/cloud/storage/grpc_client.py Outdated

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant