1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/toolkit/components/passwordmgr/nsILoginInfo.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,120 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 + 1.9 +#include "nsISupports.idl" 1.10 + 1.11 +[scriptable, uuid(c41b7dff-6b9b-42fe-b78d-113051facb05)] 1.12 + 1.13 +/** 1.14 + * An object containing information for a login stored by the 1.15 + * password manager. 1.16 + */ 1.17 +interface nsILoginInfo : nsISupports { 1.18 + /** 1.19 + * The hostname the login applies to. 1.20 + * 1.21 + * The hostname should be formatted as an URL. For example, 1.22 + * "https://site.com", "http://site.com:1234", "ftp://ftp.site.com". 1.23 + */ 1.24 + attribute AString hostname; 1.25 + 1.26 + /** 1.27 + * The URL a form-based login was submitted to. 1.28 + * 1.29 + * For logins obtained from HTML forms, this field is the |action| 1.30 + * attribute from the |form| element, with the path removed. For 1.31 + * example "http://www.site.com". [Forms with no |action| attribute 1.32 + * default to submitting to their origin URL, so we store that.] 1.33 + * 1.34 + * For logins obtained from a HTTP or FTP protocol authentication, 1.35 + * this field is NULL. 1.36 + */ 1.37 + attribute AString formSubmitURL; 1.38 + 1.39 + /** 1.40 + * The HTTP Realm a login was requested for. 1.41 + * 1.42 + * When an HTTP server sends a 401 result, the WWW-Authenticate 1.43 + * header includes a realm to identify the "protection space." See 1.44 + * RFC2617. If the response sent has a missing or blank realm, the 1.45 + * hostname is used instead. 1.46 + * 1.47 + * For logins obtained from HTML forms, this field is NULL. 1.48 + */ 1.49 + attribute AString httpRealm; 1.50 + 1.51 + /** 1.52 + * The username for the login. 1.53 + */ 1.54 + attribute AString username; 1.55 + 1.56 + /** 1.57 + * The |name| attribute for the username input field. 1.58 + * 1.59 + * For logins obtained from a HTTP or FTP protocol authentication, 1.60 + * this field is an empty string. 1.61 + */ 1.62 + attribute AString usernameField; 1.63 + 1.64 + /** 1.65 + * The password for the login. 1.66 + */ 1.67 + attribute AString password; 1.68 + 1.69 + /** 1.70 + * The |name| attribute for the password input field. 1.71 + * 1.72 + * For logins obtained from a HTTP or FTP protocol authentication, 1.73 + * this field is an empty string. 1.74 + */ 1.75 + attribute AString passwordField; 1.76 + 1.77 + /** 1.78 + * Initialize a newly created nsLoginInfo object. 1.79 + * 1.80 + * The arguments are the fields for the new object. 1.81 + */ 1.82 + void init(in AString aHostname, 1.83 + in AString aFormSubmitURL, in AString aHttpRealm, 1.84 + in AString aUsername, in AString aPassword, 1.85 + in AString aUsernameField, in AString aPasswordField); 1.86 + 1.87 + /** 1.88 + * Test for strict equality with another nsILoginInfo object. 1.89 + * 1.90 + * @param aLoginInfo 1.91 + * The other object to test. 1.92 + */ 1.93 + boolean equals(in nsILoginInfo aLoginInfo); 1.94 + 1.95 + /** 1.96 + * Test for loose equivalency with another nsILoginInfo object. The 1.97 + * passwordField and usernameField values are ignored, and the password 1.98 + * values may be optionally ignored. If one login's formSubmitURL is an 1.99 + * empty string (but not null), it will be treated as a wildcard. [The 1.100 + * blank value indicates the login was stored before bug 360493 was fixed.] 1.101 + * 1.102 + * @param aLoginInfo 1.103 + * The other object to test. 1.104 + * @param ignorePassword 1.105 + * If true, ignore the password when checking for match. 1.106 + */ 1.107 + boolean matches(in nsILoginInfo aLoginInfo, in boolean ignorePassword); 1.108 + 1.109 + /** 1.110 + * Create an identical copy of the login, duplicating all of the login's 1.111 + * nsILoginInfo and nsILoginMetaInfo properties. 1.112 + * 1.113 + * This allows code to be forwards-compatible, when additional properties 1.114 + * are added to nsILoginMetaInfo (or nsILoginInfo) in the future. 1.115 + */ 1.116 + nsILoginInfo clone(); 1.117 +}; 1.118 + 1.119 +%{C++ 1.120 + 1.121 +#define NS_LOGININFO_CONTRACTID "@mozilla.org/login-manager/loginInfo;1" 1.122 + 1.123 +%}