Source code

Revision control

Other Tools

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
/**
9
* An object containing information for a login stored by the
10
* password manager.
11
*/
12
[scriptable, uuid(c41b7dff-6b9b-42fe-b78d-113051facb05)]
13
interface nsILoginInfo : nsISupports {
14
/**
15
* A string to display to the user for the origin which includes the httpRealm,
16
* where applicable.
17
* e.g. "site.com", "site.com:1234", or "site.com (My Secure Realm)"
18
*/
19
readonly attribute AString displayOrigin;
20
21
/**
22
* The origin the login applies to.
23
*
24
* For example,
26
*/
27
attribute AString origin;
28
29
/**
30
* The origin the login applies to, incorrectly called a hostname.
31
* @deprecated in favor of `origin`
32
*/
33
attribute AString hostname;
34
35
/**
36
* The origin a form-based login was submitted to.
37
*
38
* For logins obtained from HTML forms, this field is the origin of the |action|
39
* attribute from the |form| element. For
40
* example "http://www.site.com". [Forms with no |action| attribute
41
* default to submitting to their origin URL, so we store that.]
42
*
43
* For logins obtained from a HTTP or FTP protocol authentication,
44
* this field is NULL.
45
*/
46
attribute AString formActionOrigin;
47
48
/**
49
* The origin a form-based login was submitted to, incorrectly referred to as a URL.
50
* @deprecated in favor of `formActionOrigin`
51
*/
52
attribute AString formSubmitURL;
53
54
/**
55
* The HTTP Realm a login was requested for.
56
*
57
* When an HTTP server sends a 401 result, the WWW-Authenticate
58
* header includes a realm to identify the "protection space." See
59
* RFC2617. If the response sent has a missing or blank realm, the
60
* hostname is used instead.
61
*
62
* For logins obtained from HTML forms, this field is NULL.
63
*/
64
attribute AString httpRealm;
65
66
/**
67
* The username for the login.
68
*/
69
attribute AString username;
70
71
/**
72
* The |name| attribute for the username input field.
73
*
74
* For logins obtained from a HTTP or FTP protocol authentication,
75
* this field is an empty string.
76
*
77
* @note This attribute is currently saved but not used.
78
*/
79
attribute AString usernameField;
80
81
/**
82
* The password for the login.
83
*/
84
attribute AString password;
85
86
/**
87
* The |name| attribute for the password input field.
88
*
89
* For logins obtained from a HTTP or FTP protocol authentication,
90
* this field is an empty string.
91
*
92
* @note This attribute is currently saved but not used.
93
*/
94
attribute AString passwordField;
95
96
/**
97
* Initialize a newly created nsLoginInfo object.
98
*
99
* The arguments are the fields for the new object.
100
*/
101
void init(in AString aOrigin,
102
in AString aFormActionOrigin, in AString aHttpRealm,
103
in AString aUsername, in AString aPassword,
104
[optional] in AString aUsernameField, [optional] in AString aPasswordField);
105
106
/**
107
* Test for strict equality with another nsILoginInfo object.
108
*
109
* @param aLoginInfo
110
* The other object to test.
111
*/
112
boolean equals(in nsILoginInfo aLoginInfo);
113
114
/**
115
* Test for loose equivalency with another nsILoginInfo object. The
116
* passwordField and usernameField values are ignored, and the password
117
* values may be optionally ignored. If one login's formSubmitURL is an
118
* empty string (but not null), it will be treated as a wildcard. [The
119
* blank value indicates the login was stored before bug 360493 was fixed.]
120
*
121
* @param aLoginInfo
122
* The other object to test.
123
* @param ignorePassword
124
* If true, ignore the password when checking for match.
125
*/
126
boolean matches(in nsILoginInfo aLoginInfo, in boolean ignorePassword);
127
128
/**
129
* Create an identical copy of the login, duplicating all of the login's
130
* nsILoginInfo and nsILoginMetaInfo properties.
131
*
132
* This allows code to be forwards-compatible, when additional properties
133
* are added to nsILoginMetaInfo (or nsILoginInfo) in the future.
134
*/
135
nsILoginInfo clone();
136
};
137
138
%{C++
139
140
#define NS_LOGININFO_CONTRACTID "@mozilla.org/login-manager/loginInfo;1"
141
142
%}