// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Sync protocol datatype extension for password data.

// Update proto_value_conversions{.h,.cc,_unittest.cc} if you change
// any fields in this file.

syntax = "proto2";

option optimize_for = LITE_RUNTIME;
option retain_unknown_fields = true;

package sync_pb;

import "encryption.proto";

// These are the properties that get serialized into the |encrypted| field of
// PasswordSpecifics. They correspond to fields in autofill::PasswordForm. See
// components/autofill/core/common/password_form.h for more details.
message PasswordSpecificsData {
  optional int32 scheme = 1;
  optional string signon_realm = 2;
  optional string origin = 3;
  optional string action = 4;
  optional string username_element = 5;
  optional string username_value = 6;
  optional string password_element = 7;
  optional string password_value = 8;
  optional bool ssl_valid = 9;
  optional bool preferred = 10;
  optional int64 date_created = 11;
  optional bool blacklisted = 12;
  optional int32 type = 13;
  optional int32 times_used = 14;
  optional string display_name = 15;
  optional string avatar_url = 16;
  optional string federation_url = 17;
}

// Properties of password sync objects.
message PasswordSpecifics {
  // The actual password data. Contains an encrypted PasswordSpecificsData
  // message.
  optional EncryptedData encrypted = 1;
  // An unsynced field for use internally on the client. This field should
  // never be set in any network-based communications.
  optional PasswordSpecificsData client_only_encrypted_data = 2;
}