toolkit/components/passwordmgr/nsILoginInfo.idl

branch
TOR_BUG_9701
changeset 15
b8a032363ba2
equal deleted inserted replaced
-1:000000000000 0:fcbdd569fc66
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5
6 #include "nsISupports.idl"
7
8 [scriptable, uuid(c41b7dff-6b9b-42fe-b78d-113051facb05)]
9
10 /**
11 * An object containing information for a login stored by the
12 * password manager.
13 */
14 interface nsILoginInfo : nsISupports {
15 /**
16 * The hostname the login applies to.
17 *
18 * The hostname should be formatted as an URL. For example,
19 * "https://site.com", "http://site.com:1234", "ftp://ftp.site.com".
20 */
21 attribute AString hostname;
22
23 /**
24 * The URL a form-based login was submitted to.
25 *
26 * For logins obtained from HTML forms, this field is the |action|
27 * attribute from the |form| element, with the path removed. For
28 * example "http://www.site.com". [Forms with no |action| attribute
29 * default to submitting to their origin URL, so we store that.]
30 *
31 * For logins obtained from a HTTP or FTP protocol authentication,
32 * this field is NULL.
33 */
34 attribute AString formSubmitURL;
35
36 /**
37 * The HTTP Realm a login was requested for.
38 *
39 * When an HTTP server sends a 401 result, the WWW-Authenticate
40 * header includes a realm to identify the "protection space." See
41 * RFC2617. If the response sent has a missing or blank realm, the
42 * hostname is used instead.
43 *
44 * For logins obtained from HTML forms, this field is NULL.
45 */
46 attribute AString httpRealm;
47
48 /**
49 * The username for the login.
50 */
51 attribute AString username;
52
53 /**
54 * The |name| attribute for the username input field.
55 *
56 * For logins obtained from a HTTP or FTP protocol authentication,
57 * this field is an empty string.
58 */
59 attribute AString usernameField;
60
61 /**
62 * The password for the login.
63 */
64 attribute AString password;
65
66 /**
67 * The |name| attribute for the password input field.
68 *
69 * For logins obtained from a HTTP or FTP protocol authentication,
70 * this field is an empty string.
71 */
72 attribute AString passwordField;
73
74 /**
75 * Initialize a newly created nsLoginInfo object.
76 *
77 * The arguments are the fields for the new object.
78 */
79 void init(in AString aHostname,
80 in AString aFormSubmitURL, in AString aHttpRealm,
81 in AString aUsername, in AString aPassword,
82 in AString aUsernameField, in AString aPasswordField);
83
84 /**
85 * Test for strict equality with another nsILoginInfo object.
86 *
87 * @param aLoginInfo
88 * The other object to test.
89 */
90 boolean equals(in nsILoginInfo aLoginInfo);
91
92 /**
93 * Test for loose equivalency with another nsILoginInfo object. The
94 * passwordField and usernameField values are ignored, and the password
95 * values may be optionally ignored. If one login's formSubmitURL is an
96 * empty string (but not null), it will be treated as a wildcard. [The
97 * blank value indicates the login was stored before bug 360493 was fixed.]
98 *
99 * @param aLoginInfo
100 * The other object to test.
101 * @param ignorePassword
102 * If true, ignore the password when checking for match.
103 */
104 boolean matches(in nsILoginInfo aLoginInfo, in boolean ignorePassword);
105
106 /**
107 * Create an identical copy of the login, duplicating all of the login's
108 * nsILoginInfo and nsILoginMetaInfo properties.
109 *
110 * This allows code to be forwards-compatible, when additional properties
111 * are added to nsILoginMetaInfo (or nsILoginInfo) in the future.
112 */
113 nsILoginInfo clone();
114 };
115
116 %{C++
117
118 #define NS_LOGININFO_CONTRACTID "@mozilla.org/login-manager/loginInfo;1"
119
120 %}

mercurial