404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@3.14.249.102: ~ $
3

�P\t�@s�dZddlZddlZddlmZddlmZddlmZddlm	Z	ddlm
Z
Gd	d
�d
ej�ZGdd�deej�Z
Gd
d�de
�ZGdd�de�ZGdd�de�Zddd�Zdd�ZdS)aThe App Engine Transport Adapter for requests.

.. versionadded:: 0.6.0

This requires a version of requests >= 2.10.0 and Python 2.

There are two ways to use this library:

#. If you're using requests directly, you can use code like:

   .. code-block:: python

       >>> import requests
       >>> import ssl
       >>> import requests.packages.urllib3.contrib.appengine as ul_appengine
       >>> from requests_toolbelt.adapters import appengine
       >>> s = requests.Session()
       >>> if ul_appengine.is_appengine_sandbox():
       ...    s.mount('http://', appengine.AppEngineAdapter())
       ...    s.mount('https://', appengine.AppEngineAdapter())

#. If you depend on external libraries which use requests, you can use code
   like:

   .. code-block:: python

       >>> from requests_toolbelt.adapters import appengine
       >>> appengine.monkeypatch()

which will ensure all requests.Session objects use AppEngineAdapter properly.

You are also able to :ref:`disable certificate validation <insecure_appengine>`
when monkey-patching.
�N)�adapters)�sessions�)�
exceptions)�
gaecontrib)�timeoutcs$eZdZdZdZ�fdd�Z�ZS)�AppEngineMROHacka�Resolves infinite recursion when monkeypatching.

    This works by injecting itself as the base class of both the
    :class:`AppEngineAdapter` and Requests' default HTTPAdapter, which needs to
    be done because default HTTPAdapter's MRO is recompiled when we
    monkeypatch, at which point this class becomes HTTPAdapter's base class.
    In addition, we use an instantiation flag to avoid infinite recursion.
    Fcs"|jsd|_tt|�j||�dS)NT)�_initialized�superr�__init__)�self�args�kwargs)�	__class__��/usr/lib/python3.6/appengine.pyr9szAppEngineMROHack.__init__)�__name__�
__module__�__qualname__�__doc__r	r�
__classcell__rr)rrr.srcs:eZdZdZejjdgZd	�fdd�	Zd
dd�Z�Z	S)�AppEngineAdapterayThe transport adapter for Requests to use urllib3's GAE support.

    Implements Requests's HTTPAdapter API.

    When deploying to Google's App Engine service, some of Requests'
    functionality is broken. There is underlying support for GAE in urllib3.
    This functionality, however, is opt-in and needs to be enabled explicitly
    for Requests to be able to use it.
    �_validate_certificateTcs"t�||_tt|�j||�dS)N)�_check_versionrr
rr)r�validate_certificater
r)rrrrLszAppEngineAdapter.__init__FcCst|j�|_dS)N)�_AppEnginePoolManagerrZpoolmanager)rZconnections�maxsize�blockrrr�init_poolmanagerQsz!AppEngineAdapter.init_poolmanager)T)F)
rrrrr�HTTPAdapterZ	__attrs__rrrrr)rrr?s	rcs eZdZdZ�fdd�Z�ZS)�InsecureAppEngineAdaptera�An always-insecure GAE adapter for Requests.

    This is a variant of the the transport adapter for Requests to use
    urllib3's GAE support that does not validate certificates. Use with
    caution!

    .. note::
        The ``validate_certificate`` keyword argument will not be honored here
        and is not part of the signature because we always force it to
        ``False``.

    See :class:`AppEngineAdapter` for further details.
    cs8|jdd�rtjdtj�tt|�j|ddi|��dS)NrFz�Certificate validation cannot be specified on the InsecureAppEngineAdapter, but was present. This will be ignored and certificate validation will remain off.)�pop�warnings�warn�excZ IgnoringGAECertificateValidationr
