This repository has been archived by the owner on Sep 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 233
client: fix wrong call to google-auth-library-java #1229
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
davidxia
force-pushed
the
dxia/patch-client
branch
from
August 17, 2018 18:33
54e567e
to
008a515
Compare
cc @spotify/helios-team |
before
after
|
vbhavsar
approved these changes
Aug 17, 2018
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.
LGTM
This PR doesn't address the Google auth warning introduced by upgrading google-auth-library-java. This just makes the CLI actually work. |
👍 |
We were mistakenly calling `GoogleCredentials.refreshAccessToken()` which always makes a call to retrieve a new access token regardless of expiration. In addition, this method returns an `AccessToken` which we accidentally ignored. But this method but never sets the `AccessToken` for the `getAccessToken()` method which we subsequently called. Instead, we should use `GoogleCredentials.refreshIfExpired()` which refreshes the token if only if it's close to expiring and returns void. Our next call to `getAccessToken()` will actually return the refreshed token in this case. See googleapis/google-auth-library-java#163
davidxia
force-pushed
the
dxia/patch-client
branch
from
August 17, 2018 18:55
008a515
to
d9ae6e5
Compare
Codecov Report
@@ Coverage Diff @@
## master #1229 +/- ##
============================================
- Coverage 52.71% 52.66% -0.06%
Complexity 1623 1623
============================================
Files 268 268
Lines 13036 13036
Branches 1506 1506
============================================
- Hits 6872 6865 -7
- Misses 5644 5651 +7
Partials 520 520 |
was it #1227 that broke this? |
Yea
--
David Xia
Software Engineer
[email protected]
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
We were mistakenly calling
GoogleCredentials.refreshAccessToken()
which always makes a call to retrieve a new access token regardless of expiration.
In addition, this method returns an
AccessToken
which we accidentallyignored. But this method but never sets the
AccessToken
for the
getAccessToken()
method which we subsequently called.Instead, we should use
GoogleCredentials.refreshIfExpired()
which refreshes the token if only if it's close to expiring and returns
void. Our next call to
getAccessToken()
will actually return the refreshedtoken in this case.
See googleapis/google-auth-library-java#163