@@ -94,7 +94,9 @@ class ProcessRelationsNodeSync(TypedDict):
9494 related_nodes : list [InfrahubNodeSync ]
9595
9696
97- def handle_relogin (func : Callable [..., Coroutine [Any , Any , httpx .Response ]]): # type: ignore[no-untyped-def]
97+ def handle_relogin (
98+ func : Callable [..., Coroutine [Any , Any , httpx .Response ]],
99+ ) -> Callable [..., Coroutine [Any , Any , httpx .Response ]]:
98100 @wraps (func )
99101 async def wrapper (client : InfrahubClient , * args : Any , ** kwargs : Any ) -> httpx .Response :
100102 response = await func (client , * args , ** kwargs )
@@ -108,7 +110,7 @@ async def wrapper(client: InfrahubClient, *args: Any, **kwargs: Any) -> httpx.Re
108110 return wrapper
109111
110112
111- def handle_relogin_sync (func : Callable [..., httpx .Response ]): # type: ignore[no-untyped-def]
113+ def handle_relogin_sync (func : Callable [..., httpx .Response ]) -> Callable [..., httpx . Response ]:
112114 @wraps (func )
113115 def wrapper (client : InfrahubClientSync , * args : Any , ** kwargs : Any ) -> httpx .Response :
114116 response = func (client , * args , ** kwargs )
@@ -170,6 +172,7 @@ def __init__(
170172 self .group_context : InfrahubGroupContext | InfrahubGroupContextSync
171173 self ._initialize ()
172174 self ._request_context : RequestContext | None = None
175+ _ = self .config .tls_context # Early load of the TLS context to catch errors
173176
174177 def _initialize (self ) -> None :
175178 """Sets the properties for each version of the client"""
@@ -574,7 +577,7 @@ async def _process_nodes_and_relationships(
574577 schema_kind (str): The kind of schema being queried.
575578 branch (str): The branch name.
576579 prefetch_relationships (bool): Flag to indicate whether to prefetch relationship data.
577- timeout (int, optional): Overrides default timeout used when querying the graphql API. Specified in seconds.
580+ timeout (int, optional): Overrides default timeout used when querying the GraphQL API. Specified in seconds.
578581
579582 Returns:
580583 ProcessRelationsNodeSync: A TypedDict containing two lists:
@@ -694,7 +697,7 @@ async def all(
694697 at (Timestamp, optional): Time of the query. Defaults to Now.
695698 branch (str, optional): Name of the branch to query from. Defaults to default_branch.
696699 populate_store (bool, optional): Flag to indicate whether to populate the store with the retrieved nodes.
697- timeout (int, optional): Overrides default timeout used when querying the graphql API. Specified in seconds.
700+ timeout (int, optional): Overrides default timeout used when querying the GraphQL API. Specified in seconds.
698701 offset (int, optional): The offset for pagination.
699702 limit (int, optional): The limit for pagination.
700703 include (list[str], optional): List of attributes or relationships to include in the query.
@@ -791,7 +794,7 @@ async def filters(
791794 kind (str): kind of the nodes to query
792795 at (Timestamp, optional): Time of the query. Defaults to Now.
793796 branch (str, optional): Name of the branch to query from. Defaults to default_branch.
794- timeout (int, optional): Overrides default timeout used when querying the graphql API. Specified in seconds.
797+ timeout (int, optional): Overrides default timeout used when querying the GraphQL API. Specified in seconds.
795798 populate_store (bool, optional): Flag to indicate whether to populate the store with the retrieved nodes.
796799 offset (int, optional): The offset for pagination.
797800 limit (int, optional): The limit for pagination.
@@ -1073,7 +1076,7 @@ async def _default_request_method(
10731076
10741077 async with httpx .AsyncClient (
10751078 ** proxy_config ,
1076- verify = self .config .tls_ca_file if self . config . tls_ca_file else not self . config . tls_insecure ,
1079+ verify = self .config .tls_context ,
10771080 ) as client :
10781081 try :
10791082 response = await client .request (
@@ -1945,7 +1948,7 @@ def all(
19451948 kind (str): kind of the nodes to query
19461949 at (Timestamp, optional): Time of the query. Defaults to Now.
19471950 branch (str, optional): Name of the branch to query from. Defaults to default_branch.
1948- timeout (int, optional): Overrides default timeout used when querying the graphql API. Specified in seconds.
1951+ timeout (int, optional): Overrides default timeout used when querying the GraphQL API. Specified in seconds.
19491952 populate_store (bool, optional): Flag to indicate whether to populate the store with the retrieved nodes.
19501953 offset (int, optional): The offset for pagination.
19511954 limit (int, optional): The limit for pagination.
@@ -1992,7 +1995,7 @@ def _process_nodes_and_relationships(
19921995 schema_kind (str): The kind of schema being queried.
19931996 branch (str): The branch name.
19941997 prefetch_relationships (bool): Flag to indicate whether to prefetch relationship data.
1995- timeout (int, optional): Overrides default timeout used when querying the graphql API. Specified in seconds.
1998+ timeout (int, optional): Overrides default timeout used when querying the GraphQL API. Specified in seconds.
19961999
19972000 Returns:
19982001 ProcessRelationsNodeSync: A TypedDict containing two lists:
@@ -2084,7 +2087,7 @@ def filters(
20842087 kind (str): kind of the nodes to query
20852088 at (Timestamp, optional): Time of the query. Defaults to Now.
20862089 branch (str, optional): Name of the branch to query from. Defaults to default_branch.
2087- timeout (int, optional): Overrides default timeout used when querying the graphql API. Specified in seconds.
2090+ timeout (int, optional): Overrides default timeout used when querying the GraphQL API. Specified in seconds.
20882091 populate_store (bool, optional): Flag to indicate whether to populate the store with the retrieved nodes.
20892092 offset (int, optional): The offset for pagination.
20902093 limit (int, optional): The limit for pagination.
@@ -2913,7 +2916,7 @@ def _default_request_method(
29132916
29142917 with httpx .Client (
29152918 ** proxy_config ,
2916- verify = self .config .tls_ca_file if self . config . tls_ca_file else not self . config . tls_insecure ,
2919+ verify = self .config .tls_context ,
29172920 ) as client :
29182921 try :
29192922 response = client .request (
0 commit comments