Closed chanseokoh closed 7 years ago
Also, account name and avatar URL are persisted.
Is this still active? If so, please merge with master and ping me to review. Otherwise, close. Thanks.
This is active but has never been a priority. Hope I'll get back to this sooner or later.
@@ Coverage Diff @@
## master #32 +/- ##
==========================================
- Coverage 78.09% 74.88% -3.21%
==========================================
Files 8 10 +2
Lines 210 223 +13
Branches 24 20 -4
==========================================
+ Hits 164 167 +3
- Misses 38 50 +12
+ Partials 8 6 -2
Impacted Files | Coverage Δ | |
---|---|---|
...in/GoogleAuthorizationCodeTokenRequestCreator.java | 0% <ø> (ø) |
:white_check_mark: |
.../google/cloud/tools/ide/login/UserInfoService.java | 0% <ø> (ø) |
|
...ava/com/google/cloud/tools/ide/login/UserInfo.java | 0% <ø> (ø) |
|
...va/com/google/cloud/tools/ide/login/OAuthData.java | 100% <100%> (ø) |
:white_check_mark: |
...om/google/cloud/tools/ide/login/AccountRoster.java | 100% <100%> (ø) |
:white_check_mark: |
.../tools/ide/login/JavaPreferenceOAuthDataStore.java | 85.41% <100%> (+1.32%) |
:white_check_mark: |
...java/com/google/cloud/tools/ide/login/Account.java | 94.73% <100%> (+12.38%) |
:white_check_mark: |
...google/cloud/tools/ide/login/GoogleLoginState.java | 70.87% <88.23%> (+0.18%) |
:white_check_mark: |
... and 2 more |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update aa815ff...1fb2af7. Read the comment docs.
Ready for review, @elharo.
Fixes #24.
Account name and avatar URL are queried through Google OAuth2 API. Basically, you do
and the result
userInfo
contains an email, an account name, and an avatar URL. Very convenient.(
userInfo
already contains an email, so the previous low-level logic to directly accessinghttps://www.googleapis.com/userinfo/email
and manually parsing the response is no longer necessary.)Notes:
UserInfoService
is a wrapper aroundOauth2.Builder
andUserinfoplus
. The new class is to enable unit testing, since Mockito cannot mock some of the OAuth2 API classes. (They arefinal
.)URL
-->String
foravatarUrl
: after some tinkering, it looks likeString
is better suited.HttpRequestInitializer
.