Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Commit 12f2396

Browse files
authored
fix: add "verify" flag to the creation of client
2 parents 5d433fe + e3862b9 commit 12f2396

File tree

8 files changed

+18
-3
lines changed

8 files changed

+18
-3
lines changed

supabase_auth/_async/gotrue_admin_api.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,14 @@ def __init__(
2929
url: str = "",
3030
headers: Dict[str, str] = {},
3131
http_client: Union[AsyncClient, None] = None,
32+
verify: bool = True,
3233
) -> None:
3334
AsyncGoTrueBaseAPI.__init__(
3435
self,
3536
url=url,
3637
headers=headers,
3738
http_client=http_client,
39+
verify=verify,
3840
)
3941
self.mfa = AsyncGoTrueAdminMFAAPI()
4042
self.mfa.list_factors = self._list_factors

supabase_auth/_async/gotrue_base_api.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@ def __init__(
1919
url: str,
2020
headers: Dict[str, str],
2121
http_client: Union[AsyncClient, None],
22+
verify: bool = True,
2223
):
2324
self._url = url
2425
self._headers = headers
25-
self._http_client = http_client or AsyncClient()
26+
self._http_client = http_client or AsyncClient(verify=bool(verify))
2627

2728
async def __aenter__(self) -> Self:
2829
return self

supabase_auth/_async/gotrue_client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,14 @@ def __init__(
8989
storage: Union[AsyncSupportedStorage, None] = None,
9090
http_client: Union[AsyncClient, None] = None,
9191
flow_type: AuthFlowType = "implicit",
92+
verify: bool = True,
9293
) -> None:
9394
AsyncGoTrueBaseAPI.__init__(
9495
self,
9596
url=url or GOTRUE_URL,
9697
headers=headers or DEFAULT_HEADERS,
9798
http_client=http_client,
99+
verify=verify,
98100
)
99101
self._storage_key = storage_key or STORAGE_KEY
100102
self._auto_refresh_token = auto_refresh_token

supabase_auth/_sync/api.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,13 @@ def __init__(
2626
headers: Dict[str, str],
2727
cookie_options: CookieOptions,
2828
http_client: Optional[SyncClient] = None,
29+
verify: bool = True,
2930
) -> None:
3031
"""Initialise API class."""
3132
self.url = url
3233
self.headers = headers
3334
self.cookie_options = cookie_options
34-
self.http_client = http_client or SyncClient()
35+
self.http_client = http_client or SyncClient(verify=bool(verify))
3536

3637
def __enter__(self) -> SyncGoTrueAPI:
3738
return self

supabase_auth/_sync/client.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def __init__(
3737
cookie_options: CookieOptions = CookieOptions.parse_obj(COOKIE_OPTIONS),
3838
api: Optional[SyncGoTrueAPI] = None,
3939
replace_default_headers: bool = False,
40+
verify: bool = True,
4041
) -> None:
4142
"""Create a new client
4243
@@ -54,6 +55,8 @@ def __init__(
5455
The storage engine to use for persisting the session.
5556
cookie_options : CookieOptions
5657
The options for the cookie.
58+
verify: bool
59+
Verify SSL, True by default, False disables verification.
5760
"""
5861
if url.startswith("http://"):
5962
print(
@@ -72,6 +75,7 @@ def __init__(
7275
"url": url,
7376
"headers": {**empty_or_default_headers, **headers},
7477
"cookie_options": cookie_options,
78+
"verify": verify,
7579
}
7680
self.api = api or SyncGoTrueAPI(**args)
7781

supabase_auth/_sync/gotrue_admin_api.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,14 @@ def __init__(
2929
url: str = "",
3030
headers: Dict[str, str] = {},
3131
http_client: Union[SyncClient, None] = None,
32+
verify: bool = True,
3233
) -> None:
3334
SyncGoTrueBaseAPI.__init__(
3435
self,
3536
url=url,
3637
headers=headers,
3738
http_client=http_client,
39+
verify=verify,
3840
)
3941
self.mfa = SyncGoTrueAdminMFAAPI()
4042
self.mfa.list_factors = self._list_factors

supabase_auth/_sync/gotrue_base_api.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@ def __init__(
1919
url: str,
2020
headers: Dict[str, str],
2121
http_client: Union[SyncClient, None],
22+
verify: bool = True,
2223
):
2324
self._url = url
2425
self._headers = headers
25-
self._http_client = http_client or SyncClient()
26+
self._http_client = http_client or SyncClient(verify=bool(verify))
2627

2728
def __enter__(self) -> Self:
2829
return self

supabase_auth/_sync/gotrue_client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,14 @@ def __init__(
8989
storage: Union[SyncSupportedStorage, None] = None,
9090
http_client: Union[SyncClient, None] = None,
9191
flow_type: AuthFlowType = "implicit",
92+
verify: bool = True,
9293
) -> None:
9394
SyncGoTrueBaseAPI.__init__(
9495
self,
9596
url=url or GOTRUE_URL,
9697
headers=headers or DEFAULT_HEADERS,
9798
http_client=http_client,
99+
verify=verify,
98100
)
99101
self._storage_key = storage_key or STORAGE_KEY
100102
self._auto_refresh_token = auto_refresh_token

0 commit comments

Comments
 (0)