Identity Service: Add GetAccounts() interface |
||||||
Issue descriptionThis interface should be backed by ProfileOAuth2Service::GetAccounts(), as that is the interface that authoritatively returns the set of accounts (per discussion with msarda@, Chrome Identity TL). Note that we will have to be careful in migrating consumers, as there are other GetAccounts() methods that are not exactly the same as PO2TS::GetAccounts() (or each other): - AccountTracker::GetAccounts() - AccountTrackerService::GetAccounts() We will call this fact out in documentation when adding the GetAccounts() interface to the Identity Service.
,
Jun 5 2017
,
Jun 5 2017
,
Jul 24 2017
,
Jul 28 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/bf44268201f947d844fb2667ca2b618d1d4213d8 commit bf44268201f947d844fb2667ca2b618d1d4213d8 Author: Colin Blundell <blundell@chromium.org> Date: Fri Jul 28 13:08:05 2017 [Identity Service] Add GetAccounts() API This CL adds an API to the Identity Service to get a list of all accounts. This API has the following semantics, using the needs of the chrome.identity.getAccounts() extension API as a guide: - Returns the primary account (if any) first - Returns only accounts for which a refresh token is available This CL also adds the Account mojom struct to wrap AccountInfo and AccountState. This change is necessary in order to easily return a list of (AccountInfo, AccountState) pairs. A followup CL will change all of the IdentityManager APIs to talk in terms of Account. Finally, this CL ports the implementation of chrome.identity.getAccounts() to use the new Identity Service API as an initial customer and validation of the API. We preserve the existing semantics of the chrome.identity.getAccounts() implementation wrt the primary account: the impl returns an empty list if there is no primary account or if the primary account doesn't have a refresh token, just as it did before. We also augment the tests of that implementation with tests of this semantics, as nothing was testing this behavior before. manifest. Go to chrome://extensions, enable developer mode, and inspect the background page of the above app. At the JS console that that brings up, execute: chrome.identity.getAccounts((accounts) => {console.log(accounts[0]);} ) Verify that the user's GAIA ID (a long string of numbers) appears rather than an error being reported. Bug: 729533 , 729537 Test: Install a Chrome extension with the identity permissions in its Change-Id: Ibd4ea6843fc5c78738286f280d973a4a19176f23 Reviewed-on: https://chromium-review.googlesource.com/583069 Commit-Queue: Colin Blundell <blundell@chromium.org> Reviewed-by: Daniel Cheng <dcheng@chromium.org> Reviewed-by: Ken Rockot <rockot@chromium.org> Reviewed-by: Mihai Sardarescu <msarda@chromium.org> Cr-Commit-Position: refs/heads/master@{#490376} [modify] https://crrev.com/bf44268201f947d844fb2667ca2b618d1d4213d8/chrome/browser/extensions/api/identity/identity_apitest.cc [modify] https://crrev.com/bf44268201f947d844fb2667ca2b618d1d4213d8/chrome/browser/extensions/api/identity/identity_get_accounts_function.cc [modify] https://crrev.com/bf44268201f947d844fb2667ca2b618d1d4213d8/chrome/browser/extensions/api/identity/identity_get_accounts_function.h [modify] https://crrev.com/bf44268201f947d844fb2667ca2b618d1d4213d8/services/identity/README.md [modify] https://crrev.com/bf44268201f947d844fb2667ca2b618d1d4213d8/services/identity/identity_manager.cc [modify] https://crrev.com/bf44268201f947d844fb2667ca2b618d1d4213d8/services/identity/identity_manager.h [modify] https://crrev.com/bf44268201f947d844fb2667ca2b618d1d4213d8/services/identity/identity_manager_unittest.cc [modify] https://crrev.com/bf44268201f947d844fb2667ca2b618d1d4213d8/services/identity/public/interfaces/BUILD.gn [add] https://crrev.com/bf44268201f947d844fb2667ca2b618d1d4213d8/services/identity/public/interfaces/account.mojom [modify] https://crrev.com/bf44268201f947d844fb2667ca2b618d1d4213d8/services/identity/public/interfaces/identity_manager.mojom
,
Jul 31 2017
,
Nov 7 2017
|
||||||
►
Sign in to add a comment |
||||||
Comment 1 by blundell@chromium.org
, Jun 5 2017