![]() 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/auth/ |
� ӵ Yc @ sb d Z d d l m Z m Z d d l m Z m Z d e f d � � YZ d e f d � � YZ d S( s� requests_toolbelt.auth.handler ============================== This holds all of the implementation details of the Authentication Handler. i����( t AuthBaset HTTPBasicAuth( t urlparset urlunparset AuthHandlerc B s\ e Z d Z d � Z d � Z d � Z d � Z e d � � Z d � Z d � Z d � Z RS( s� The ``AuthHandler`` object takes a dictionary of domains paired with authentication strategies and will use this to determine which credentials to use when making a request. For example, you could do the following: .. code-block:: python from requests import HTTPDigestAuth from requests_toolbelt.auth.handler import AuthHandler import requests auth = AuthHandler({ 'https://api.github.com': ('sigmavirus24', 'fakepassword'), 'https://example.com': HTTPDigestAuth('username', 'password') }) r = requests.get('https://api.github.com/user', auth=auth) # => <Response [200]> r = requests.get('https://example.com/some/path', auth=auth) # => <Response [200]> s = requests.Session() s.auth = auth r = s.get('https://api.github.com/user') # => <Response [200]> .. warning:: :class:`requests.auth.HTTPDigestAuth` is not yet thread-safe. If you use :class:`AuthHandler` across multiple threads you should instantiate a new AuthHandler for each thread with a new HTTPDigestAuth instance for each thread. c C s t | � | _ | j � d S( N( t dictt strategiest _make_uniform( t selfR ( ( sB /usr/lib/python2.7/site-packages/requests_toolbelt/auth/handler.pyt __init__6 s c C s | j | j � } | | � S( N( t get_strategy_fort url( R t requestt auth( ( sB /usr/lib/python2.7/site-packages/requests_toolbelt/auth/handler.pyt __call__: s c C s d j | j � S( Ns <AuthHandler({0!r})>( t formatR ( R ( ( sB /usr/lib/python2.7/site-packages/requests_toolbelt/auth/handler.pyt __repr__>