Skip to content

Commit

Permalink
Update the proxy authentication (#354)
Browse files Browse the repository at this point in the history
changed authentication for proxy
  • Loading branch information
amir-haroun authored May 23, 2024
1 parent 1b145aa commit d63b71b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/databricks/sql/auth/thrift_http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from io import BytesIO

from urllib3 import HTTPConnectionPool, HTTPSConnectionPool, ProxyManager

from urllib3.util import make_headers
from databricks.sql.auth.retry import CommandType, DatabricksRetryPolicy


Expand Down Expand Up @@ -120,7 +120,7 @@ def open(self):
proxy_manager = ProxyManager(
self.proxy_uri,
num_pools=1,
headers={"Proxy-Authorization": self.proxy_auth},
proxy_headers=self.proxy_auth,
)
self.__pool = proxy_manager.connection_from_host(
host=self.realhost,
Expand Down Expand Up @@ -197,8 +197,7 @@ def basic_proxy_auth_header(proxy):
urllib.parse.unquote(proxy.username),
urllib.parse.unquote(proxy.password),
)
cr = base64.b64encode(ap.encode()).strip()
return "Basic " + six.ensure_str(cr)
return make_headers(proxy_basic_auth=ap)

def set_retry_command_type(self, value: CommandType):
"""Pass the provided CommandType to the retry policy"""
Expand Down

0 comments on commit d63b71b

Please sign in to comment.