diff --git a/supabase_functions/__init__.py b/supabase_functions/__init__.py index 99ecb86..5c99910 100644 --- a/supabase_functions/__init__.py +++ b/supabase_functions/__init__.py @@ -10,20 +10,24 @@ @overload def create_client( - url: str, headers: dict[str, str], *, is_async: Literal[True] + url: str, headers: dict[str, str], *, is_async: Literal[True], verify: bool ) -> AsyncFunctionsClient: ... @overload def create_client( - url: str, headers: dict[str, str], *, is_async: Literal[False] + url: str, headers: dict[str, str], *, is_async: Literal[False], verify: bool ) -> SyncFunctionsClient: ... def create_client( - url: str, headers: dict[str, str], *, is_async: bool + url: str, + headers: dict[str, str], + *, + is_async: bool, + verify: bool = True, ) -> Union[AsyncFunctionsClient, SyncFunctionsClient]: if is_async: - return AsyncFunctionsClient(url, headers) + return AsyncFunctionsClient(url, headers, verify) else: - return SyncFunctionsClient(url, headers) + return SyncFunctionsClient(url, headers, verify) diff --git a/supabase_functions/_async/functions_client.py b/supabase_functions/_async/functions_client.py index 0617c2b..6578fd3 100644 --- a/supabase_functions/_async/functions_client.py +++ b/supabase_functions/_async/functions_client.py @@ -7,14 +7,17 @@ class AsyncFunctionsClient: - def __init__(self, url: str, headers: Dict): + def __init__(self, url: str, headers: Dict, verify: bool = True): self.url = url self.headers = { "User-Agent": f"supabase-py/functions-py v{__version__}", **headers, } self._client = AsyncClient( - base_url=self.url, headers=self.headers, follow_redirects=True + base_url=self.url, + headers=self.headers, + verify=bool(verify), + follow_redirects=True, ) async def _request( diff --git a/supabase_functions/_sync/functions_client.py b/supabase_functions/_sync/functions_client.py index dc4fb70..bb39a6f 100644 --- a/supabase_functions/_sync/functions_client.py +++ b/supabase_functions/_sync/functions_client.py @@ -7,14 +7,17 @@ class SyncFunctionsClient: - def __init__(self, url: str, headers: Dict): + def __init__(self, url: str, headers: Dict, verify: bool = True): self.url = url self.headers = { "User-Agent": f"supabase-py/functions-py v{__version__}", **headers, } self._client = SyncClient( - base_url=self.url, headers=self.headers, follow_redirects=True + base_url=self.url, + headers=self.headers, + verify=bool(verify), + follow_redirects=True, ) def _request(