Skip to content

Commit ee3a6ba

Browse files
committed
Removed support for SOCKS as it lacks tests and the feature is not supported in the other SDKs.
1 parent e7e4b6f commit ee3a6ba

File tree

2 files changed

+1
-27
lines changed

2 files changed

+1
-27
lines changed

zitadel_client/configuration.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ def __init__(
5757
cpu_count * 5 is used as default value to increase performance.
5858
"""
5959

60-
self.proxy: Optional[str] = None
61-
self.proxy_headers = None
6260
self.safe_chars_for_path_param = ''
6361
self.retries = retries
6462
# Enable client side validation

zitadel_client/rest.py

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,8 @@
1010
from zitadel_client.exceptions import ApiException, ApiValueError
1111
from zitadel_client.rest_response import RESTResponse
1212

13-
SUPPORTED_SOCKS_PROXIES = {"socks5", "socks5h", "socks4", "socks4a"}
1413
RESTResponseType = urllib3.HTTPResponse
1514

16-
17-
def is_socks_proxy_url(url: str) -> bool:
18-
if url is None:
19-
return False
20-
split_section = url.split("://")
21-
if len(split_section) < 2:
22-
return False
23-
else:
24-
return split_section[0].lower() in SUPPORTED_SOCKS_PROXIES
25-
26-
2715
class RESTClientObject:
2816

2917
def __init__(self, configuration) -> None: # type: ignore
@@ -64,19 +52,7 @@ def __init__(self, configuration) -> None: # type: ignore
6452

6553
# https pool manager
6654
self.pool_manager: urllib3.PoolManager
67-
68-
if configuration.proxy:
69-
if is_socks_proxy_url(configuration.proxy):
70-
from urllib3.contrib.socks import SOCKSProxyManager
71-
pool_args["proxy_url"] = configuration.proxy
72-
pool_args["headers"] = configuration.proxy_headers
73-
self.pool_manager = SOCKSProxyManager(**pool_args)
74-
else:
75-
pool_args["proxy_url"] = configuration.proxy
76-
pool_args["proxy_headers"] = configuration.proxy_headers
77-
self.pool_manager = urllib3.ProxyManager(**pool_args)
78-
else:
79-
self.pool_manager = urllib3.PoolManager(**pool_args)
55+
self.pool_manager = urllib3.PoolManager(**pool_args)
8056

8157
def request(
8258
self,

0 commit comments

Comments
 (0)