File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 11from setuptools import find_packages , setup
22
3- __version__ = "0.5.10 "
3+ __version__ = "0.5.11 "
44__pkg_name__ = "sypht"
55
66setup (
Original file line number Diff line number Diff line change @@ -35,14 +35,14 @@ def __init__(
3535 :param base_endpoint: Sypht API endpoint. Default: `https://api.sypht.com`.
3636 :param auth_endpoint: Sypht authentication endpoint. Default: `https://login.sypht.com/oauth/token`.
3737 """
38- self .requests = session if session is not None else requests .Session ()
3938 self .base_endpoint = base_endpoint or os .environ .get (
4039 "SYPHT_API_BASE_ENDPOINT" , SYPHT_API_BASE_ENDPOINT
4140 )
4241 self .audience = os .environ .get ("SYPHT_AUDIENCE" , self .base_endpoint )
4342 self .auth_endpoint = auth_endpoint or os .environ .get (
4443 "SYPHT_AUTH_ENDPOINT" , SYPHT_AUTH_ENDPOINT
4544 )
45+ self .requests = session if session is not None else self ._create_session
4646
4747 if client_id is None and client_secret is None :
4848 env_key = os .environ .get (self .API_ENV_KEY )
@@ -70,6 +70,10 @@ def __init__(
7070 self ._company_id = None
7171 self ._authenticate_client ()
7272
73+ @property
74+ def _create_session (self ):
75+ return requests .Session ()
76+
7377 @staticmethod
7478 def _authenticate_v2 (endpoint , client_id , client_secret , audience ):
7579 basic_auth_slug = b64encode ((client_id + ":" + client_secret ).encode ("utf-8" )).decode (
You can’t perform that action at this time.
0 commit comments