Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(837)

Issue 1108983002: Fetch policy with refresh token. (Closed)

Created:
5 years, 8 months ago by achuithb
Modified:
5 years, 7 months ago
CC:
chromium-reviews, dzhioev+watch_chromium.org, stevenjb+watch_chromium.org, oshima+watch_chromium.org, davemoore+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fetch policy with refresh token. WildcardLoginChecker and UserCloudPolicyManagerChromeOS now use this mechanism to fetch policy. BUG=478432, 470984, 462036, 480447 TEST=manual Committed: https://crrev.com/174b27ddc1d2ef0600219bd0d2b9595bde975495 Cr-Commit-Position: refs/heads/master@{#327375}

Patch Set 1 #

Patch Set 2 : UserCloudPolicyManagerChromeOS #

Total comments: 2

Patch Set 3 : comment and unit test #

Total comments: 5

Patch Set 4 : Mattias feedback #

Total comments: 2

Patch Set 5 : remove unnecessary include #

Patch Set 6 : Fix user_cloud_policy_manager_chromeos_unittest #

Unified diffs Side-by-side diffs Delta from patch set Stats (+83 lines, -31 lines) Patch
M chrome/browser/chromeos/login/auth/chrome_login_performer.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/chromeos/login/auth/chrome_login_performer.cc View 2 chunks +14 lines, -6 lines 0 comments Download
M chrome/browser/chromeos/login/session/user_session_manager.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.h View 2 chunks +6 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.cc View 3 chunks +7 lines, -4 lines 0 comments Download
M chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h View 1 2 3 1 chunk +4 lines, -3 lines 0 comments Download
M chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.cc View 1 2 3 3 chunks +15 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos_unittest.cc View 1 2 3 4 5 4 chunks +8 lines, -1 line 0 comments Download
M chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.cc View 1 2 3 4 3 chunks +5 lines, -11 lines 0 comments Download
M chrome/browser/chromeos/policy/wildcard_login_checker.h View 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/policy/wildcard_login_checker.cc View 1 chunk +16 lines, -0 lines 0 comments Download
M chromeos/login/auth/login_performer.h View 1 chunk +1 line, -0 lines 0 comments Download
M chromeos/login/auth/login_performer.cc View 1 chunk +1 line, -2 lines 0 comments Download

Messages

