tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

nsIHttpAuthenticableChannel.idl (3855B)


      1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
      2 /* This Source Code Form is subject to the terms of the Mozilla Public
      3 * License, v. 2.0. If a copy of the MPL was not distributed with this
      4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      5 
      6 #include "nsIProxiedChannel.idl"
      7 #include "nsIRequest.idl"
      8 
      9 interface nsILoadGroup;
     10 interface nsIURI;
     11 interface nsIInterfaceRequestor;
     12 
     13 [uuid(701093ac-5c7f-429c-99e3-423b041fccb4)]
     14 interface nsIHttpAuthenticableChannel : nsIProxiedChannel
     15 {
     16    /**
     17     * If the channel being authenticated is using SSL.
     18     */
     19    [must_use] readonly attribute boolean isSSL;
     20 
     21    /**
     22     * Returns if the proxy HTTP method used is CONNECT. If no proxy is being
     23     * used it must return PR_FALSE.
     24     */
     25    [must_use] readonly attribute boolean proxyMethodIsConnect;
     26 
     27    /**
     28     * Cancels the current request. See nsIRequest.
     29     */
     30    [must_use] void cancel(in nsresult aStatus);
     31 
     32    /**
     33     * The load flags of this request. See nsIRequest.
     34     */
     35    [must_use] readonly attribute nsLoadFlags loadFlags;
     36 
     37    /**
     38     * The URI corresponding to the channel. See nsIChannel.
     39     */
     40    [must_use] readonly attribute nsIURI URI;
     41 
     42    /**
     43     * The load group of this request. It is here for querying its
     44     * notificationCallbacks. See nsIRequest.
     45     */
     46    [must_use] readonly attribute nsILoadGroup loadGroup;
     47 
     48    /**
     49     * The notification callbacks for the channel. See nsIChannel.
     50     */
     51    [must_use] readonly attribute nsIInterfaceRequestor notificationCallbacks;
     52 
     53    /**
     54     * The HTTP request method. See nsIHttpChannel.
     55     */
     56    [must_use] readonly attribute ACString requestMethod;
     57 
     58    /**
     59     * The "Server" response header.
     60     * Return NS_ERROR_NOT_AVAILABLE if not available.
     61     */
     62    [must_use] readonly attribute ACString serverResponseHeader;
     63 
     64    /**
     65     * The Proxy-Authenticate response header.
     66     */
     67    [must_use] readonly attribute ACString proxyChallenges;
     68 
     69    /**
     70     * The WWW-Authenticate response header.
     71     */
     72    [must_use] readonly attribute ACString WWWChallenges;
     73 
     74    /**
     75     * Sets the Proxy-Authorization request header. An empty string
     76     * will clear it.
     77     */
     78    [must_use] void setProxyCredentials(in ACString credentials);
     79 
     80    /**
     81     * Sets the Authorization request header. An empty string
     82     * will clear it.
     83     */
     84    [must_use] void setWWWCredentials(in ACString credentials);
     85 
     86    /**
     87     * Called when authentication information is ready and has been set on this
     88     * object using setWWWCredentials/setProxyCredentials. Implementations can
     89     * continue with the request and send the given information to the server.
     90     *
     91     * It is called asynchronously from
     92     * nsIHttpChannelAuthProvider::processAuthentication if that method returns
     93     * NS_ERROR_IN_PROGRESS.
     94     *
     95     * @note  Any exceptions thrown from this method should be ignored.
     96     */
     97    [must_use] void onAuthAvailable();
     98 
     99    /**
    100     * Notifies that the prompt was cancelled. It is called asynchronously
    101     * from nsIHttpChannelAuthProvider::processAuthentication if that method
    102     * returns NS_ERROR_IN_PROGRESS.
    103     *
    104     * @param userCancel
    105     *        If the user was cancelled has cancelled the authentication prompt.
    106     */
    107    [must_use] void onAuthCancelled(in boolean userCancel);
    108 
    109    /**
    110     * Tells the channel to drop and close any sticky connection, since this
    111     * connection oriented schema cannot be negotiated second time on
    112     * the same connection.
    113     */
    114    [must_use] void closeStickyConnection();
    115 
    116    /**
    117     * Tells the channel to mark the connection as allowed to restart on
    118     * authentication retry.  This is allowed when the request is a start
    119     * of a new authentication round.
    120     */
    121    void connectionRestartable(in boolean restartable);
    122 };