1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/netwerk/protocol/http/nsIHttpAuthenticableChannel.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,108 @@ 1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#include "nsIProxiedChannel.idl" 1.10 + 1.11 +interface nsILoadGroup; 1.12 +interface nsIURI; 1.13 +interface nsIInterfaceRequestor; 1.14 +typedef unsigned long nsLoadFlags; 1.15 + 1.16 +[scriptable, uuid(701093ac-5c7f-429c-99e3-423b041fccb4)] 1.17 +interface nsIHttpAuthenticableChannel : nsIProxiedChannel 1.18 +{ 1.19 + /** 1.20 + * If the channel being authenticated is using SSL. 1.21 + */ 1.22 + readonly attribute boolean isSSL; 1.23 + 1.24 + /** 1.25 + * Returns if the proxy HTTP method used is CONNECT. If no proxy is being 1.26 + * used it must return PR_FALSE. 1.27 + */ 1.28 + readonly attribute boolean proxyMethodIsConnect; 1.29 + 1.30 + /** 1.31 + * Cancels the current request. See nsIRequest. 1.32 + */ 1.33 + void cancel(in nsresult aStatus); 1.34 + 1.35 + /** 1.36 + * The load flags of this request. See nsIRequest. 1.37 + */ 1.38 + readonly attribute nsLoadFlags loadFlags; 1.39 + 1.40 + /** 1.41 + * The URI corresponding to the channel. See nsIChannel. 1.42 + */ 1.43 + readonly attribute nsIURI URI; 1.44 + 1.45 + /** 1.46 + * The load group of this request. It is here for querying its 1.47 + * notificationCallbacks. See nsIRequest. 1.48 + */ 1.49 + readonly attribute nsILoadGroup loadGroup; 1.50 + 1.51 + /** 1.52 + * The notification callbacks for the channel. See nsIChannel. 1.53 + */ 1.54 + readonly attribute nsIInterfaceRequestor notificationCallbacks; 1.55 + 1.56 + /** 1.57 + * The HTTP request method. See nsIHttpChannel. 1.58 + */ 1.59 + readonly attribute ACString requestMethod; 1.60 + 1.61 + /** 1.62 + * The "Server" response header. 1.63 + * Return NS_ERROR_NOT_AVAILABLE if not available. 1.64 + */ 1.65 + readonly attribute ACString serverResponseHeader; 1.66 + 1.67 + /** 1.68 + * The Proxy-Authenticate response header. 1.69 + */ 1.70 + readonly attribute ACString proxyChallenges; 1.71 + 1.72 + /** 1.73 + * The WWW-Authenticate response header. 1.74 + */ 1.75 + readonly attribute ACString WWWChallenges; 1.76 + 1.77 + /** 1.78 + * Sets the Proxy-Authorization request header. An empty string 1.79 + * will clear it. 1.80 + */ 1.81 + void setProxyCredentials(in ACString credentials); 1.82 + 1.83 + /** 1.84 + * Sets the Authorization request header. An empty string 1.85 + * will clear it. 1.86 + */ 1.87 + void setWWWCredentials(in ACString credentials); 1.88 + 1.89 + /** 1.90 + * Called when authentication information is ready and has been set on this 1.91 + * object using setWWWCredentials/setProxyCredentials. Implementations can 1.92 + * continue with the request and send the given information to the server. 1.93 + * 1.94 + * It is called asynchronously from 1.95 + * nsIHttpChannelAuthProvider::processAuthentication if that method returns 1.96 + * NS_ERROR_IN_PROGRESS. 1.97 + * 1.98 + * @note Any exceptions thrown from this method should be ignored. 1.99 + */ 1.100 + void onAuthAvailable(); 1.101 + 1.102 + /** 1.103 + * Notifies that the prompt was cancelled. It is called asynchronously 1.104 + * from nsIHttpChannelAuthProvider::processAuthentication if that method 1.105 + * returns NS_ERROR_IN_PROGRESS. 1.106 + * 1.107 + * @param userCancel 1.108 + * If the user was cancelled has cancelled the authentication prompt. 1.109 + */ 1.110 + void onAuthCancelled(in boolean userCancel); 1.111 +};