summaryrefslogtreecommitdiffstats
path: root/sync/protocol/password_specifics.proto
blob: 201fb3fec415348606f604817b63782ae21fc18d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
// 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.
//
// Sync unique tag is calculated as
// EscapePath(origin) + "|" +
// EscapePath(username_element) + "|" +
// EscapePath(username_value) + "|" +
// EscapePath(password_element) + "|" +
// EscapePath(signon_realm)
// where '+' is the string concatenation operation. EscapePath escapes a partial
// or complete file/pathname. This includes non-printable, non-7bit, and
// (including space) the following characters ' "#%:<>?[\]^`{|}'. The space
// character is encoded as '%20'.

// All the strings are encoded with UTF-8. URLs are encoded in Punycode.
message PasswordSpecificsData {
  // SCHEME_HTML(0), the credential represents either a parsed HTML form, or an
  // android credential or a password saved through Credential Manager API
  // (https://w3c.github.io/webappsec/specs/credentialmanagement/).
  // SCHEME_BASIC(1), basic access http authentication.
  // SCHEME_DIGEST(2), digest access authentication.
  // SCHEME_OTHER(3), another access authentication.
  optional int32 scheme = 1;

  // For parsed web forms and normal passwords saved through Credential Manager
  // API: url-scheme://url-host[:url-port]/
  // For Android apps (local + federated):
  //     "android://<hash of cert>@<package name>"
  // where the hash is base64 encoded SHA512 of the app's public certificate.
  // For federated credentials:
  //     "federation://" + origin_host + "/" + federation_host
  // For proxy auth: proxy-host/auth-realm
  // For HTTP auth: url-scheme://url-host[:url-port]/auth-realm
  optional string signon_realm = 2;

  // For parsed web forms and Credential Manager API:
  //     url-scheme://url-host[:url-port]/path
  // For Android: "android://<hash of cert>@<package name>"
  // For proxy/HTTP auth: url-scheme://url-host[:url-port]/path
  optional string origin = 3;

  // Only for web-parsed forms - the action target of the form:
  //     url-scheme://url-host[:url-port]/path
  optional string action = 4;

  // Only for web-parsed forms - the name of the element containing username.
  optional string username_element = 5;

  // For all: the username.
  // For blacklisted forms: <empty>.
  optional string username_value = 6;

  // Only for web-parsed forms - the name of the element containing password.
  optional string password_element = 7;

  // For all: the password.
  // For federated logins and blacklisted forms: <empty>
  optional string password_value = 8;

  // True if the credential was saved for a HTTPS session with a valid SSL cert.
  // Ignored for Android apps.
  // Note: likely getting deprecated: http://crbug.com/413020
  optional bool ssl_valid = 9;

  // True for the last credential used for logging in on a given site.
  optional bool preferred = 10;

  // Time when the credential was created. Amount of microseconds since 1601.
  optional int64 date_created = 11;

  // True, if user chose permanently not to save the credentials for the form.
  optional bool blacklisted = 12;

  // TYPE_MANUAL(0), user manually filled the username and the password.
  // TYPE_GENERATED(1), the credential was auto generated.
  optional int32 type = 13;

  // Number of times this login was used for logging in. Chrome uses this field
  // to distinguish log-in and sign-up forms.
  optional int32 times_used = 14;

  // A human readable name of the account holder. Set by CredentialManager API
  // and Android.
  optional string display_name = 15;

  // A URL of the avatar for the credential. Set by CredentialManager API and
  // Android.
  optional string avatar_url = 16;

  // A URL of the IdP used to verify the credential. Set by Credential Manager
  // API and Android.
  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;
}