New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 922482 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Today
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug

Blocking:
issue 890811
issue 908811



Sign in to add a comment

Create AccountsMutator::MoveAccount() method to replace PO2TS::ExtractCredentials()

Project Member Reported by blundell@chromium.org, Jan 16 (6 days ago)

Issue description

PO2TS::ExtractCredentials() is used by dice_turn_on_sync_helper.cc. Hence, we need an equivalent on AccountsMutator. Let's call this MoveAccount().
 

Comment 1 by toniki...@chromium.org, Jan 16 (6 days ago)

Owner: toniki...@chromium.org
Status: Started (was: Available)
Thanks Colin. I have not filed that specific bug because I thought this API could be implemented locally by calling the two from its body separately (maybe having a local helper methor):

void MutableProfileOAuth2TokenServiceDelegate::ExtractCredentials(
    OAuth2TokenService* to_service,
    const std::string& account_id) {
  static_cast<ProfileOAuth2TokenService*>(to_service)
      ->UpdateCredentials(account_id, GetRefreshToken(account_id),
                          signin_metrics::SourceForRefreshTokenOperation::
                              kTokenService_ExtractCredentials);
  RevokeCredentialsImpl(account_id, /*revoke_on_server=*/false);


Comment 2 by blundell@chromium.org, Jan 16 (6 days ago)

Hi Antonio,

Thanks!

The challenge with that approach is that we don't expose anything like GetRefreshToken() (and don't want to I think), and we also don't expose publicly the ability to remove a refresh token without revoking the token on the server (and similarly I don't think that we want to).

Comment 3 by toniki...@chromium.org, Yesterday (35 hours ago)

Blocking: 890811
Project Member

Comment 4 by bugdroid1@chromium.org, Today (15 hours ago)

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b9f5c2e50ce55433c7b160218de41924e1599802

commit b9f5c2e50ce55433c7b160218de41924e1599802
Author: Antonio Gomes <tonikitoo@igalia.com>
Date: Tue Jan 22 15:09:32 2019

Implement AccountsMutator::MoveAccount() method to replace PO2TS::ExtractCredentials()

This method implements the AccountsMutator::MoveAccount API as a wrapper to the
existing PO2TS::ExtractCredentials API.

Note that the implementation body also calls AccountTrackerService::SeedAccountInfo,
saving the caller site to do so (an example of its usage can be seen in [1]).

[1] https://crrev.com/c/1426457

BUG= 922482 

Change-Id: I63ef547dab7813a8dec99ec071a65d461ab6912d
Reviewed-on: https://chromium-review.googlesource.com/c/1425663
Commit-Queue: Antonio Gomes <tonikitoo@igalia.com>
Reviewed-by: Mihai Sardarescu <msarda@chromium.org>
Cr-Commit-Position: refs/heads/master@{#624780}
[modify] https://crrev.com/b9f5c2e50ce55433c7b160218de41924e1599802/services/identity/public/cpp/BUILD.gn
[modify] https://crrev.com/b9f5c2e50ce55433c7b160218de41924e1599802/services/identity/public/cpp/DEPS
[modify] https://crrev.com/b9f5c2e50ce55433c7b160218de41924e1599802/services/identity/public/cpp/accounts_mutator.h
[modify] https://crrev.com/b9f5c2e50ce55433c7b160218de41924e1599802/services/identity/public/cpp/accounts_mutator_impl.cc
[modify] https://crrev.com/b9f5c2e50ce55433c7b160218de41924e1599802/services/identity/public/cpp/accounts_mutator_impl.h
[modify] https://crrev.com/b9f5c2e50ce55433c7b160218de41924e1599802/services/identity/public/cpp/accounts_mutator_unittest.cc

Comment 5 by toniki...@chromium.org, Today (14 hours ago)

Status: Fixed (was: Started)

Sign in to add a comment