michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 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: #include "nsIProxiedChannel.idl" michael@0: michael@0: interface nsILoadGroup; michael@0: interface nsIURI; michael@0: interface nsIInterfaceRequestor; michael@0: typedef unsigned long nsLoadFlags; michael@0: michael@0: [scriptable, uuid(701093ac-5c7f-429c-99e3-423b041fccb4)] michael@0: interface nsIHttpAuthenticableChannel : nsIProxiedChannel michael@0: { michael@0: /** michael@0: * If the channel being authenticated is using SSL. michael@0: */ michael@0: readonly attribute boolean isSSL; michael@0: michael@0: /** michael@0: * Returns if the proxy HTTP method used is CONNECT. If no proxy is being michael@0: * used it must return PR_FALSE. michael@0: */ michael@0: readonly attribute boolean proxyMethodIsConnect; michael@0: michael@0: /** michael@0: * Cancels the current request. See nsIRequest. michael@0: */ michael@0: void cancel(in nsresult aStatus); michael@0: michael@0: /** michael@0: * The load flags of this request. See nsIRequest. michael@0: */ michael@0: readonly attribute nsLoadFlags loadFlags; michael@0: michael@0: /** michael@0: * The URI corresponding to the channel. See nsIChannel. michael@0: */ michael@0: readonly attribute nsIURI URI; michael@0: michael@0: /** michael@0: * The load group of this request. It is here for querying its michael@0: * notificationCallbacks. See nsIRequest. michael@0: */ michael@0: readonly attribute nsILoadGroup loadGroup; michael@0: michael@0: /** michael@0: * The notification callbacks for the channel. See nsIChannel. michael@0: */ michael@0: readonly attribute nsIInterfaceRequestor notificationCallbacks; michael@0: michael@0: /** michael@0: * The HTTP request method. See nsIHttpChannel. michael@0: */ michael@0: readonly attribute ACString requestMethod; michael@0: michael@0: /** michael@0: * The "Server" response header. michael@0: * Return NS_ERROR_NOT_AVAILABLE if not available. michael@0: */ michael@0: readonly attribute ACString serverResponseHeader; michael@0: michael@0: /** michael@0: * The Proxy-Authenticate response header. michael@0: */ michael@0: readonly attribute ACString proxyChallenges; michael@0: michael@0: /** michael@0: * The WWW-Authenticate response header. michael@0: */ michael@0: readonly attribute ACString WWWChallenges; michael@0: michael@0: /** michael@0: * Sets the Proxy-Authorization request header. An empty string michael@0: * will clear it. michael@0: */ michael@0: void setProxyCredentials(in ACString credentials); michael@0: michael@0: /** michael@0: * Sets the Authorization request header. An empty string michael@0: * will clear it. michael@0: */ michael@0: void setWWWCredentials(in ACString credentials); michael@0: michael@0: /** michael@0: * Called when authentication information is ready and has been set on this michael@0: * object using setWWWCredentials/setProxyCredentials. Implementations can michael@0: * continue with the request and send the given information to the server. michael@0: * michael@0: * It is called asynchronously from michael@0: * nsIHttpChannelAuthProvider::processAuthentication if that method returns michael@0: * NS_ERROR_IN_PROGRESS. michael@0: * michael@0: * @note Any exceptions thrown from this method should be ignored. michael@0: */ michael@0: void onAuthAvailable(); michael@0: michael@0: /** michael@0: * Notifies that the prompt was cancelled. It is called asynchronously michael@0: * from nsIHttpChannelAuthProvider::processAuthentication if that method michael@0: * returns NS_ERROR_IN_PROGRESS. michael@0: * michael@0: * @param userCancel michael@0: * If the user was cancelled has cancelled the authentication prompt. michael@0: */ michael@0: void onAuthCancelled(in boolean userCancel); michael@0: };