Repository navigation
fix: validate universes for custom http transports - #2864
Open
daniel-sanche wants to merge 12 commits into
Open
daniel-sanche wants to merge 12 commits into
daniel-sanche wants to merge 12 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request implements universe domain validation for standalone and batch HTTP requests, ensuring that credentials match the client's configured universe domain during execution, chunked uploads, and media downloads. The feedback suggests a robustness improvement in BatchHttpRequest._validate_http_credentials to filter out None transports when collecting credentials from subrequests, preventing potential errors.
Comment on lines
+1365
to
+1368
| for transport in (http, *(self._requests[i].http for i in self._order)): | ||
| creds = _auth.get_credentials_from_http(transport) | ||
| if creds is not None: | ||
| creds_by_id[id(creds)] = creds |
There was a problem hiding this comment.
Some subrequests in the batch may not have an explicit http transport configured (i.e., self._requests[i].http is None). To prevent passing None to _auth.get_credentials_from_http, filter out None transports from the iteration.
Suggested change
| for transport in (http, *(self._requests[i].http for i in self._order)): | |
| creds = _auth.get_credentials_from_http(transport) | |
| if creds is not None: | |
| creds_by_id[id(creds)] = creds | |
| for transport in (http, *(self._requests[i].http for i in self._order)): | |
| if transport is not None: | |
| creds = _auth.get_credentials_from_http(transport) | |
| if creds is not None: | |
| creds_by_id[id(creds)] = creds |
daniel-sanche
force-pushed
the
b588887517_python_track_one_google-api-python-client_02_execute-http-universe
branch
from
December 4, 2026 22:08
b048018 to
2e0be2a
Compare
daniel-sanche
marked this pull request as ready for review
December 4, 2026 22:08
Base automatically changed from
b588887517_python_track_one_google-api-python-client_01_live-discovery-universe
to
main
December 4, 2026 22:16
daniel-sanche
force-pushed
the
b588887517_python_track_one_google-api-python-client_02_execute-http-universe
branch
from
December 4, 2026 22:16
2e0be2a to
03642c3
Compare
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.
This library allows users to pass in custom
httplib2.Httptransport objects forexecute()calls, which hold their own credentials. These credentials may not match the configured universe the client is talking toThis PR adds an extra validation step for these passed-in transports