-
Notifications
You must be signed in to change notification settings - Fork 384
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
fix: throw when adc cannot acquire a projectId #658
Conversation
Codecov Report
@@ Coverage Diff @@
## master #658 +/- ##
==========================================
+ Coverage 88.12% 88.25% +0.12%
==========================================
Files 18 18
Lines 783 783
Branches 84 84
==========================================
+ Hits 690 691 +1
+ Misses 82 81 -1
Partials 11 11
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #658 +/- ##
==========================================
+ Coverage 88.12% 88.25% +0.12%
==========================================
Files 18 18
Lines 783 783
Branches 84 84
==========================================
+ Hits 690 691 +1
+ Misses 82 81 -1
Partials 11 11
Continue to review full report at Codecov.
|
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 like this a lot 👍
await this.getFileProjectId() || | ||
await this.getDefaultServiceProjectId() || | ||
await this.getGCEProjectId(); | ||
this._cachedProjectId = projectId; |
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 like this addition, I'd way rather the library fail early than run in an undefined state with no project ID.
BREAKING CHANGE Currently, when a user is using application default credentials, and they call
auth.getProjectId
, we check a variety of sources, and return the first projectId we find. In the event of none - we returnnull
. This PR changes the behavior, so instead of returningnull
, we throw an exception.