usso 0.28.2__py3-none-any.whl → 0.28.4__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/auth/client.py +6 -3
- usso/models/user.py +3 -3
- usso/session/base_session.py +1 -1
- {usso-0.28.2.dist-info → usso-0.28.4.dist-info}/METADATA +2 -2
- {usso-0.28.2.dist-info → usso-0.28.4.dist-info}/RECORD +9 -9
- {usso-0.28.2.dist-info → usso-0.28.4.dist-info}/WHEEL +0 -0
- {usso-0.28.2.dist-info → usso-0.28.4.dist-info}/entry_points.txt +0 -0
- {usso-0.28.2.dist-info → usso-0.28.4.dist-info}/licenses/LICENSE.txt +0 -0
- {usso-0.28.2.dist-info → usso-0.28.4.dist-info}/top_level.txt +0 -0
usso/auth/client.py
CHANGED
@@ -36,7 +36,7 @@ class UssoAuth:
|
|
36
36
|
self,
|
37
37
|
token: str,
|
38
38
|
*,
|
39
|
-
|
39
|
+
expected_token_type: str | None = "access",
|
40
40
|
raise_exception: bool = True,
|
41
41
|
**kwargs,
|
42
42
|
) -> UserData | None:
|
@@ -44,7 +44,7 @@ class UssoAuth:
|
|
44
44
|
|
45
45
|
Args:
|
46
46
|
token: The JWT token to validate
|
47
|
-
|
47
|
+
expected_token_type: Expected token type
|
48
48
|
raise_exception: Whether to raise exception on error
|
49
49
|
**kwargs: Additional arguments to pass to token verification
|
50
50
|
|
@@ -60,7 +60,10 @@ class UssoAuth:
|
|
60
60
|
jwt_obj = usso_jwt.schemas.JWT(
|
61
61
|
token=token, config=jwk_config, payload_class=UserData
|
62
62
|
)
|
63
|
-
if jwt_obj.verify(
|
63
|
+
if jwt_obj.verify(
|
64
|
+
expected_token_type=expected_token_type,
|
65
|
+
**kwargs,
|
66
|
+
):
|
64
67
|
return jwt_obj.payload
|
65
68
|
except usso_jwt.exceptions.JWTError as e:
|
66
69
|
exp = e
|
usso/models/user.py
CHANGED
@@ -16,7 +16,7 @@ class TokenType(StrEnum):
|
|
16
16
|
|
17
17
|
class UserData(BaseModel):
|
18
18
|
jti: str | None = None
|
19
|
-
|
19
|
+
token_type: TokenType | None = None
|
20
20
|
iss: str | None = None
|
21
21
|
aud: str | None = None
|
22
22
|
iat: int | None = None
|
@@ -36,7 +36,7 @@ class UserData(BaseModel):
|
|
36
36
|
self,
|
37
37
|
*,
|
38
38
|
jti: str | None = None,
|
39
|
-
|
39
|
+
token_type: TokenType | None = None,
|
40
40
|
iss: str | None = None,
|
41
41
|
aud: str | None = None,
|
42
42
|
iat: int | None = None,
|
@@ -53,7 +53,7 @@ class UserData(BaseModel):
|
|
53
53
|
):
|
54
54
|
super().__init__(
|
55
55
|
jti=jti,
|
56
|
-
|
56
|
+
token_type=token_type,
|
57
57
|
iss=iss,
|
58
58
|
aud=aud,
|
59
59
|
iat=iat,
|
usso/session/base_session.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: usso
|
3
|
-
Version: 0.28.
|
3
|
+
Version: 0.28.4
|
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.
|
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"
|
@@ -2,24 +2,24 @@ usso/__init__.py,sha256=t3tYcw4qtGFpk7iakXTqEj5RlzIc8D2fs0I3FZcOmGs,571
|
|
2
2
|
usso/exceptions.py,sha256=cBzmMCwpNQKMjCUXO3bCcFwZJQQvbvJ5RxTH987ZlCI,1012
|
3
3
|
usso/auth/__init__.py,sha256=Dthv-iZTgsHTGcJrkJsnAtDCbRR5dNCx0Ut7MufoAXY,270
|
4
4
|
usso/auth/api_key.py,sha256=ec3q_mJtPiNb-eZt5MA4bantX1zRo3WwU2JfYBcGCGk,1254
|
5
|
-
usso/auth/client.py,sha256=
|
5
|
+
usso/auth/client.py,sha256=TgqFGb83HnuYGretCWEUGrkNLXg0KvPtCs46_g2f-ik,2587
|
6
6
|
usso/auth/config.py,sha256=6tdnIg8iCrksuJGzpliw6QhRc8XsDUMR-dX0XY6QLHU,3833
|
7
7
|
usso/integrations/django/__init__.py,sha256=dKpbffHS5ouGtW6ooI2ivzjPmH_1rOBny85htR-KqrY,97
|
8
8
|
usso/integrations/django/middleware.py,sha256=8b-VYQ3FRhLnXSl4ZfHBpiA6VLY4b7b0-YoE_X41SFM,3443
|
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=
|
12
|
+
usso/models/user.py,sha256=phsfgRlR14y7--lBnfKFA_omkNI30hU--dSLMjYOi4E,3554
|
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=
|
15
|
+
usso/session/base_session.py,sha256=4pbydSGf6IJ2yjQK31b8OZa0-QX01OPjFroU2eQrzZw,2558
|
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.
|
21
|
-
usso-0.28.
|
22
|
-
usso-0.28.
|
23
|
-
usso-0.28.
|
24
|
-
usso-0.28.
|
25
|
-
usso-0.28.
|
20
|
+
usso-0.28.4.dist-info/licenses/LICENSE.txt,sha256=ceC9ZJOV9H6CtQDcYmHOS46NA3dHJ_WD4J9blH513pc,1081
|
21
|
+
usso-0.28.4.dist-info/METADATA,sha256=N1wcr2FUcCfjkvy-ieFnlYPHcjdiaUfTRmIXe5RScgo,4846
|
22
|
+
usso-0.28.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
23
|
+
usso-0.28.4.dist-info/entry_points.txt,sha256=4Zgpm5ELaAWPf0jPGJFz1_X69H7un8ycT3WdGoJ0Vvk,35
|
24
|
+
usso-0.28.4.dist-info/top_level.txt,sha256=g9Jf6h1Oyidh0vPiFni7UHInTJjSvu6cUalpLTIvthg,5
|
25
|
+
usso-0.28.4.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|