usso 0.24.14__py3-none-any.whl → 0.24.16__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.
usso/async_session.py CHANGED
@@ -24,7 +24,10 @@ class AsyncUssoSession:
24
24
  decoded_token = jwt.decode(
25
25
  self._refresh_token, options={"verify_signature": False}
26
26
  )
27
- exp = decoded_token.get("exp", datetime.now() + timedelta(days=1))
27
+ exp = decoded_token.get(
28
+ "exp", (datetime.now() + timedelta(days=1)).timestamp()
29
+ )
30
+ exp = datetime.fromtimestamp(exp)
28
31
  if exp < datetime.now():
29
32
  self._refresh_token = None
30
33
 
@@ -45,7 +48,7 @@ class AsyncUssoSession:
45
48
  raise ValueError("Refresh token not provided or invalid.")
46
49
 
47
50
  if self.api_key and not self.refresh_token:
48
- self._refresh_api()
51
+ await self._refresh_api()
49
52
 
50
53
  async with aiohttp.ClientSession() as session:
51
54
  async with session.post(
usso/session.py CHANGED
@@ -24,7 +24,10 @@ class UssoSession:
24
24
  decoded_token = jwt.decode(
25
25
  self._refresh_token, options={"verify_signature": False}
26
26
  )
27
- exp = decoded_token.get("exp", datetime.now() + timedelta(days=1))
27
+ exp = decoded_token.get(
28
+ "exp", (datetime.now() + timedelta(days=1)).timestamp()
29
+ )
30
+ exp = datetime.fromtimestamp(exp)
28
31
  if exp < datetime.now():
29
32
  self._refresh_token = None
30
33
 
@@ -42,7 +45,7 @@ class UssoSession:
42
45
  def _refresh(self):
43
46
  if not self.refresh_token and not self.api_key:
44
47
  return
45
-
48
+
46
49
  if self.api_key and not self.refresh_token:
47
50
  self._refresh_api()
48
51
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: usso
3
- Version: 0.24.14
3
+ Version: 0.24.16
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>
@@ -1,20 +1,20 @@
1
1
  usso/__init__.py,sha256=NnOS_S1a-JKTOlGe1nw-kCL3m0y82mA2mDraus7BQ2o,120
2
2
  usso/api.py,sha256=xlDq2nZNpq3mhAvqIbGEfANHNjJpPquSeULBfS7iMJw,5094
3
3
  usso/async_api.py,sha256=rb-Xh5oudmZrPYM_iH_B75b5Z0Fvi1V1uurdcKE51w0,5551
4
- usso/async_session.py,sha256=dGRZWk3vx8wM4VTGyjkym3AcWQJNFQdbZy9gGGlTx-Y,4071
4
+ usso/async_session.py,sha256=lVOAKb1uy2Q_75RKnae8OHcPtqojnaacPF2SRQGIrHA,4167
5
5
  usso/b64tools.py,sha256=HGQ0E59vzjrQo2-4jrcY03ebtTaYwTtCZ7KgJaEmxO0,610
6
6
  usso/core.py,sha256=cOpETK_gGVsUJT0EeIebOGLEbF8vHVET-_I-8QxOCyE,3977
7
7
  usso/exceptions.py,sha256=hawOAuVbvQtjgRfwp1KFZ4SmV7fh720y5Gom9JVA8W8,504
8
8
  usso/package_data.dat,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
- usso/session.py,sha256=R5REJ4bdWbDiLI3WP5D1OluB4Xkm9fs25iyj1UO_iEI,2111
9
+ usso/session.py,sha256=nNi_hB1MKvqJbiGOqDIw_58LpouCpi9yCSeadMRv5l4,2193
10
10
  usso/django/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  usso/django/middleware.py,sha256=EEEpHvMQ6QiWw2HY8zQ2Aec0RCATcLWsCKeyiPWJKio,3245
12
12
  usso/fastapi/__init__.py,sha256=0EcdOzb4f3yu9nILIdGWnlyUz-0VaVX2az1e3f2BusI,201
13
13
  usso/fastapi/auth_middleware.py,sha256=DYrNPy_9FIV1amRuafoJtgGMi8uE0FPmSKBUGP79GNo,7616
14
14
  usso/fastapi/integration.py,sha256=VAUWaa7ChQ1jTtn8A136VgyG6t2kDo5pGK-3RgmNDVs,1669
15
- usso-0.24.14.dist-info/LICENSE.txt,sha256=ceC9ZJOV9H6CtQDcYmHOS46NA3dHJ_WD4J9blH513pc,1081
16
- usso-0.24.14.dist-info/METADATA,sha256=ojctnMNAK8AHc29mluT8kRO0rN9dex9hNC1YcLPcWG0,4275
17
- usso-0.24.14.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
18
- usso-0.24.14.dist-info/entry_points.txt,sha256=4Zgpm5ELaAWPf0jPGJFz1_X69H7un8ycT3WdGoJ0Vvk,35
19
- usso-0.24.14.dist-info/top_level.txt,sha256=g9Jf6h1Oyidh0vPiFni7UHInTJjSvu6cUalpLTIvthg,5
20
- usso-0.24.14.dist-info/RECORD,,
15
+ usso-0.24.16.dist-info/LICENSE.txt,sha256=ceC9ZJOV9H6CtQDcYmHOS46NA3dHJ_WD4J9blH513pc,1081
16
+ usso-0.24.16.dist-info/METADATA,sha256=s9HQMOcGoT8kA1SMbxagXEh9L6kpvlS2uHkXg2e3FcM,4275
17
+ usso-0.24.16.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
18
+ usso-0.24.16.dist-info/entry_points.txt,sha256=4Zgpm5ELaAWPf0jPGJFz1_X69H7un8ycT3WdGoJ0Vvk,35
19
+ usso-0.24.16.dist-info/top_level.txt,sha256=g9Jf6h1Oyidh0vPiFni7UHInTJjSvu6cUalpLTIvthg,5
20
+ usso-0.24.16.dist-info/RECORD,,
File without changes