-
Notifications
You must be signed in to change notification settings - Fork 94
feat(auth): Add ProgrammaticSourcedCredentials #2541
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
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2541 +/- ##
==========================================
+ Coverage 95.34% 95.47% +0.12%
==========================================
Files 79 81 +2
Lines 3224 3314 +90
==========================================
+ Hits 3074 3164 +90
Misses 150 150 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| /// Sets the required token URL for the STS token exchange. | ||
| pub fn with_token_url<S: Into<String>>(mut self, token_url: S) -> Self { |
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 believe we can default to sts.googleapis.com. We do not have to force user into providing this. @leosiracusa thoughts?
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.
yeah having a default here is better, I added a default here for now.
dbolduc
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.
Also it looks like only the credentials::Builder heeds the GOOGLE_CLOUD_QUOTA_PROJECT env var. Is that env var only for ADC?
According to the guidance in AIP-4110, this variable is intended to specify a quota project for Application Default Credentials (ADC). I've also reviewed the Java implementation of this, and it confirms that Currently, our |
|
Ack, thanks for checking |
As part of allowing the user to provide their own subject token provider, this PR makes following changes:
Make SubjectTokenProvider trait public.
A new builder ProgrammaticSourcedCredentials is created to utilize this trait and a corresponding test case has been added.