2007-05-16 03:02:45 -07:00
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
|
|
|
*
|
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is Mozilla Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 2007
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
* Justin Dolske <dolske@mozilla.com> (original author)
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
|
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
|
|
|
|
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
2008-01-14 18:50:46 -08:00
|
|
|
[scriptable, uuid(9c87a9bd-bf8b-4fae-bdb8-70513b2877df)]
|
2007-05-16 03:02:45 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* An object containing information for a login stored by the
|
|
|
|
* password manager.
|
|
|
|
*/
|
|
|
|
interface nsILoginInfo : nsISupports {
|
|
|
|
/**
|
|
|
|
* The hostname the login applies to.
|
|
|
|
*
|
2007-12-12 14:42:01 -08:00
|
|
|
* The hostname should be formatted as an URL. For example,
|
|
|
|
* "https://site.com", "http://site.com:1234", "ftp://ftp.site.com".
|
2007-05-16 03:02:45 -07:00
|
|
|
*/
|
|
|
|
attribute AString hostname;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The URL a form-based login was submitted to.
|
|
|
|
*
|
|
|
|
* For logins obtained from HTML forms, this field is the |action|
|
|
|
|
* attribute from the |form| element, with the path removed. For
|
|
|
|
* example "http://www.site.com". [Forms with no |action| attribute
|
|
|
|
* default to submitting to their origin URL, so we store that.]
|
|
|
|
*
|
|
|
|
* For logins obtained from a HTTP or FTP protocol authentication,
|
|
|
|
* this field is NULL.
|
|
|
|
*/
|
|
|
|
attribute AString formSubmitURL;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The HTTP Realm a login was requested for.
|
|
|
|
*
|
|
|
|
* When an HTTP server sends a 401 result, the WWW-Authenticate
|
|
|
|
* header includes a realm to identify the "protection space." See
|
2007-12-12 14:42:01 -08:00
|
|
|
* RFC2617. If the response sent has a missing or blank realm, the
|
|
|
|
* hostname is used instead.
|
2007-05-16 03:02:45 -07:00
|
|
|
*
|
|
|
|
* For logins obtained from HTML forms, this field is NULL.
|
|
|
|
*/
|
|
|
|
attribute AString httpRealm;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The username for the login.
|
|
|
|
*/
|
|
|
|
attribute AString username;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The |name| attribute for the username input field.
|
|
|
|
*
|
|
|
|
* For logins obtained from a HTTP or FTP protocol authentication,
|
2008-09-02 00:35:19 -07:00
|
|
|
* this field is an empty string.
|
2007-05-16 03:02:45 -07:00
|
|
|
*/
|
|
|
|
attribute AString usernameField;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The password for the login.
|
|
|
|
*/
|
|
|
|
attribute AString password;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The |name| attribute for the password input field.
|
|
|
|
*
|
|
|
|
* For logins obtained from a HTTP or FTP protocol authentication,
|
2008-09-02 00:35:19 -07:00
|
|
|
* this field is an empty string.
|
2007-05-16 03:02:45 -07:00
|
|
|
*/
|
|
|
|
attribute AString passwordField;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Initialize a newly created nsLoginInfo object.
|
|
|
|
*
|
|
|
|
* The arguments are the fields for the new object.
|
|
|
|
*/
|
|
|
|
void init(in AString aHostname,
|
|
|
|
in AString aFormSubmitURL, in AString aHttpRealm,
|
|
|
|
in AString aUsername, in AString aPassword,
|
|
|
|
in AString aUsernameField, in AString aPasswordField);
|
|
|
|
|
|
|
|
/**
|
2008-01-14 18:50:46 -08:00
|
|
|
* Test for strict equality with another nsILoginInfo object.
|
2007-07-17 13:48:57 -07:00
|
|
|
*
|
|
|
|
* @param aLoginInfo
|
|
|
|
* The other object to test.
|
|
|
|
*/
|
2007-05-16 03:02:45 -07:00
|
|
|
boolean equals(in nsILoginInfo aLoginInfo);
|
|
|
|
|
|
|
|
/**
|
2008-01-14 18:50:46 -08:00
|
|
|
* Test for loose equivalency with another nsILoginInfo object. The
|
|
|
|
* passwordField and usernameField values are ignored, and the password
|
|
|
|
* values may be optionally ignored. If one login's formSubmitURL is an
|
|
|
|
* empty string (but not null), it will be treated as a wildcard. [The
|
|
|
|
* blank value indicates the login was stored before bug 360493 was fixed.]
|
2007-07-17 13:48:57 -07:00
|
|
|
*
|
|
|
|
* @param aLoginInfo
|
|
|
|
* The other object to test.
|
2008-01-14 18:50:46 -08:00
|
|
|
* @param ignorePassword
|
|
|
|
* If true, ignore the password when checking for match.
|
2007-07-17 13:48:57 -07:00
|
|
|
*/
|
2008-01-14 18:50:46 -08:00
|
|
|
boolean matches(in nsILoginInfo aLoginInfo, in boolean ignorePassword);
|
2007-05-16 03:02:45 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
%{C++
|
|
|
|
|
|
|
|
#define NS_LOGININFO_CONTRACTID "@mozilla.org/login-manager/loginInfo;1"
|
|
|
|
|
|
|
|
%}
|