Let us walk on the 3-isogeny graph
Loading...
Searching...
No Matches
pip._vendor.requests.auth Namespace Reference

Data Structures

class  AuthBase
 
class  HTTPBasicAuth
 
class  HTTPDigestAuth
 
class  HTTPProxyAuth
 

Functions

 _basic_auth_str (username, password)
 

Variables

str CONTENT_TYPE_FORM_URLENCODED = "application/x-www-form-urlencoded"
 
str CONTENT_TYPE_MULTI_PART = "multipart/form-data"
 

Detailed Description

requests.auth
~~~~~~~~~~~~~

This module contains the authentication handlers for Requests.

Function Documentation

◆ _basic_auth_str()

_basic_auth_str (   username,
  password 
)
protected
Returns a Basic Auth string.

Definition at line 25 of file auth.py.

25def _basic_auth_str(username, password):
26 """Returns a Basic Auth string."""
27
28 # "I want us to put a big-ol' comment on top of it that
29 # says that this behaviour is dumb but we need to preserve
30 # it because people are relying on it."
31 # - Lukasa
32 #
33 # These are here solely to maintain backwards compatibility
34 # for things like ints. This will be removed in 3.0.0.
35 if not isinstance(username, basestring):
37 "Non-string usernames will no longer be supported in Requests "
38 "3.0.0. Please convert the object you've passed in ({!r}) to "
39 "a string or bytes object in the near future to avoid "
40 "problems.".format(username),
41 category=DeprecationWarning,
42 )
43 username = str(username)
44
45 if not isinstance(password, basestring):
47 "Non-string passwords will no longer be supported in Requests "
48 "3.0.0. Please convert the object you've passed in ({!r}) to "
49 "a string or bytes object in the near future to avoid "
50 "problems.".format(type(password)),
51 category=DeprecationWarning,
52 )
53 password = str(password)
54 # -- End Removal --
55
56 if isinstance(username, str):
57 username = username.encode("latin1")
58
59 if isinstance(password, str):
60 password = password.encode("latin1")
61
62 authstr = "Basic " + to_native_string(
63 b64encode(b":".join((username, password))).strip()
64 )
65
66 return authstr
67
68
for i

References i.

Variable Documentation

◆ CONTENT_TYPE_FORM_URLENCODED

str CONTENT_TYPE_FORM_URLENCODED = "application/x-www-form-urlencoded"

Definition at line 21 of file auth.py.

◆ CONTENT_TYPE_MULTI_PART

str CONTENT_TYPE_MULTI_PART = "multipart/form-data"

Definition at line 22 of file auth.py.