usso 0.21.1__py3-none-any.whl → 0.21.2__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/api.py +0 -1
- usso/core.py +8 -8
- usso/fastapi/integration.py +0 -1
- usso/session.py +5 -2
- {usso-0.21.1.dist-info → usso-0.21.2.dist-info}/METADATA +1 -1
- usso-0.21.2.dist-info/RECORD +15 -0
- usso-0.21.1.dist-info/RECORD +0 -15
- {usso-0.21.1.dist-info → usso-0.21.2.dist-info}/LICENSE.txt +0 -0
- {usso-0.21.1.dist-info → usso-0.21.2.dist-info}/WHEEL +0 -0
- {usso-0.21.1.dist-info → usso-0.21.2.dist-info}/entry_points.txt +0 -0
- {usso-0.21.1.dist-info → usso-0.21.2.dist-info}/top_level.txt +0 -0
usso/api.py
CHANGED
usso/core.py
CHANGED
@@ -79,40 +79,40 @@ class Usso(metaclass=Singleton):
|
|
79
79
|
decoded["token"] = token
|
80
80
|
return UserData(**decoded)
|
81
81
|
except jwt.exceptions.ExpiredSignatureError:
|
82
|
-
if kwargs.get("raise_exception"):
|
82
|
+
if kwargs.get("raise_exception", True):
|
83
83
|
raise USSOException(status_code=401, error="expired_signature")
|
84
84
|
except jwt.exceptions.InvalidSignatureError:
|
85
|
-
if kwargs.get("raise_exception"):
|
85
|
+
if kwargs.get("raise_exception", True):
|
86
86
|
raise USSOException(status_code=401, error="invalid_signature")
|
87
87
|
except jwt.exceptions.InvalidAlgorithmError:
|
88
|
-
if kwargs.get("raise_exception"):
|
88
|
+
if kwargs.get("raise_exception", True):
|
89
89
|
raise USSOException(
|
90
90
|
status_code=401,
|
91
91
|
error="invalid_algorithm",
|
92
92
|
)
|
93
93
|
except jwt.exceptions.InvalidIssuedAtError:
|
94
|
-
if kwargs.get("raise_exception"):
|
94
|
+
if kwargs.get("raise_exception", True):
|
95
95
|
raise USSOException(
|
96
96
|
status_code=401,
|
97
97
|
error="invalid_issued_at",
|
98
98
|
)
|
99
99
|
except jwt.exceptions.InvalidTokenError:
|
100
|
-
if kwargs.get("raise_exception"):
|
100
|
+
if kwargs.get("raise_exception", True):
|
101
101
|
raise USSOException(
|
102
102
|
status_code=401,
|
103
103
|
error="invalid_token",
|
104
104
|
)
|
105
105
|
except jwt.exceptions.InvalidKeyError:
|
106
|
-
if kwargs.get("raise_exception"):
|
106
|
+
if kwargs.get("raise_exception", True):
|
107
107
|
raise USSOException(
|
108
108
|
status_code=401,
|
109
109
|
error="invalid_key",
|
110
110
|
)
|
111
111
|
except USSOException as e:
|
112
|
-
if kwargs.get("raise_exception"):
|
112
|
+
if kwargs.get("raise_exception", True):
|
113
113
|
raise e
|
114
114
|
except Exception as e:
|
115
|
-
if kwargs.get("raise_exception"):
|
115
|
+
if kwargs.get("raise_exception", True):
|
116
116
|
raise USSOException(
|
117
117
|
status_code=401,
|
118
118
|
error="error",
|
usso/fastapi/integration.py
CHANGED
usso/session.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
from datetime import datetime
|
2
|
-
|
2
|
+
|
3
3
|
import jwt
|
4
|
+
import requests
|
4
5
|
|
5
6
|
|
6
7
|
class UssoSession:
|
@@ -23,7 +24,9 @@ class UssoSession:
|
|
23
24
|
|
24
25
|
def get_session(self):
|
25
26
|
if self.access_token:
|
26
|
-
decoded_token = jwt.decode(
|
27
|
+
decoded_token = jwt.decode(
|
28
|
+
self.access_token, options={"verify_signature": False}
|
29
|
+
)
|
27
30
|
exp = datetime.fromtimestamp(decoded_token.get("exp"))
|
28
31
|
if exp < datetime.now():
|
29
32
|
self.access_token = None
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: usso
|
3
|
-
Version: 0.21.
|
3
|
+
Version: 0.21.2
|
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>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
usso/__init__.py,sha256=RN0E6HI9kHedvDxheDPVWiAmh-169IrhXfvq_sHphQc,65
|
2
|
+
usso/api.py,sha256=MnUg-DcrmMXW1CxEcRlJQhIYl5J1WKvjqHQOz7jsrwE,5137
|
3
|
+
usso/b64tools.py,sha256=7lsz_Rn6PITkKWfjcebmewdhvFs2A7H4t_WE33MgZ0Y,626
|
4
|
+
usso/core.py,sha256=bJPKxJLcYe5zWoiNM_n9ajHSP5bARN8u9tsRQ6fLnyA,3998
|
5
|
+
usso/exceptions.py,sha256=hawOAuVbvQtjgRfwp1KFZ4SmV7fh720y5Gom9JVA8W8,504
|
6
|
+
usso/package_data.dat,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
7
|
+
usso/session.py,sha256=S3dFXzar0Pcwxj5TGqadKwGdmzmzgp4H2W3brfOwJ6A,1184
|
8
|
+
usso/fastapi/__init__.py,sha256=TRTDVJo8bwZQDAuCQFhh-g1XbIspf6TdFYXGAO5cgAU,130
|
9
|
+
usso/fastapi/integration.py,sha256=-zW3dwyvnVx59DgtV8JKL6YwG_ksFY2dOMwZAtwmEmY,1816
|
10
|
+
usso-0.21.2.dist-info/LICENSE.txt,sha256=ceC9ZJOV9H6CtQDcYmHOS46NA3dHJ_WD4J9blH513pc,1081
|
11
|
+
usso-0.21.2.dist-info/METADATA,sha256=8SFgZ3XwcJmXcqVeUop5ziHwRivUMn2ilTQjWgwFqR4,4234
|
12
|
+
usso-0.21.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
13
|
+
usso-0.21.2.dist-info/entry_points.txt,sha256=4Zgpm5ELaAWPf0jPGJFz1_X69H7un8ycT3WdGoJ0Vvk,35
|
14
|
+
usso-0.21.2.dist-info/top_level.txt,sha256=g9Jf6h1Oyidh0vPiFni7UHInTJjSvu6cUalpLTIvthg,5
|
15
|
+
usso-0.21.2.dist-info/RECORD,,
|
usso-0.21.1.dist-info/RECORD
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
usso/__init__.py,sha256=RN0E6HI9kHedvDxheDPVWiAmh-169IrhXfvq_sHphQc,65
|
2
|
-
usso/api.py,sha256=5bV82j8iPY0nxA7c5gZ8sFFZDm6KUdoG55ISuML3Ovc,5138
|
3
|
-
usso/b64tools.py,sha256=7lsz_Rn6PITkKWfjcebmewdhvFs2A7H4t_WE33MgZ0Y,626
|
4
|
-
usso/core.py,sha256=SCoN3GmUpj-AK6iFhmKquldfsiXtpJ6whGWKzk5NYFo,3950
|
5
|
-
usso/exceptions.py,sha256=hawOAuVbvQtjgRfwp1KFZ4SmV7fh720y5Gom9JVA8W8,504
|
6
|
-
usso/package_data.dat,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
7
|
-
usso/session.py,sha256=628drsoN0WTPZCiBAHKQUQcWlQuUnsEzvDkQ0uyVPRA,1153
|
8
|
-
usso/fastapi/__init__.py,sha256=TRTDVJo8bwZQDAuCQFhh-g1XbIspf6TdFYXGAO5cgAU,130
|
9
|
-
usso/fastapi/integration.py,sha256=NnySMqa-IKKYCi89m8Nrj2CD5xhBN_Kta74_Z_7FTI0,1817
|
10
|
-
usso-0.21.1.dist-info/LICENSE.txt,sha256=ceC9ZJOV9H6CtQDcYmHOS46NA3dHJ_WD4J9blH513pc,1081
|
11
|
-
usso-0.21.1.dist-info/METADATA,sha256=1IKuybfnEHHVMo-LrcO8Pfwb3sox50M9qpXKpjEuTUY,4234
|
12
|
-
usso-0.21.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
13
|
-
usso-0.21.1.dist-info/entry_points.txt,sha256=4Zgpm5ELaAWPf0jPGJFz1_X69H7un8ycT3WdGoJ0Vvk,35
|
14
|
-
usso-0.21.1.dist-info/top_level.txt,sha256=g9Jf6h1Oyidh0vPiFni7UHInTJjSvu6cUalpLTIvthg,5
|
15
|
-
usso-0.21.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|