autofill_specifics.proto 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436
  1. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. //
  5. // Sync protocol datatype extension for autofill.
  6. // If you change or add any fields in this file, update proto_visitors.h and
  7. // potentially proto_enum_conversions.{h, cc}.
  8. syntax = "proto2";
  9. option java_multiple_files = true;
  10. option java_package = "org.chromium.components.sync.protocol";
  11. option optimize_for = LITE_RUNTIME;
  12. package sync_pb;
  13. // Properties of autofill sync objects.
  14. // An AutofillProfile.
  15. message AutofillProfileSpecifics {
  16. // Represents the validation status of value stored in the AutofillProfile.
  17. enum VerificationStatus {
  18. // No verification status assigned.
  19. VERIFICATION_STATUS_UNSPECIFIED = 0;
  20. // The value token was parsed from a parent token.
  21. // For example, the first name was derived by splitting a full name into
  22. // its components.
  23. PARSED = 1;
  24. // Value was built from its subcomponents.
  25. // For example, the full name was built from the first, middle and last
  26. // name.
  27. FORMATTED = 2;
  28. // The value was observed in a form transmission.
  29. // For example, the user filled a form that contained at NAME_FULL field.
  30. // The value of NAME_FULL will be stored as OBSERVED.
  31. OBSERVED = 3;
  32. // The user used the autofill settings to verify and store this token.
  33. // This is currently only applicable to the full name, since users cannot
  34. // edit individual components of their name.
  35. USER_VERIFIED = 4;
  36. // The token was parsed remotely.
  37. SERVER_PARSED = 5;
  38. }
  39. optional string guid = 15;
  40. optional string origin = 16;
  41. optional int64 use_count = 22;
  42. // The time_t value of the last time this profile was used. This
  43. // value makes sense wrt base::Time::To/FromTimeT, which measures
  44. // from the Windows epoch.
  45. optional int64 use_date = 23;
  46. // A user chosen profile label that is used to identify the profile.
  47. // The value of the label can be freely chosen by the user. Two possible label
  48. // values are '$HOME$' or '$WORK$' which have a special meaning.
  49. optional string profile_label = 62;
  50. // Contact info name fields.
  51. repeated string name_honorific = 26;
  52. repeated string name_first = 2;
  53. repeated string name_middle = 3;
  54. repeated string name_last = 4;
  55. // Sometimes the last name is composed of two names as it is common for
  56. // Hispanic/Latinx names. In the unstructured representation of the last name,
  57. // there may be even a conjunction between the first and the second last
  58. // name. For example, the more-complete version of Pablo Picasso's surname is
  59. // "Ruiz y Picasso" containing a first last name, a conjunction (the y) and a
  60. // second last name.
  61. repeated string name_last_first = 27;
  62. repeated string name_last_conjunction = 28;
  63. repeated string name_last_second = 29;
  64. repeated string name_full = 21;
  65. // This value contains the combination of the full name and the honorific
  66. // prefix.
  67. repeated string name_full_with_honorific = 60;
  68. // Validation status records for name fields.
  69. repeated VerificationStatus name_honorific_status = 30;
  70. repeated VerificationStatus name_first_status = 31;
  71. repeated VerificationStatus name_middle_status = 32;
  72. repeated VerificationStatus name_last_status = 33;
  73. repeated VerificationStatus name_last_first_status = 34;
  74. repeated VerificationStatus name_last_conjunction_status = 35;
  75. repeated VerificationStatus name_last_second_status = 36;
  76. repeated VerificationStatus name_full_status = 37;
  77. repeated VerificationStatus name_full_with_honorific_status = 61;
  78. // Contact info additional fields.
  79. repeated string email_address = 5;
  80. optional string company_name = 6;
  81. // Address field.
  82. // The address_home_line1/2 fields are deprecated and
  83. // address_home_street_address should be used instead by
  84. // joining address_home_line1/2 with a newline ("\n").
  85. // Full deprecation can not be achieved before all sync profiles have been
  86. // updated with a M86+ client.
  87. // TODO(crbug/1111740): Remove usages of address_home_line1/2 and mark field
  88. // as deprecated.
  89. optional string address_home_line1 = 7;
  90. optional string address_home_line2 = 8;
  91. optional string address_home_city = 9;
  92. optional string address_home_state = 10;
  93. optional string address_home_zip = 11;
  94. optional string address_home_country = 12;
  95. // Additional address fields for i18n.
  96. optional string address_home_street_address = 17;
  97. optional string address_home_sorting_code = 18;
  98. optional string address_home_dependent_locality = 19;
  99. optional string address_home_language_code = 20;
  100. optional string address_home_thoroughfare_name = 38;
  101. optional string address_home_thoroughfare_number = 39;
  102. optional string address_home_dependent_thoroughfare_name = 40;
  103. optional string address_home_premise_name = 41;
  104. optional string address_home_subpremise_name = 42;
  105. optional string address_home_apt_num = 56;
  106. optional string address_home_floor = 57;
  107. // Validation status records for address fields.
  108. optional VerificationStatus address_home_city_status = 43;
  109. optional VerificationStatus address_home_state_status = 44;
  110. optional VerificationStatus address_home_zip_status = 45;
  111. optional VerificationStatus address_home_country_status = 46;
  112. optional VerificationStatus address_home_street_address_status = 47;
  113. optional VerificationStatus address_home_sorting_code_status = 48;
  114. optional VerificationStatus address_home_dependent_locality_status = 49;
  115. optional VerificationStatus address_home_language_code_status = 50;
  116. optional VerificationStatus address_home_thoroughfare_name_status = 51;
  117. optional VerificationStatus address_home_thoroughfare_number_status = 52;
  118. optional VerificationStatus address_home_dependent_thoroughfare_name_status =
  119. 53;
  120. optional VerificationStatus address_home_premise_name_status = 54;
  121. optional VerificationStatus address_home_subpremise_name_status = 55;
  122. optional VerificationStatus address_home_apt_num_status = 58;
  123. optional VerificationStatus address_home_floor_status = 59;
  124. // Phone.
  125. repeated string phone_home_whole_number = 13;
  126. // The state indicates if the profile qualifies to get merged with a
  127. // profile observed in a form submission. If true, the profile can still be
  128. // updated silently, but it should not be considered for merges that need to
  129. // involve user interactions.
  130. optional bool disallow_settings_visible_updates = 63;
  131. // Birthdate fields.
  132. optional int32 birthdate_day = 64;
  133. optional int32 birthdate_month = 65;
  134. optional int32 birthdate_year = 66; // 4 digits.
  135. // Deprecated.
  136. optional string deprecated_label = 1 [deprecated = true];
  137. optional string phone_fax_whole_number = 14 [deprecated = true];
  138. // The following validity-related fields have only been used in combination
  139. // with an experimental features that are disabled for all clients and have
  140. // been removed in M100.
  141. optional int64 validity_state_bitfield = 24 [deprecated = true];
  142. optional bool is_client_validity_states_updated = 25 [deprecated = true];
  143. }
  144. message AutofillSpecifics {
  145. // If any of these 3 fields are present, then all 3 should be, and it implies
  146. // that this entity represents a classic autofill object. In this case,
  147. // none of the autofill++ objects below should be present.
  148. optional string name = 1;
  149. optional string value = 2;
  150. repeated int64 usage_timestamp = 3;
  151. // An autofill++ profile object. If present, indicates this entity
  152. // represents an AutofillProfile exclusively, and no other fields (such as
  153. // name/value or credit_card) should be present.
  154. optional AutofillProfileSpecifics profile = 4;
  155. // Obsolete credit card fields.
  156. // optional bytes deprecated_encrypted_credit_card = 5;
  157. // optional AutofillCreditCardSpecifics deprecated_credit_card = 6;
  158. }
  159. // TODO(crbug.com/1020740): Deprecated, remove this once dependent change is
  160. // done. Use WalletCreditCardCloudTokenData instead.
  161. message CloudTokenData {
  162. // Last 4-5 digits of the Cloud Primary Account Number (CPAN).
  163. optional string suffix = 1;
  164. // CPAN Month number 1-12.
  165. optional int32 exp_month = 2;
  166. // CPAN Four-digit year (e.g. 2017).
  167. optional int32 exp_year = 3;
  168. // URL of the card art to be displayed for CPAN.
  169. optional string art_fife_url = 4;
  170. // Opaque identifier for the cloud token associated with the payment
  171. // instrument.
  172. optional string instrument_token = 5;
  173. }
  174. message CardIssuer {
  175. enum Issuer {
  176. ISSUER_UNKNOWN = 0;
  177. // Card where the issuer is Google.
  178. GOOGLE = 1;
  179. }
  180. optional Issuer issuer = 1;
  181. }
  182. message WalletMaskedCreditCard {
  183. reserved 9, 14;
  184. reserved "card_class";
  185. enum WalletCardStatus {
  186. VALID = 0;
  187. EXPIRED = 1;
  188. }
  189. enum WalletCardType {
  190. UNKNOWN = 0;
  191. AMEX = 1;
  192. DISCOVER = 2;
  193. JCB = 3;
  194. MAESTRO = 4;
  195. MASTER_CARD = 5;
  196. SOLO = 6;
  197. SWITCH = 7;
  198. VISA = 8;
  199. UNIONPAY = 9;
  200. ELO = 10;
  201. }
  202. enum VirtualCardEnrollmentState {
  203. UNSPECIFIED = 0;
  204. UNENROLLED = 1 [deprecated = true];
  205. ENROLLED = 2;
  206. UNENROLLED_AND_NOT_ELIGIBLE = 3;
  207. UNENROLLED_AND_ELIGIBLE = 4;
  208. }
  209. // Server-generated unique ID string. This is opaque to the client.
  210. // This is the legacy version of |instrument_id|.
  211. optional string id = 1;
  212. // What the server thinks of this card.
  213. optional WalletCardStatus status = 2;
  214. optional string name_on_card = 3;
  215. optional WalletCardType type = 4;
  216. // Last 4 digits of the credit card number.
  217. optional string last_four = 5;
  218. // Month number 1-12.
  219. optional int32 exp_month = 6;
  220. // Four-digit year (e.g. 2017).
  221. optional int32 exp_year = 7;
  222. // The WalletPostalAddress.id of the billing address.
  223. optional string billing_address_id = 8;
  224. // Issuing Bank name which is internationalized (e.g. "Chase", "工商银行")
  225. optional string bank_name = 10;
  226. // TODO(crbug.com/1020740): Deprecated, remove this once dependent change is
  227. // done.
  228. // Use WalletCreditCardCloudTokenData instead. This field will be set if
  229. // a cloud token is available for the instrument.
  230. optional CloudTokenData cloud_token_data = 11;
  231. // The card's nickname, if it exists.
  232. optional string nickname = 12;
  233. // Issuer of the card.
  234. optional CardIssuer card_issuer = 13;
  235. // Server-generated unique ID. This is opaque to the client.
  236. // |id| is the legacy version of this.
  237. optional int64 instrument_id = 15;
  238. // The state of virtual card enrollment.
  239. optional VirtualCardEnrollmentState virtual_card_enrollment_state = 16;
  240. // The URL for the client to fetche the card art image.
  241. optional string card_art_url = 17;
  242. // The product description for the card. Used to be shown in the UI.
  243. optional string product_description = 18;
  244. }
  245. // Different than an AutofillProfile because this represents some known address
  246. // on the server that is pulled down rather than synced between Chromes.
  247. message WalletPostalAddress {
  248. optional string id = 1;
  249. optional string recipient_name = 12;
  250. optional string company_name = 2;
  251. // This is the street address, of which there may be multiple lines. This
  252. // corresponds to "address_home_line[1|2] in the AutofillProfileSpecifics
  253. // message above. In some locales there may be more than two lines.
  254. repeated string street_address = 3;
  255. // Also known as "administrative area". This is normally the state or
  256. // province in most countries.
  257. optional string address_1 = 4;
  258. // Also known as "locality". In the US this is the city.
  259. optional string address_2 = 5;
  260. // A sub-classification beneath the city, e.g. an inner-city district or
  261. // suburb. Also known as "dependent_locality"
  262. optional string address_3 = 6;
  263. // Used in certain countries. Also known as "sub_dependent_locality".
  264. optional string address_4 = 7;
  265. optional string postal_code = 8;
  266. // Similar to the zipcode column, but used for businesses or organizations
  267. // that might not be geographically contiguous. The canonical example is
  268. // CEDEX in France.
  269. optional string sorting_code = 9;
  270. optional string country_code = 10;
  271. optional string language_code = 11;
  272. // Phone number. The format is unspecified and will be explicitly ignored.
  273. optional string phone_number = 13;
  274. }
  275. // Contains information about a Payments Customer.
  276. message PaymentsCustomerData {
  277. // The billable customer ID associated with the account.
  278. optional string id = 1;
  279. }
  280. // Contains information about the cloud token data of server credit cards.
  281. message WalletCreditCardCloudTokenData {
  282. // Server-generated ID string for the card this cloud token data is related
  283. // to. This should match the id in WalletMaskedCreditCard for to fetch the
  284. // corresponding actual card data. Note this is not unique across all cloud
  285. // token data, which means one card can have multiple sets of cloud token data
  286. // with the same masked_card_id.
  287. optional string masked_card_id = 1;
  288. // Last 4-5 digits of the Cloud Primary Account Number (CPAN).
  289. optional string suffix = 2;
  290. // CPAN Month number 1-12.
  291. optional int32 exp_month = 3;
  292. // CPAN Four-digit year (e.g. 2017).
  293. optional int32 exp_year = 4;
  294. // URL of the card art to be displayed for CPAN.
  295. optional string art_fife_url = 5;
  296. // Opaque identifier for the cloud token.
  297. optional string instrument_token = 6;
  298. }
  299. message AutofillWalletSpecifics {
  300. enum WalletInfoType {
  301. UNKNOWN = 0;
  302. MASKED_CREDIT_CARD = 1;
  303. POSTAL_ADDRESS = 2;
  304. CUSTOMER_DATA = 3;
  305. CREDIT_CARD_CLOUD_TOKEN_DATA = 4;
  306. }
  307. optional WalletInfoType type = 1;
  308. // This field exists if and only if the "type" field equals to
  309. // MASKED_CREDIT_CARD.
  310. optional WalletMaskedCreditCard masked_card = 2;
  311. // This field exists if and only if the "type" field equals to ADDRESS.
  312. optional WalletPostalAddress address = 3;
  313. // This field exists if and only if the "type" field equals to CUSTOMER_DATA.
  314. optional PaymentsCustomerData customer_data = 4;
  315. // This field exists if and only if the "type" field equals to
  316. // CREDIT_CARD_CLOUD_TOKEN_DATA.
  317. optional WalletCreditCardCloudTokenData cloud_token_data = 5;
  318. }
  319. // Wallet card and address usage information that can be synced.
  320. message WalletMetadataSpecifics {
  321. enum Type {
  322. UNKNOWN = 0;
  323. CARD = 1;
  324. ADDRESS = 2;
  325. }
  326. // The type of the Wallet metadata.
  327. optional Type type = 1;
  328. // Base64 encoding of the unique ID string of the corresponding Wallet data.
  329. // For Wallet cards, this value is server generated and opaque to Chrome.
  330. // For Wallet addresses, this is a SHA1 hash of the following fields:
  331. //
  332. // - First name
  333. // - Middle name
  334. // - Last name
  335. // - Company name
  336. // - Street address
  337. // - Dependent locality
  338. // - City
  339. // - State
  340. // - Zip code
  341. // - Sorting code
  342. // - Country
  343. // - Phone number
  344. // - Language code
  345. optional string id = 2;
  346. // The number of times that this Wallet card or address was used.
  347. optional int64 use_count = 3;
  348. // The last use date of this Wallet card or address. Measured in microseconds
  349. // since the Windows epoch (1601).
  350. optional int64 use_date = 4;
  351. // The id of the profile/address that represents the billing address of this
  352. // Wallet card.
  353. optional string card_billing_address_id = 5;
  354. // Whether this Wallet address has been converted to a local autofill profile.
  355. optional bool address_has_converted = 6;
  356. }