usso 0.28.3__py3-none-any.whl → 0.28.5__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/models/user.py CHANGED
@@ -11,18 +11,21 @@ class TokenType(StrEnum):
11
11
  SECURE_TOKEN = "secure"
12
12
  ONE_TIME_TOKEN = "one_time"
13
13
  TEMPORARY_TOKEN = "temporary"
14
- MFA_TEMPORARY_TOKEN = "mfa_temporary"
15
14
 
16
15
 
17
16
  class UserData(BaseModel):
18
- jti: str | None = None
19
- token_type: TokenType | None = None
17
+ # JWT standard claims
20
18
  iss: str | None = None
19
+ sub: str | None = None
21
20
  aud: str | None = None
22
21
  iat: int | None = None
23
22
  nbf: int | None = None
24
23
  exp: int | None = None
25
- sub: str | None = None
24
+ jti: str | None = None
25
+
26
+ # Custom claims
27
+ token_type: TokenType | None = None
28
+ session_id: str | None = None
26
29
  tenant_id: str | None = None
27
30
  workspace_id: str | None = None
28
31
  roles: list[str] | None = None
@@ -35,14 +38,16 @@ class UserData(BaseModel):
35
38
  def __init__(
36
39
  self,
37
40
  *,
38
- jti: str | None = None,
39
- token_type: TokenType | None = None,
40
41
  iss: str | None = None,
42
+ sub: str | None = None,
41
43
  aud: str | None = None,
42
44
  iat: int | None = None,
43
45
  nbf: int | None = None,
44
46
  exp: int | None = None,
45
- sub: str | None = None,
47
+ jti: str | None = None,
48
+
49
+ token_type: TokenType | None = None,
50
+ session_id: str | None = None,
46
51
  tenant_id: str | None = None,
47
52
  workspace_id: str | None = None,
48
53
  roles: list[str] | None = None,
@@ -60,6 +65,7 @@ class UserData(BaseModel):
60
65
  nbf=nbf,
61
66
  exp=exp,
62
67
  sub=sub,
68
+ session_id=session_id,
63
69
  tenant_id=tenant_id,
64
70
  workspace_id=workspace_id,
65
71
  roles=roles,
@@ -67,10 +67,10 @@ class BaseUssoSession:
67
67
  def refresh_token(self):
68
68
  if (
69
69
  self._refresh_token
70
- and self._refresh_token.verify( # noqa: W503
70
+ and self._refresh_token.verify(
71
71
  expected_token_type="refresh",
72
72
  )
73
- and self._refresh_token.is_temporally_valid() # noqa: W503
73
+ and self._refresh_token.is_temporally_valid()
74
74
  ):
75
75
  self._refresh_token = None
76
76
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: usso
3
- Version: 0.28.3
3
+ Version: 0.28.5
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>
@@ -28,7 +28,7 @@ Requires-Dist: cachetools
28
28
  Requires-Dist: singleton_package
29
29
  Requires-Dist: json-advanced
30
30
  Requires-Dist: httpx
31
- Requires-Dist: usso-jwt>=0.1.0
31
+ Requires-Dist: usso-jwt>=0.1.13
32
32
  Provides-Extra: fastapi
33
33
  Requires-Dist: fastapi>=0.65.0; extra == "fastapi"
34
34
  Requires-Dist: uvicorn[standard]>=0.13.0; extra == "fastapi"
@@ -9,17 +9,17 @@ usso/integrations/django/middleware.py,sha256=8b-VYQ3FRhLnXSl4ZfHBpiA6VLY4b7b0-Y
9
9
  usso/integrations/fastapi/__init__.py,sha256=ohToiqutHu3Okr8naunssDkamj1OdiG4OpPdBW0rt7U,204
10
10
  usso/integrations/fastapi/dependency.py,sha256=9CaRSvCNbrSQr7EQd6SEs7HhxULWvXLkEX89L5rsnZc,2543
11
11
  usso/integrations/fastapi/handler.py,sha256=MNDoBYdySumFsBgVw-xir3jXXH63KehFXKCh-pNnNZQ,386
12
- usso/models/user.py,sha256=phsfgRlR14y7--lBnfKFA_omkNI30hU--dSLMjYOi4E,3554
12
+ usso/models/user.py,sha256=P9UOIuv0wMFJ-AGeMT0enEiYkGHW5Pmg8Adc8DZPH7U,3668
13
13
  usso/session/__init__.py,sha256=tE4qWUdSI7iN_pywm47Mg8NKOTBa2nCNwCy3wCZWRmU,124
14
14
  usso/session/async_session.py,sha256=7OKvFnJQaHnLjeQKSW6bltl0KcQGzOvUje-bJKbxFZY,3692
15
- usso/session/base_session.py,sha256=4pbydSGf6IJ2yjQK31b8OZa0-QX01OPjFroU2eQrzZw,2558
15
+ usso/session/base_session.py,sha256=Z-Uwcwb0xX6Uo7OVd6ejYz7aMiDWrj5KGein7WWJCo0,2530
16
16
  usso/session/session.py,sha256=B29Srxoq7webDvmfmfTeeh5JjtLSHvJijM2WCEZOh-8,1506
17
17
  usso/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
18
  usso/utils/method_utils.py,sha256=1NMN4le04PWXDSJZK-nf7q2IFqOMkwYcCnslFXAzlH8,355
19
19
  usso/utils/string_utils.py,sha256=7tziAa2Cwa7xhwM_NF4DSY3BHoqVaWgJ21VuV8LvhrY,253
20
- usso-0.28.3.dist-info/licenses/LICENSE.txt,sha256=ceC9ZJOV9H6CtQDcYmHOS46NA3dHJ_WD4J9blH513pc,1081
21
- usso-0.28.3.dist-info/METADATA,sha256=yJpSA0mVApKcey5dCBLZiHHm4JE_RIEK1V8J44B5Y-8,4845
22
- usso-0.28.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
23
- usso-0.28.3.dist-info/entry_points.txt,sha256=4Zgpm5ELaAWPf0jPGJFz1_X69H7un8ycT3WdGoJ0Vvk,35
24
- usso-0.28.3.dist-info/top_level.txt,sha256=g9Jf6h1Oyidh0vPiFni7UHInTJjSvu6cUalpLTIvthg,5
25
- usso-0.28.3.dist-info/RECORD,,
20
+ usso-0.28.5.dist-info/licenses/LICENSE.txt,sha256=ceC9ZJOV9H6CtQDcYmHOS46NA3dHJ_WD4J9blH513pc,1081
21
+ usso-0.28.5.dist-info/METADATA,sha256=OWk_eQPsFsX4Z1LikDAWt7X7kjiOJs7uF6LcxrGBD2A,4846
22
+ usso-0.28.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
23
+ usso-0.28.5.dist-info/entry_points.txt,sha256=4Zgpm5ELaAWPf0jPGJFz1_X69H7un8ycT3WdGoJ0Vvk,35
24
+ usso-0.28.5.dist-info/top_level.txt,sha256=g9Jf6h1Oyidh0vPiFni7UHInTJjSvu6cUalpLTIvthg,5
25
+ usso-0.28.5.dist-info/RECORD,,
File without changes