feat: send quota project id in x-goog-user-project for OAuth2 credentials #412
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.
(Re-adds quota_project_id. Original PR is #400.)
When 3LO credentials are used, the quota project ("quota_project_id") should be sent on every outgoing request in the x-goog-user-project HTTP header/grpc metadata.
New Addition:
google.oauth2.credentials
has__setstate__
and__getstate__
methods to properly unpickle objects created with previous library versions.Samples that use google-api-python-client often pickle the OAuth2 credentials object (examples: 1, 2). Folks had token files that stopped working when they upgraded the library. See issue #405.
I could add
__setstate__
and__getstate__
to the base credentials classgoogle.auth.credentials
, but I think other types of credentials are less likely to be pickled.