Commit 7655c192 authored by Mikel Astiz's avatar Mikel Astiz Committed by Commit Bot

Expose password blacklisted bit unencrypted via sync

This allows implementing web pages (server-side) that list user
password URLs, even if the password itself is not decryptable. The
blacklisted bit is needed because blacklisted passwords should not
be displayed together with regular ones.

Change-Id: I21ae248804dd7b43c7fda695dae7327fa30be054
Bug: 1053895
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2087211
Commit-Queue: Mikel Astiz <mastiz@chromium.org>
Reviewed-by: default avatarMarc Treib <treib@chromium.org>
Reviewed-by: default avatarMohamed Amir Yosef <mamir@chromium.org>
Cr-Commit-Position: refs/heads/master@{#746734}
parent b7f72b9b
...@@ -274,6 +274,9 @@ void NonBlockingTypeCommitContribution::AdjustCommitProto( ...@@ -274,6 +274,9 @@ void NonBlockingTypeCommitContribution::AdjustCommitProto(
encrypted_password.mutable_password() encrypted_password.mutable_password()
->mutable_unencrypted_metadata() ->mutable_unencrypted_metadata()
->set_url(password_data.signon_realm()); ->set_url(password_data.signon_realm());
encrypted_password.mutable_password()
->mutable_unencrypted_metadata()
->set_blacklisted(password_data.blacklisted());
} }
bool result = cryptographer_->Encrypt( bool result = cryptographer_->Encrypt(
......
...@@ -198,6 +198,10 @@ TEST(NonBlockingTypeCommitContributionTest, ...@@ -198,6 +198,10 @@ TEST(NonBlockingTypeCommitContributionTest,
EXPECT_TRUE(entity.specifics().has_password()); EXPECT_TRUE(entity.specifics().has_password());
EXPECT_EQ(kSignonRealm, EXPECT_EQ(kSignonRealm,
entity.specifics().password().unencrypted_metadata().url()); entity.specifics().password().unencrypted_metadata().url());
EXPECT_TRUE(
entity.specifics().password().unencrypted_metadata().has_blacklisted());
EXPECT_FALSE(
entity.specifics().password().unencrypted_metadata().blacklisted());
EXPECT_FALSE(entity.specifics().password().encrypted().blob().empty()); EXPECT_FALSE(entity.specifics().password().encrypted().blob().empty());
EXPECT_TRUE(entity.parent_id_string().empty()); EXPECT_TRUE(entity.parent_id_string().empty());
EXPECT_FALSE(entity.unique_position().has_custom_compressed_v1()); EXPECT_FALSE(entity.unique_position().has_custom_compressed_v1());
......
...@@ -119,6 +119,10 @@ message PasswordSpecificsData { ...@@ -119,6 +119,10 @@ message PasswordSpecificsData {
// Contains the password specifics metadata which simplifies its lookup. // Contains the password specifics metadata which simplifies its lookup.
message PasswordSpecificsMetadata { message PasswordSpecificsMetadata {
optional string url = 1; optional string url = 1;
// True, if user chose permanently not to save the credentials for the form.
// Introduced in M82.
optional bool blacklisted = 2;
} }
// Properties of password sync objects. // Properties of password sync objects.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment