- Notifications
You must be signed in to change notification settings - Fork 259
feat: Introduce Environment Variable for Quota Project Id #1082
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
Conversation
TimurSadykov left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few comments
oauth2_http/java/com/google/auth/oauth2/DefaultCredentialsProvider.java Outdated Show resolved Hide resolved
oauth2_http/javatests/com/google/auth/oauth2/DefaultCredentialsProviderTest.java Show resolved Hide resolved
oauth2_http/javatests/com/google/auth/oauth2/DefaultCredentialsProviderTest.java Show resolved Hide resolved
8ccaed6 to 2cc31f7 Compare 6a0436f to e390a30 Compare a916df8 to a7927c1 Compare oauth2_http/javatests/com/google/auth/oauth2/functional/FTQuotaProjectId.java Show resolved Hide resolved
| | ||
| @Test | ||
| public void adcQuotaFromEnv() throws IOException { | ||
| GoogleCredentials credentials = GoogleCredentials.getApplicationDefault(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a big fan of this test where the code does not control the success of this test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed. Moved this as an assert on env var to the other test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, for a late comment. I think we better restore the original test. It is not perfect but it adds value by validating the quota project override behavior "in the wild".
The second test only checks that override does not work for explicit value, which is a different test case
TimurSadykov left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a question on clirr
oauth2_http/javatests/com/google/auth/oauth2/functional/FTQuotaProjectId.java Outdated Show resolved Hide resolved
TimurSadykov left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auth bits looks good
Introduce a new environment variable "GOOGLE_CLOUD_QUOTA_PROJECT" that can be used to specify a quota project id. This quota project will be used to override the quota project from the credential detected during ADC generation.
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #<issue_number_goes_here> ☕️
If you write sample code, please follow the samples format.