IdentityManager: Eliminate special-case code used for supervised user corner cases |
|
Issue descriptionIn IdentityManager, we have been maintaining the invariant that AccountTrackerService knows of all accounts that ProfileOAuth2TokenService knows of. In ordinary usage, this invariant is true (as far as we know). However, in the context of supervised users, it turns out that it is not true. SupervisedUserService calls PO2TS::LoadCredentials() and PO2TS::UpdateCredentials() without interacting with AccountTrackerService whatsoever (e.g., https://cs.chromium.org/chromium/src/chrome/browser/supervised_user/supervised_user_service.cc?sq=package:chromium&g=0&l=404). Changing SupervisedUserService to interact with AccountTrackerService seems infeasible as we have no way to test those changes and it's non-obvious what the production impact would be (e.g., that pseudo account showing up in various UI surfaces, being persisted to disk by AccountTrackerService, ...). These facts mean that we need to weaken IdentityManager's invariants for interacting with accounts known by ProfileOAuth2TokenService. Concretely, this is necessary to unblock the landing of necessary changes that tickle these invariants (https://chromium-review.googlesource.com/c/chromium/src/+/1126861); that tickling is how these facts were uncovered. Supervised users are deprecated. If/once that functionality is removed, we should restore the invariant that IdentityManager had previously. Unfortunately, I don't know of a tracking bug for that work to block this bug on.
,
Jul 10
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/cfc450eaea093816f8598e95ac5b3e50bf2fc3f0 commit cfc450eaea093816f8598e95ac5b3e50bf2fc3f0 Author: Colin Blundell <blundell@chromium.org> Date: Tue Jul 10 16:52:40 2018 IdentityManager: Handle corner case for supervised users In IdentityManager, we have been maintaining the invariant that AccountTrackerService knows of all accounts that ProfileOAuth2TokenService knows of. In ordinary usage, this invariant is true (as far as we know). However, in the context of supervised users, it turns out that it is not true. SupervisedUserService calls PO2TS::LoadCredentials() and PO2TS::UpdateCredentials() without interacting with AccountTrackerService whatsoever (e.g., https://cs.chromium.org/chromium/src/chrome/browser/supervised_user/supervised_user_service.cc?sq=package:chromium&g=0&l=404). Changing SupervisedUserService to interact with AccountTrackerService seems infeasible as we have no way to test those changes and it's non-obvious what the production impact would be (e.g., that pseudo account showing up in various UI surfaces, being persisted to disk by AccountTrackerService, ...). To handle this case without weakening IdentityManager's invariant, this CL populates AccountInfo as necessary when dealing with the specific account ID used for supervised users. This change is concretely necessary to unblock the landing of necessary changes that tickle these invariants (https://chromium-review.googlesource.com/c/chromium/src/+/1126861); that tickling is how these facts were uncovered. Bug: 860492 Change-Id: I69e67e900f62e92577a52d628f96b1ae0d9a89e3 Reviewed-on: https://chromium-review.googlesource.com/1127050 Commit-Queue: Colin Blundell <blundell@chromium.org> Reviewed-by: Marc Treib <treib@chromium.org> Reviewed-by: Mihai Sardarescu <msarda@chromium.org> Cr-Commit-Position: refs/heads/master@{#573773} [modify] https://crrev.com/cfc450eaea093816f8598e95ac5b3e50bf2fc3f0/chrome/browser/supervised_user/supervised_user_constants.cc [modify] https://crrev.com/cfc450eaea093816f8598e95ac5b3e50bf2fc3f0/services/identity/public/cpp/identity_manager.cc |
|
►
Sign in to add a comment |
|
Comment 1 by blundell@chromium.org
, Jul 5