Total messages: 56 (24 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1108983002/1
5 years, 8 months ago (2015-04-27 23:29:28 UTC) #2
achuithb
Xiyuan, Mattias, please take a look.
5 years, 8 months ago (2015-04-27 23:30:31 UTC) #4
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 8 months ago (2015-04-27 23:58:06 UTC) #6
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1108983002/20001
5 years, 8 months ago (2015-04-28 00:19:57 UTC) #8
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_gn_chromeos_rel on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_gn_chromeos_rel/builds/31771)
5 years, 8 months ago (2015-04-28 00:40:41 UTC) #10
xiyuan
LGTM with greet build + Mattias's review. :) https://codereview.chromium.org/1108983002/diff/20001/chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.cc File chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.cc (right): https://codereview.chromium.org/1108983002/diff/20001/chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.cc#newcode159 chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.cc:159: (user_session_manager->has_auth_cookies() ...
5 years, 8 months ago (2015-04-28 01:52:58 UTC) #11
achuithb
Dmitry for review + owner lgtm for chromeos/login https://codereview.chromium.org/1108983002/diff/20001/chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.cc File chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.cc (right): https://codereview.chromium.org/1108983002/diff/20001/chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.cc#newcode159 chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.cc:159: (user_session_manager->has_auth_cookies() ...
5 years, 7 months ago (2015-04-28 06:28:59 UTC) #13
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1108983002/40001
5 years, 7 months ago (2015-04-28 06:29:17 UTC) #16
Mattias Nissler (ping if slow)
LGTM w/ nits https://codereview.chromium.org/1108983002/diff/40001/chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.h File chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.h (right): https://codereview.chromium.org/1108983002/diff/40001/chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.h#newcode58 chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.h:58: void StartWithRefreshToken(const std::string& oauth2_refresh_token); Please turn ...
5 years, 7 months ago (2015-04-28 06:50:43 UTC) #17
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 7 months ago (2015-04-28 07:01:32 UTC) #19
Dmitry Polukhin
LGTM You also need to add something like patch set #1 from my CL https://codereview.chromium.org/1107873002/#ps1 ...
5 years, 7 months ago (2015-04-28 08:59:11 UTC) #21
Nikita (slow)
lgtm I suggest include my CL as a part of yours to make sure that ...
5 years, 7 months ago (2015-04-28 13:17:30 UTC) #23
achuithb
On 2015/04/28 08:59:11, Dmitry Polukhin wrote: > LGTM > > You also need to add ...
5 years, 7 months ago (2015-04-28 18:16:28 UTC) #24
achuithb
On 2015/04/28 13:17:30, Nikita Kostylev wrote: > lgtm > > I suggest include my CL ...
5 years, 7 months ago (2015-04-28 18:17:16 UTC) #25
achuithb
Thank you for the review, Mattias. I'm no longer passing in the refresh_token as an ...
5 years, 7 months ago (2015-04-28 18:20:08 UTC) #26
achuithb
Xiyuan - do you mind taking one last look before I land this?
5 years, 7 months ago (2015-04-28 18:21:24 UTC) #29
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1108983002/60001
5 years, 7 months ago (2015-04-28 18:22:29 UTC) #30
xiyuan
LGTM++ https://codereview.chromium.org/1108983002/diff/60001/chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.cc File chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.cc (right): https://codereview.chromium.org/1108983002/diff/60001/chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.cc#newcode18 chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.cc:18: #include "chrome/browser/chromeos/login/session/user_session_manager.h" nit: This probably can go now.
5 years, 7 months ago (2015-04-28 18:33:41 UTC) #31
achuithb
Thank you, Xiyuan! https://codereview.chromium.org/1108983002/diff/60001/chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.cc File chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.cc (right): https://codereview.chromium.org/1108983002/diff/60001/chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.cc#newcode18 chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.cc:18: #include "chrome/browser/chromeos/login/session/user_session_manager.h" On 2015/04/28 18:33:41, xiyuan ...
5 years, 7 months ago (2015-04-28 18:56:22 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1108983002/80001
5 years, 7 months ago (2015-04-28 18:57:29 UTC) #35
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_ozone_rel_ng/builds/12198)
5 years, 7 months ago (2015-04-28 19:53:05 UTC) #37
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1108983002/100001
5 years, 7 months ago (2015-04-28 20:05:06 UTC) #40
xiyuan
On 2015/04/28 19:53:05, I haz the power (commit-bot) wrote: > Try jobs failed on following ...
5 years, 7 months ago (2015-04-28 20:06:42 UTC) #41
achuithb
On 2015/04/28 20:06:42, xiyuan wrote: > On 2015/04/28 19:53:05, I haz the power (commit-bot) wrote: ...
5 years, 7 months ago (2015-04-28 20:07:49 UTC) #42
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1108983002/120001
5 years, 7 months ago (2015-04-28 20:58:38 UTC) #47
achuithb
On 2015/04/28 20:07:49, achuithb wrote: > On 2015/04/28 20:06:42, xiyuan wrote: > > On 2015/04/28 ...
5 years, 7 months ago (2015-04-28 20:58:43 UTC) #48
xiyuan
SLGTM
5 years, 7 months ago (2015-04-28 21:02:39 UTC) #49
achuithb
On 2015/04/28 21:02:39, xiyuan wrote: > SLGTM danke schön!
5 years, 7 months ago (2015-04-28 21:03:23 UTC) #50
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1108983002/120001
5 years, 7 months ago (2015-04-28 22:06:24 UTC) #53
commit-bot: I haz the power
Committed patchset #6 (id:120001)
5 years, 7 months ago (2015-04-28 22:13:05 UTC) #54
commit-bot: I haz the power
Patchset 6 (id:??) landed as https://crrev.com/174b27ddc1d2ef0600219bd0d2b9595bde975495 Cr-Commit-Position: refs/heads/master@{#327375}
5 years, 7 months ago (2015-04-28 22:13:55 UTC) #55
Mattias Nissler (ping if slow)
5 years, 7 months ago (2015-04-29 07:10:52 UTC) #56
Message was sent while issue was closed.
https://codereview.chromium.org/1108983002/diff/40001/chrome/browser/chromeos...
File chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.h (right):

https://codereview.chromium.org/1108983002/diff/40001/chrome/browser/chromeos...
chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.h:58: void
StartWithRefreshToken(const std::string& oauth2_refresh_token);
On 2015/04/28 18:20:08, achuithb wrote:
> On 2015/04/28 06:50:43, Mattias Nissler wrote:
> > Please turn this into a 3rd constructor for consistency.
> 
> I considered this. The first problem is that the type of auth_code and
> refresh_token is the same (const std::string&), so the ctor signatures would
be
> the same.

That's a good point.

> The bigger issue is that multiple ctors are just a variation of
> function overloading which is not recommended stylistically. 

I don't agree with this. The style guide allows overloads where they make sense.
Having different constructors that initialize the class differently seems
totally fine here. Having a single Start() function also makes it clearer what
the calling code is supposed to do, whereas multiple StartWithXYZ functions may
create the misunderstanding that they could / should be called in order.

> 
> I think the way to go is to have one ctor, and have methods
> StartWithBrowserContext, StartWithAuthCode, and StartWithRefreshToken. I'll do
> this in a follow-up cleanup CL to avoid clutter in this CL. 

Please do. Happy to review the CL.

Powered by Google App Engine
This is Rietveld 408576698