![]() Server : Apache/2.4.62 (Unix) OpenSSL/1.0.2k-fips System : Linux server1.richineiserver.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : fdshops ( 1003) PHP Version : 8.2.21 Disable Function : NONE Directory : /lib/python2.7/site-packages/requests_toolbelt/adapters/ |
� ӵ Yc @ s� d Z d d l Z d d l Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d e j f d � � YZ d e e j f d � � YZ d e f d � � YZ d e f d � � YZ d e f d � � YZ e d � Z d � Z d S( s The 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. i����N( t adapters( t sessionsi ( t exceptions( t gaecontrib( t timeoutt AppEngineMROHackc B s e Z d Z e Z d � Z RS( s� 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. c O s2 | j s. t | _ t t | � j | | � n d S( N( t _initializedt Truet superR t __init__( t selft argst kwargs( ( sH /usr/lib/python2.7/site-packages/requests_toolbelt/adapters/appengine.pyR 9 s ( t __name__t __module__t __doc__t FalseR R ( ( ( sH /usr/lib/python2.7/site-packages/requests_toolbelt/adapters/appengine.pyR . s t AppEngineAdapterc B s9 e Z d Z e j j d g Z e d � Z e d � Z RS( sy The 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. t _validate_certificatec O s- t � | | _ t t | � j | | � d S( N( t _check_versionR R R R ( R t validate_certificateR R ( ( sH /usr/lib/python2.7/site-packages/requests_toolbelt/adapters/appengine.pyR L s c C s t | j � | _ d S( N( t _AppEnginePoolManagerR t poolmanager( R t connectionst maxsizet block( ( sH /usr/lib/python2.7/site-packages/requests_toolbelt/adapters/appengine.pyt init_poolmanagerQ s ( R R R R t HTTPAdaptert __attrs__R R R R ( ( ( sH /usr/lib/python2.7/site-packages/requests_toolbelt/adapters/appengine.pyR ? s t InsecureAppEngineAdapterc B s e Z d Z d � Z RS( s� 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. c O sK | j d t � r( t j d t j � n t t | � j d t | | � d S( NR s� Certificate validation cannot be specified on the InsecureAppEngineAdapter, but was present. This will be ignored and certificate validation will remain off.( t popR t warningst warnt exct IgnoringGAECertificateValidationR R R ( R R R ( ( sH /usr/lib/python2.7/site-packages/requests_toolbelt/adapters/appengine.pyR d s ( R R R R ( ( ( sH /usr/lib/python2.7/site-packages/requests_toolbelt/adapters/appengine.pyR U s R c B s, e Z d Z e d � Z d � Z d � Z RS( sK Implements 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. c C s t j d | � | _ d S( NR ( R t AppEngineManagert appengine_manager( R R ( ( sH /usr/lib/python2.7/site-packages/requests_toolbelt/adapters/appengine.pyR x s c C s t | j | � S( N( t _AppEngineConnectionR$ ( R t url( ( sH /usr/lib/python2.7/site-packages/requests_toolbelt/adapters/appengine.pyt connection_from_url| s c C s d S( N( ( R ( ( sH /usr/lib/python2.7/site-packages/requests_toolbelt/adapters/appengine.pyt clear s ( R R R R R R'