michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: [scriptable, uuid(c41b7dff-6b9b-42fe-b78d-113051facb05)] michael@0: michael@0: /** michael@0: * An object containing information for a login stored by the michael@0: * password manager. michael@0: */ michael@0: interface nsILoginInfo : nsISupports { michael@0: /** michael@0: * The hostname the login applies to. michael@0: * michael@0: * The hostname should be formatted as an URL. For example, michael@0: * "https://site.com", "http://site.com:1234", "ftp://ftp.site.com". michael@0: */ michael@0: attribute AString hostname; michael@0: michael@0: /** michael@0: * The URL a form-based login was submitted to. michael@0: * michael@0: * For logins obtained from HTML forms, this field is the |action| michael@0: * attribute from the |form| element, with the path removed. For michael@0: * example "http://www.site.com". [Forms with no |action| attribute michael@0: * default to submitting to their origin URL, so we store that.] michael@0: * michael@0: * For logins obtained from a HTTP or FTP protocol authentication, michael@0: * this field is NULL. michael@0: */ michael@0: attribute AString formSubmitURL; michael@0: michael@0: /** michael@0: * The HTTP Realm a login was requested for. michael@0: * michael@0: * When an HTTP server sends a 401 result, the WWW-Authenticate michael@0: * header includes a realm to identify the "protection space." See michael@0: * RFC2617. If the response sent has a missing or blank realm, the michael@0: * hostname is used instead. michael@0: * michael@0: * For logins obtained from HTML forms, this field is NULL. michael@0: */ michael@0: attribute AString httpRealm; michael@0: michael@0: /** michael@0: * The username for the login. michael@0: */ michael@0: attribute AString username; michael@0: michael@0: /** michael@0: * The |name| attribute for the username input field. michael@0: * michael@0: * For logins obtained from a HTTP or FTP protocol authentication, michael@0: * this field is an empty string. michael@0: */ michael@0: attribute AString usernameField; michael@0: michael@0: /** michael@0: * The password for the login. michael@0: */ michael@0: attribute AString password; michael@0: michael@0: /** michael@0: * The |name| attribute for the password input field. michael@0: * michael@0: * For logins obtained from a HTTP or FTP protocol authentication, michael@0: * this field is an empty string. michael@0: */ michael@0: attribute AString passwordField; michael@0: michael@0: /** michael@0: * Initialize a newly created nsLoginInfo object. michael@0: * michael@0: * The arguments are the fields for the new object. michael@0: */ michael@0: void init(in AString aHostname, michael@0: in AString aFormSubmitURL, in AString aHttpRealm, michael@0: in AString aUsername, in AString aPassword, michael@0: in AString aUsernameField, in AString aPasswordField); michael@0: michael@0: /** michael@0: * Test for strict equality with another nsILoginInfo object. michael@0: * michael@0: * @param aLoginInfo michael@0: * The other object to test. michael@0: */ michael@0: boolean equals(in nsILoginInfo aLoginInfo); michael@0: michael@0: /** michael@0: * Test for loose equivalency with another nsILoginInfo object. The michael@0: * passwordField and usernameField values are ignored, and the password michael@0: * values may be optionally ignored. If one login's formSubmitURL is an michael@0: * empty string (but not null), it will be treated as a wildcard. [The michael@0: * blank value indicates the login was stored before bug 360493 was fixed.] michael@0: * michael@0: * @param aLoginInfo michael@0: * The other object to test. michael@0: * @param ignorePassword michael@0: * If true, ignore the password when checking for match. michael@0: */ michael@0: boolean matches(in nsILoginInfo aLoginInfo, in boolean ignorePassword); michael@0: michael@0: /** michael@0: * Create an identical copy of the login, duplicating all of the login's michael@0: * nsILoginInfo and nsILoginMetaInfo properties. michael@0: * michael@0: * This allows code to be forwards-compatible, when additional properties michael@0: * are added to nsILoginMetaInfo (or nsILoginInfo) in the future. michael@0: */ michael@0: nsILoginInfo clone(); michael@0: }; michael@0: michael@0: %{C++ michael@0: michael@0: #define NS_LOGININFO_CONTRACTID "@mozilla.org/login-manager/loginInfo;1" michael@0: michael@0: %}