usso 0.27.20__py3-none-any.whl → 0.27.21__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -29,7 +29,7 @@ class AsyncUssoSession(httpx.AsyncClient, BaseUssoSession):
29
29
  user_id=user_id,
30
30
  client=client,
31
31
  )
32
- if not self.api_key:
32
+ if not hasattr(self, "api_key") or not self.api_key:
33
33
  self._refresh_sync()
34
34
 
35
35
  def _prepare_refresh_request(self) -> tuple[dict, dict]:
@@ -89,7 +89,7 @@ class AsyncUssoSession(httpx.AsyncClient, BaseUssoSession):
89
89
  return self._handle_refresh_response(response)
90
90
 
91
91
  async def get_session(self):
92
- if self.api_key:
92
+ if hasattr(self, "api_key") and self.api_key:
93
93
  return self
94
94
 
95
95
  if not self.access_token or is_expired(self.access_token):
usso/session/session.py CHANGED
@@ -36,7 +36,7 @@ class UssoSession(httpx.Client, BaseUssoSession):
36
36
  user_id=user_id,
37
37
  client=client,
38
38
  )
39
- if not self.api_key:
39
+ if not hasattr(self, "api_key") or not self.api_key:
40
40
  self._refresh()
41
41
 
42
42
  def _refresh_api(self):
@@ -68,7 +68,7 @@ class UssoSession(httpx.Client, BaseUssoSession):
68
68
  return response.json()
69
69
 
70
70
  def get_session(self):
71
- if self.api_key:
71
+ if hasattr(self, "api_key") and self.api_key:
72
72
  return self
73
73
 
74
74
  if not self.access_token or is_expired(self.access_token):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: usso
3
- Version: 0.27.20
3
+ Version: 0.27.21
4
4
  Summary: A plug-and-play client for integrating universal single sign-on (SSO) with Python frameworks, enabling secure and seamless authentication across microservices.
5
5
  Author-email: Mahdi Kiani <mahdikiany@gmail.com>
6
6
  Maintainer-email: Mahdi Kiani <mahdikiany@gmail.com>
@@ -11,12 +11,12 @@ usso/django/middleware.py,sha256=EEEpHvMQ6QiWw2HY8zQ2Aec0RCATcLWsCKeyiPWJKio,324
11
11
  usso/fastapi/__init__.py,sha256=0EcdOzb4f3yu9nILIdGWnlyUz-0VaVX2az1e3f2BusI,201
12
12
  usso/fastapi/integration.py,sha256=IonxxNj_B9sG2j672rIzE047qo972vk7ch4-eGENp3Q,2638
13
13
  usso/session/__init__.py,sha256=tE4qWUdSI7iN_pywm47Mg8NKOTBa2nCNwCy3wCZWRmU,124
14
- usso/session/async_session.py,sha256=CLtgIXcLF0if_VX1x0IJK_RpVEu1waUw69x4YVj4xxU,3517
14
+ usso/session/async_session.py,sha256=HxM5FA-QLtaLQ3Pc5ttwqfEQfzPajySR1SQ0qO-VJ7I,3578
15
15
  usso/session/base_session.py,sha256=wZ96VPf0zz8zDRtjJrOmZ2S4XvEBLLZAc74A4iDy7G4,3369
16
- usso/session/session.py,sha256=bjG0-WJIzNPTW1dKG1kKcwiXDNtRq-fZ__G2wNME-Lw,2545
17
- usso-0.27.20.dist-info/LICENSE.txt,sha256=ceC9ZJOV9H6CtQDcYmHOS46NA3dHJ_WD4J9blH513pc,1081
18
- usso-0.27.20.dist-info/METADATA,sha256=IHOr6tLj0dSr4TRTKNcxYIfhxVhI9B1b5ob6u4eL-7s,4580
19
- usso-0.27.20.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
20
- usso-0.27.20.dist-info/entry_points.txt,sha256=4Zgpm5ELaAWPf0jPGJFz1_X69H7un8ycT3WdGoJ0Vvk,35
21
- usso-0.27.20.dist-info/top_level.txt,sha256=g9Jf6h1Oyidh0vPiFni7UHInTJjSvu6cUalpLTIvthg,5
22
- usso-0.27.20.dist-info/RECORD,,
16
+ usso/session/session.py,sha256=SWHHJr_s2P7vChbyp0OUqmIsdyP_Yed9-VuOWUInW0Y,2606
17
+ usso-0.27.21.dist-info/LICENSE.txt,sha256=ceC9ZJOV9H6CtQDcYmHOS46NA3dHJ_WD4J9blH513pc,1081
18
+ usso-0.27.21.dist-info/METADATA,sha256=ZKrTd-aerwKIqaHf0XCPIuWPW8XL7eP9cg5xdp7WMyE,4580
19
+ usso-0.27.21.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
20
+ usso-0.27.21.dist-info/entry_points.txt,sha256=4Zgpm5ELaAWPf0jPGJFz1_X69H7un8ycT3WdGoJ0Vvk,35
21
+ usso-0.27.21.dist-info/top_level.txt,sha256=g9Jf6h1Oyidh0vPiFni7UHInTJjSvu6cUalpLTIvthg,5
22
+ usso-0.27.21.dist-info/RECORD,,
File without changes