From 563a1e3f5af58a135b6e356431800c36f1d8f52e Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Mon, 23 Sep 2024 15:11:41 -0300 Subject: [PATCH 01/15] feat: Proxy support --- supabase_auth/_sync/client.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/supabase_auth/_sync/client.py b/supabase_auth/_sync/client.py index d55e6999..fa5dbfce 100644 --- a/supabase_auth/_sync/client.py +++ b/supabase_auth/_sync/client.py @@ -38,6 +38,7 @@ def __init__( api: Optional[SyncGoTrueAPI] = None, replace_default_headers: bool = False, verify: bool = True, + proxy: str | None = None, ) -> None: """Create a new client @@ -57,6 +58,8 @@ def __init__( The options for the cookie. verify: bool Verify SSL, True by default, False disables verification. + proxy: str + HTTP Proxy string or None, None by default, None disables proxy. """ if url.startswith("http://"): print( @@ -76,6 +79,7 @@ def __init__( "headers": {**empty_or_default_headers, **headers}, "cookie_options": cookie_options, "verify": verify, + "proxy": proxy, } self.api = api or SyncGoTrueAPI(**args) From d566b44b64c4debedfe62165c6830367eb466af4 Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Tue, 24 Sep 2024 10:58:49 -0300 Subject: [PATCH 02/15] feat: Proxy support --- supabase_auth/_sync/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supabase_auth/_sync/client.py b/supabase_auth/_sync/client.py index fa5dbfce..46577133 100644 --- a/supabase_auth/_sync/client.py +++ b/supabase_auth/_sync/client.py @@ -38,7 +38,7 @@ def __init__( api: Optional[SyncGoTrueAPI] = None, replace_default_headers: bool = False, verify: bool = True, - proxy: str | None = None, + proxy: Optional[str] = None, ) -> None: """Create a new client From 61c01232efa3f867c81cb9b07f85882c349ec3f1 Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Tue, 24 Sep 2024 18:09:38 -0300 Subject: [PATCH 03/15] feat: Proxy support --- supabase_auth/_async/gotrue_admin_api.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/supabase_auth/_async/gotrue_admin_api.py b/supabase_auth/_async/gotrue_admin_api.py index 24f64bd0..3ad8cd61 100644 --- a/supabase_auth/_async/gotrue_admin_api.py +++ b/supabase_auth/_async/gotrue_admin_api.py @@ -1,7 +1,7 @@ from __future__ import annotations from functools import partial -from typing import Dict, List, Union +from typing import Dict, List, Union, Optional from ..helpers import model_validate, parse_link_response, parse_user_response from ..http_clients import AsyncClient @@ -30,6 +30,7 @@ def __init__( headers: Dict[str, str] = {}, http_client: Union[AsyncClient, None] = None, verify: bool = True, + proxy: Optional[str] = None, ) -> None: AsyncGoTrueBaseAPI.__init__( self, @@ -37,6 +38,7 @@ def __init__( headers=headers, http_client=http_client, verify=verify, + proxy=proxy, ) self.mfa = AsyncGoTrueAdminMFAAPI() self.mfa.list_factors = self._list_factors From 1f1a26348cf739c34b1edbb296014a4a14032f6a Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Tue, 24 Sep 2024 18:09:43 -0300 Subject: [PATCH 04/15] feat: Proxy support --- supabase_auth/_async/gotrue_base_api.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/supabase_auth/_async/gotrue_base_api.py b/supabase_auth/_async/gotrue_base_api.py index 9bab1581..0e21a004 100644 --- a/supabase_auth/_async/gotrue_base_api.py +++ b/supabase_auth/_async/gotrue_base_api.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import Any, Callable, Dict, TypeVar, Union, overload +from typing import Any, Callable, Dict, TypeVar, Union, overload, Optional from httpx import Response from pydantic import BaseModel @@ -21,11 +21,13 @@ def __init__( headers: Dict[str, str], http_client: Union[AsyncClient, None], verify: bool = True, + proxy: Optional[str] = None, ): self._url = url self._headers = headers self._http_client = http_client or AsyncClient( verify=bool(verify), + proxy=proxy, follow_redirects=True, http2=True, ) From e62fdaa29136b37abeece8cb5697f19c03f08c22 Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Tue, 24 Sep 2024 18:09:49 -0300 Subject: [PATCH 05/15] feat: Proxy support --- supabase_auth/_async/gotrue_client.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/supabase_auth/_async/gotrue_client.py b/supabase_auth/_async/gotrue_client.py index 90013a9e..059f65aa 100644 --- a/supabase_auth/_async/gotrue_client.py +++ b/supabase_auth/_async/gotrue_client.py @@ -4,7 +4,7 @@ from functools import partial from json import loads from time import time -from typing import Callable, Dict, List, Tuple, Union +from typing import Callable, Dict, List, Tuple, Union, Optional from urllib.parse import parse_qs, urlencode, urlparse from uuid import uuid4 @@ -96,6 +96,7 @@ def __init__( http_client: Union[AsyncClient, None] = None, flow_type: AuthFlowType = "implicit", verify: bool = True, + proxy: Optional[str] = None, ) -> None: AsyncGoTrueBaseAPI.__init__( self, @@ -103,6 +104,7 @@ def __init__( headers=headers or DEFAULT_HEADERS, http_client=http_client, verify=verify, + proxy=proxy, ) self._storage_key = storage_key or STORAGE_KEY self._auto_refresh_token = auto_refresh_token From cdf199430357e3678193c2b989ebab1a688aca25 Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Tue, 24 Sep 2024 18:10:00 -0300 Subject: [PATCH 06/15] feat: Proxy support --- supabase_auth/_sync/api.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/supabase_auth/_sync/api.py b/supabase_auth/_sync/api.py index 11e1b8aa..012f2473 100644 --- a/supabase_auth/_sync/api.py +++ b/supabase_auth/_sync/api.py @@ -27,6 +27,7 @@ def __init__( cookie_options: CookieOptions, http_client: Optional[SyncClient] = None, verify: bool = True, + proxy: Optional[str] = None, ) -> None: """Initialise API class.""" self.url = url @@ -34,6 +35,7 @@ def __init__( self.cookie_options = cookie_options self.http_client = http_client or SyncClient( verify=bool(verify), + proxy=proxy, follow_redirects=True, http2=True, ) From 18f0283d4804759a57f54cfe955cdf9ae255e53c Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Tue, 24 Sep 2024 18:10:05 -0300 Subject: [PATCH 07/15] feat: Proxy support --- supabase_auth/_sync/gotrue_admin_api.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/supabase_auth/_sync/gotrue_admin_api.py b/supabase_auth/_sync/gotrue_admin_api.py index c4ae6b99..f32a4f32 100644 --- a/supabase_auth/_sync/gotrue_admin_api.py +++ b/supabase_auth/_sync/gotrue_admin_api.py @@ -1,7 +1,7 @@ from __future__ import annotations from functools import partial -from typing import Dict, List, Union +from typing import Dict, List, Union, Optional from ..helpers import model_validate, parse_link_response, parse_user_response from ..http_clients import SyncClient @@ -30,6 +30,7 @@ def __init__( headers: Dict[str, str] = {}, http_client: Union[SyncClient, None] = None, verify: bool = True, + proxy: Optional[str] = None, ) -> None: SyncGoTrueBaseAPI.__init__( self, @@ -37,6 +38,7 @@ def __init__( headers=headers, http_client=http_client, verify=verify, + proxy=proxy, ) self.mfa = SyncGoTrueAdminMFAAPI() self.mfa.list_factors = self._list_factors From d11b8e613397861353506fff31b058a0b99ff1c7 Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Tue, 24 Sep 2024 18:10:11 -0300 Subject: [PATCH 08/15] feat: Proxy support --- supabase_auth/_sync/gotrue_base_api.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/supabase_auth/_sync/gotrue_base_api.py b/supabase_auth/_sync/gotrue_base_api.py index dd2cf257..4fdd067b 100644 --- a/supabase_auth/_sync/gotrue_base_api.py +++ b/supabase_auth/_sync/gotrue_base_api.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import Any, Callable, Dict, TypeVar, Union, overload +from typing import Any, Callable, Dict, TypeVar, Union, overload, Optional from httpx import Response from pydantic import BaseModel @@ -21,11 +21,13 @@ def __init__( headers: Dict[str, str], http_client: Union[SyncClient, None], verify: bool = True, + proxy: Optional[str] = None, ): self._url = url self._headers = headers self._http_client = http_client or SyncClient( verify=bool(verify), + proxy=proxy, follow_redirects=True, http2=True, ) From 4d67ed6708ee63709225197bac30739f1ebe4546 Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Tue, 24 Sep 2024 18:10:16 -0300 Subject: [PATCH 09/15] feat: Proxy support --- supabase_auth/_sync/gotrue_client.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/supabase_auth/_sync/gotrue_client.py b/supabase_auth/_sync/gotrue_client.py index 16ee3e65..4bebbfd7 100644 --- a/supabase_auth/_sync/gotrue_client.py +++ b/supabase_auth/_sync/gotrue_client.py @@ -4,7 +4,7 @@ from functools import partial from json import loads from time import time -from typing import Callable, Dict, List, Tuple, Union +from typing import Callable, Dict, List, Tuple, Union, Optional from urllib.parse import parse_qs, urlencode, urlparse from uuid import uuid4 @@ -96,6 +96,7 @@ def __init__( http_client: Union[SyncClient, None] = None, flow_type: AuthFlowType = "implicit", verify: bool = True, + proxy: Optional[str] = None, ) -> None: SyncGoTrueBaseAPI.__init__( self, @@ -103,6 +104,7 @@ def __init__( headers=headers or DEFAULT_HEADERS, http_client=http_client, verify=verify, + proxy=proxy, ) self._storage_key = storage_key or STORAGE_KEY self._auto_refresh_token = auto_refresh_token From 624307be283df8e7446ef35f9ba0497c5dffc22a Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Tue, 24 Sep 2024 18:10:41 -0300 Subject: [PATCH 10/15] feat: Proxy support --- supabase_auth/_async/gotrue_admin_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supabase_auth/_async/gotrue_admin_api.py b/supabase_auth/_async/gotrue_admin_api.py index 3ad8cd61..b9dd871f 100644 --- a/supabase_auth/_async/gotrue_admin_api.py +++ b/supabase_auth/_async/gotrue_admin_api.py @@ -1,7 +1,7 @@ from __future__ import annotations from functools import partial -from typing import Dict, List, Union, Optional +from typing import Dict, List, Optional, Union from ..helpers import model_validate, parse_link_response, parse_user_response from ..http_clients import AsyncClient From ede428d96540dde4680b9f119d338e49b1b24214 Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Tue, 24 Sep 2024 18:10:46 -0300 Subject: [PATCH 11/15] feat: Proxy support --- supabase_auth/_async/gotrue_base_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supabase_auth/_async/gotrue_base_api.py b/supabase_auth/_async/gotrue_base_api.py index 0e21a004..7dfb22fb 100644 --- a/supabase_auth/_async/gotrue_base_api.py +++ b/supabase_auth/_async/gotrue_base_api.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import Any, Callable, Dict, TypeVar, Union, overload, Optional +from typing import Any, Callable, Dict, Optional, TypeVar, Union, overload from httpx import Response from pydantic import BaseModel From e6d0b2a115fad1542533c0e11d298c78dd6e8479 Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Tue, 24 Sep 2024 18:10:51 -0300 Subject: [PATCH 12/15] feat: Proxy support --- supabase_auth/_async/gotrue_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supabase_auth/_async/gotrue_client.py b/supabase_auth/_async/gotrue_client.py index 059f65aa..f4c7ba09 100644 --- a/supabase_auth/_async/gotrue_client.py +++ b/supabase_auth/_async/gotrue_client.py @@ -4,7 +4,7 @@ from functools import partial from json import loads from time import time -from typing import Callable, Dict, List, Tuple, Union, Optional +from typing import Callable, Dict, List, Optional, Tuple, Union from urllib.parse import parse_qs, urlencode, urlparse from uuid import uuid4 From 664ddb6404a7bdaec62ecb44da10639374edbe67 Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Tue, 24 Sep 2024 18:10:56 -0300 Subject: [PATCH 13/15] feat: Proxy support --- supabase_auth/_sync/gotrue_admin_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supabase_auth/_sync/gotrue_admin_api.py b/supabase_auth/_sync/gotrue_admin_api.py index f32a4f32..cedd4bb7 100644 --- a/supabase_auth/_sync/gotrue_admin_api.py +++ b/supabase_auth/_sync/gotrue_admin_api.py @@ -1,7 +1,7 @@ from __future__ import annotations from functools import partial -from typing import Dict, List, Union, Optional +from typing import Dict, List, Optional, Union from ..helpers import model_validate, parse_link_response, parse_user_response from ..http_clients import SyncClient From 1c777854b3cf41ab0ae878bc112b8d3d612c9e11 Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Tue, 24 Sep 2024 18:11:02 -0300 Subject: [PATCH 14/15] feat: Proxy support --- supabase_auth/_sync/gotrue_base_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supabase_auth/_sync/gotrue_base_api.py b/supabase_auth/_sync/gotrue_base_api.py index 4fdd067b..19448760 100644 --- a/supabase_auth/_sync/gotrue_base_api.py +++ b/supabase_auth/_sync/gotrue_base_api.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import Any, Callable, Dict, TypeVar, Union, overload, Optional +from typing import Any, Callable, Dict, Optional, TypeVar, Union, overload from httpx import Response from pydantic import BaseModel From 32f42641defde908c4cbebf8d054919d1ad606b5 Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Tue, 24 Sep 2024 18:11:08 -0300 Subject: [PATCH 15/15] feat: Proxy support --- supabase_auth/_sync/gotrue_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supabase_auth/_sync/gotrue_client.py b/supabase_auth/_sync/gotrue_client.py index 4bebbfd7..684d0365 100644 --- a/supabase_auth/_sync/gotrue_client.py +++ b/supabase_auth/_sync/gotrue_client.py @@ -4,7 +4,7 @@ from functools import partial from json import loads from time import time -from typing import Callable, Dict, List, Tuple, Union, Optional +from typing import Callable, Dict, List, Optional, Tuple, Union from urllib.parse import parse_qs, urlencode, urlparse from uuid import uuid4