r r)rr
r)rrrrds

z!InsecureAppEngineAdapter.__init__)rrrrrrrr)rrr Us
r c@s*eZdZdZd
dd�Zdd�Zdd�Zd	S)raKImplements urllib3's PoolManager API expected by requests.

    While a real PoolManager map hostnames to reusable Connections,
    AppEngine has no concept of a reusable connection to a host.
    So instead, this class constructs a small Connection per request,
    that is returned to the Adapter and used to access the URL.
    TcCstj|d�|_dS)N)r)rZAppEngineManager�appengine_manager)rrrrrrxsz_AppEnginePoolManager.__init__cCst|j|�S)N)�_AppEngineConnectionr%)r�urlrrr�connection_from_url|sz)_AppEnginePoolManager.connection_from_urlcCsdS)Nr)rrrr�clearsz_AppEnginePoolManager.clearN)T)rrrrrr(r)rrrrros
rc@s6eZdZdZdd�Zdddddejjddfdd�ZdS)r&a�Implements urllib3's HTTPConnectionPool API's urlopen().

    This Connection's urlopen() is called with a host-relative path,
    so in order to properly support opening the URL, we need to store
    the full URL when this Connection is constructed from the PoolManager.

    This code wraps AppEngineManager.urlopen(), which exposes a different
    API than in the original urllib3 urlopen(), and thus needs this adapter.
    cCs||_||_dS)N)r%r')rr%r'rrrr�sz_AppEngineConnection.__init__NTcKs8|js|jp|j|_|jj||jf|||||d�|��S)N)�body�headers�retries�redirectr)ZtotalZ_readZ_connectr%�urlopenr')r�methodr'r*r+r,r-Zassert_same_hostrZpool_timeoutZrelease_connZresponse_kwrrrr.�sz_AppEngineConnection.urlopen)	rrrrrrZTimeoutZDEFAULT_TIMEOUTr.rrrrr&�s	r&TcCs"t�t}|st}|t_|t_dS)a�Sets up all Sessions to use AppEngineAdapter by default.

    If you don't want to deal with configuring your own Sessions,
    or if you use libraries that use requests directly (ie requests.post),
    then you may prefer to monkeypatch and auto-configure all Sessions.

    .. warning: :

        If ``validate_certificate`` is ``False``, certification validation will
        effectively be disabled for all requests.
    N)rrr rrr)rZadapterrrr�monkeypatch�sr0cCstdkrtjdjtj���dS)Nz^The toolbelt requires at least Requests 2.10.0 to be installed. Version {0} was found instead.)rr$ZVersionMismatchError�format�requests�__version__rrrrr�sr)T)rr2r"rr�rr$Z_compatrrrrrr �objectrr&r0rrrrr�<module>#s,


Filemanager

Name Type Size Permission Actions
__init__.cpython-36.opt-1.pyc File 460 B 0644
__init__.cpython-36.pyc File 460 B 0644
appengine.cpython-36.opt-1.pyc File 7.23 KB 0644
appengine.cpython-36.pyc File 7.23 KB 0644
fingerprint.cpython-36.opt-1.pyc File 1.68 KB 0644
fingerprint.cpython-36.pyc File 1.68 KB 0644
host_header_ssl.cpython-36.opt-1.pyc File 1.32 KB 0644
host_header_ssl.cpython-36.pyc File 1.32 KB 0644
socket_options.cpython-36.opt-1.pyc File 4.01 KB 0644
socket_options.cpython-36.pyc File 4.01 KB 0644
source.cpython-36.opt-1.pyc File 2.74 KB 0644
source.cpython-36.pyc File 2.74 KB 0644
ssl.cpython-36.opt-1.pyc File 2.44 KB 0644
ssl.cpython-36.pyc File 2.44 KB 0644
x509.cpython-36.opt-1.pyc File 6.42 KB 0644
x509.cpython-36.pyc File 6.42 KB 0644