File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -101,11 +101,22 @@ def __init__(self, config: NodeConfig):
101101 elif config .client_cert :
102102 ssl_context .load_cert_chain (config .client_cert )
103103
104+ # Httpx supports setting 'auth' via _extras['requests.session.auth'] = ...
105+ # The naming is weird but it enables compatibility with the existing
106+ # 'requests.session.auth' parameter
107+ try :
108+ httpx_auth : Optional [httpx .Auth ] = config ._extras .pop (
109+ "requests.session.auth" , None
110+ )
111+ except AttributeError :
112+ httpx_auth = None
113+
104114 self .client = httpx .AsyncClient (
105115 base_url = f"{ config .scheme } ://{ config .host } :{ config .port } " ,
106116 limits = httpx .Limits (max_connections = config .connections_per_node ),
107117 verify = ssl_context or False ,
108118 timeout = config .request_timeout ,
119+ auth = httpx_auth ,
109120 )
110121
111122 async def perform_request ( # type: ignore[override]
You can’t perform that action at this time.
0 commit comments