Skip to content

Commit f43038c

Browse files
fix: add "verify" flag to the creation of client
1 parent 66c3c1a commit f43038c

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

supabase_functions/__init__.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,24 @@
1010

1111
@overload
1212
def create_client(
13-
url: str, headers: dict[str, str], *, is_async: Literal[True]
13+
url: str, headers: dict[str, str], *, is_async: Literal[True], verify: bool
1414
) -> AsyncFunctionsClient: ...
1515

1616

1717
@overload
1818
def create_client(
19-
url: str, headers: dict[str, str], *, is_async: Literal[False]
19+
url: str, headers: dict[str, str], *, is_async: Literal[False], verify: bool
2020
) -> SyncFunctionsClient: ...
2121

2222

2323
def create_client(
24-
url: str, headers: dict[str, str], *, is_async: bool
24+
url: str,
25+
headers: dict[str, str],
26+
*,
27+
is_async: bool,
28+
verify: bool = True,
2529
) -> Union[AsyncFunctionsClient, SyncFunctionsClient]:
2630
if is_async:
27-
return AsyncFunctionsClient(url, headers)
31+
return AsyncFunctionsClient(url, headers, verify)
2832
else:
29-
return SyncFunctionsClient(url, headers)
33+
return SyncFunctionsClient(url, headers, verify)

supabase_functions/_async/functions_client.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,17 @@
77

88

99
class AsyncFunctionsClient:
10-
def __init__(self, url: str, headers: Dict):
10+
def __init__(self, url: str, headers: Dict, verify: bool = True):
1111
self.url = url
1212
self.headers = {
1313
"User-Agent": f"supabase-py/functions-py v{__version__}",
1414
**headers,
1515
}
1616
self._client = AsyncClient(
17-
base_url=self.url, headers=self.headers, follow_redirects=True
17+
base_url=self.url,
18+
headers=self.headers,
19+
verify=bool(verify),
20+
follow_redirects=True,
1821
)
1922

2023
async def _request(

supabase_functions/_sync/functions_client.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,17 @@
77

88

99
class SyncFunctionsClient:
10-
def __init__(self, url: str, headers: Dict):
10+
def __init__(self, url: str, headers: Dict, verify: bool = True):
1111
self.url = url
1212
self.headers = {
1313
"User-Agent": f"supabase-py/functions-py v{__version__}",
1414
**headers,
1515
}
1616
self._client = SyncClient(
17-
base_url=self.url, headers=self.headers, follow_redirects=True
17+
base_url=self.url,
18+
headers=self.headers,
19+
verify=bool(verify),
20+
follow_redirects=True,
1821
)
1922

2023
def _request(

0 commit comments

Comments
 (0)