Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: send quota project id in x-goog-user-project for OAuth2 credentials #400

Merged
merged 4 commits into from Dec 6, 2019

Conversation

busunkim96
Copy link
Contributor

@busunkim96 busunkim96 commented Dec 5, 2019

When the 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.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Dec 5, 2019
google/oauth2/credentials.py Outdated Show resolved Hide resolved
@busunkim96 busunkim96 changed the title feat: send quota project in x-goog-user-project for OAuth2 credentials feat: send quota project id in x-goog-user-project for OAuth2 credentials Dec 5, 2019
@broady
Copy link

broady commented Dec 5, 2019

LGTM, PTAL @shinfan / @CodingFanSteve

@shinfan
Copy link

shinfan commented Dec 5, 2019

LGTM. Thanks.

Just wanna mention we will also need this quota project as a client-level option.

@wora FYI

@busunkim96 busunkim96 mentioned this pull request Dec 6, 2019
@busunkim96
Copy link
Contributor Author

@shinfan @broady Thank you for the fast reviews! Is sometime late in Q1 an acceptable timeframe for adding this as a client-level option? I'd prefer to be done with the transition to the Python microgenerator to avoid doing the work twice. 😄

@shinfan
Copy link

shinfan commented Dec 6, 2019

late Q1 sounds good to me :) Thank you!

@busunkim96 busunkim96 merged commit ab3dc1e into googleapis:master Dec 6, 2019
@srulkapara
Copy link

@busunkim96 just a quick note that this code is not fully backward-compatible (not talking about constrcutors - i mean in terms of already-pickled creds-token-files, who are missing the new member - who has no default on __setstate__).
Some of Google's best-practices/demo-quickstarts include pickling these tokens to files, so they will be broken after this merge (while not changing the minor module-version). maybe we should cover those cases as well..
(happened to me, thought maybe you should know)

@busunkim96
Copy link
Contributor Author

@srulkapara Thank you for the heads up! I'll continue to track this in #405

busunkim96 added a commit that referenced this pull request Dec 10, 2019
busunkim96 added a commit that referenced this pull request Dec 11, 2019
busunkim96 added a commit to busunkim96/google-auth-library-python that referenced this pull request Dec 16, 2019
…credentials (googleapis#400)

When the 3LO credentials are used, the quota project ("quota_project_id") is sent on every outgoing request in the x-goog-user-project HTTP header/grpc metadata. The quota project is used for billing and quota purposes.
busunkim96 added a commit that referenced this pull request Dec 18, 2019
…ials (#412)

* feat: send quota project id in x-goog-user-project header for OAuth2 credentials (#400)

When the 3LO credentials are used, the quota project ("quota_project_id") is sent on every outgoing request in the x-goog-user-project HTTP header/grpc metadata. The quota project is used for billing and quota purposes.

* feat: add `__setstate__` and `__getstate__` to `oauth2.credentials` class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants