Skip to content

fix(storage): support universe_domain in gRPC clients - #19188

Merged
shradhakatyal merged 2 commits into
googleapis:mainfrom
shradhakatyal:fix/storage-grpc-universe-domain
Nov 23, 2026
Merged

shradhakatyal merged 2 commits into
googleapis:mainfrom
shradhakatyal:fix/storage-grpc-universe-domain

Conversation

@shradhakatyal

Copy link
Copy Markdown
Contributor

Summary

Ports #19160 onto the v3.17.1 baseline after #19186 for the patch release.

GrpcClient and AsyncGrpcClient now honor universe_domain from client_options or GOOGLE_CLOUD_UNIVERSE_DOMAIN.

Changes

  • Add shared _resolve_universe_domain, _resolve_grpc_config, and _validate_universe_domain helpers in grpc_client.py.
  • Route gRPC channels to storage.{universe_domain} unless client_options.api_endpoint overrides the host.
  • Disable DirectPath automatically outside the default googleapis.com universe.
  • Validate credential universe domains before channel creation using google.api_core.universe.compare_domains.
  • Skip universe validation only for unconfigured unittest.mock credentials so caller unit tests continue to work.
  • Expose universe_domain on both GrpcClient and AsyncGrpcClient.

Ports googleapis#19160 onto the v3.17.1 baseline for the patch release.

Updates GrpcClient and AsyncGrpcClient to resolve universe_domain from
client_options or GOOGLE_CLOUD_UNIVERSE_DOMAIN and disable DirectPath
outside googleapis.com.

Validates credential universe domains before creating a gRPC channel,
while skipping unconfigured unittest.mock credentials used in unit tests.

Co-authored-by: Daniel Sanche <d.sanche14@gmail.com>
Co-authored-by: Chandra Sirimala <chandrasiri@google.com>

[Generated-by: AI]

@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 universe domain support and validation for both the synchronous and asynchronous gRPC clients in google-cloud-storage. It adds helper functions to resolve universe domains from client options or environment variables, validates credentials against the resolved domain, and disables DirectPath for non-default universes. The review feedback highlights a potential AttributeError when validating certain mock credentials and suggests using local variables instead of redundantly re-assigning self._universe_domain within the client creation helper methods.

@shradhakatyal

Copy link
Copy Markdown
Contributor Author

/gcbrun (8e26f98)

@shradhakatyal
shradhakatyal marked this pull request as ready for review November 23, 2026 12:15
@shradhakatyal
shradhakatyal requested review from a team as code owners November 23, 2026 12:15
@shradhakatyal
shradhakatyal merged commit d2d5dee into googleapis:main Nov 23, 2026
82 of 83 checks passed
shradhakatyal pushed a commit that referenced this pull request Nov 23, 2026
🤖 I have created a release *beep* *boop*
---


##
[3.17.2](google-cloud-storage-v3.17.1...google-cloud-storage-v3.17.2)
(2026-11-23)


### Bug Fixes

* **storage:** support universe_domain in gRPC clients
([#19188](#19188))
([d2d5dee](d2d5dee))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
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.

2 participants