68
68
69
69
def resolve_auth_headers (
70
70
headers : Optional [Mapping [str , str ]],
71
- http_auth : Union [DefaultType , None , Tuple [str , str ], str ] = DEFAULT ,
72
71
api_key : Union [DefaultType , None , Tuple [str , str ], str ] = DEFAULT ,
73
72
basic_auth : Union [DefaultType , None , Tuple [str , str ], str ] = DEFAULT ,
74
73
bearer_auth : Union [DefaultType , None , str ] = DEFAULT ,
@@ -78,32 +77,7 @@ def resolve_auth_headers(
78
77
elif not isinstance (headers , HttpHeaders ):
79
78
headers = HttpHeaders (headers )
80
79
81
- resolved_http_auth = http_auth if http_auth is not DEFAULT else None
82
80
resolved_basic_auth = basic_auth if basic_auth is not DEFAULT else None
83
- if resolved_http_auth is not None :
84
- if resolved_basic_auth is not None :
85
- raise ValueError (
86
- "Can't specify both 'http_auth' and 'basic_auth', "
87
- "instead only specify 'basic_auth'"
88
- )
89
- if isinstance (http_auth , str ) or (
90
- isinstance (resolved_http_auth , (list , tuple ))
91
- and all (isinstance (x , str ) for x in resolved_http_auth )
92
- ):
93
- resolved_basic_auth = resolved_http_auth
94
- else :
95
- raise TypeError (
96
- "The deprecated 'http_auth' parameter must be either 'Tuple[str, str]' or 'str'. "
97
- "Use either the 'basic_auth' parameter instead"
98
- )
99
-
100
- warnings .warn (
101
- "The 'http_auth' parameter is deprecated. "
102
- "Use 'basic_auth' or 'bearer_auth' parameters instead" ,
103
- category = DeprecationWarning ,
104
- stacklevel = warn_stacklevel (),
105
- )
106
-
107
81
resolved_api_key = api_key if api_key is not DEFAULT else None
108
82
resolved_bearer_auth = bearer_auth if bearer_auth is not DEFAULT else None
109
83
if resolved_api_key or resolved_basic_auth or resolved_bearer_auth :
0 commit comments