usso 0.20.4__py3-none-any.whl → 0.20.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/api.py +12 -8
- {usso-0.20.4.dist-info → usso-0.20.5.dist-info}/METADATA +2 -4
- {usso-0.20.4.dist-info → usso-0.20.5.dist-info}/RECORD +7 -7
- {usso-0.20.4.dist-info → usso-0.20.5.dist-info}/LICENSE.txt +0 -0
- {usso-0.20.4.dist-info → usso-0.20.5.dist-info}/WHEEL +0 -0
- {usso-0.20.4.dist-info → usso-0.20.5.dist-info}/entry_points.txt +0 -0
- {usso-0.20.4.dist-info → usso-0.20.5.dist-info}/top_level.txt +0 -0
usso/api.py
CHANGED
@@ -73,22 +73,28 @@ class UssoAPI(metaclass=Singleton):
|
|
73
73
|
)
|
74
74
|
if kwargs.get("raise_exception", True):
|
75
75
|
try:
|
76
|
+
resp_json = resp.json()
|
76
77
|
resp.raise_for_status()
|
77
78
|
except requests.HTTPError as e:
|
78
79
|
logging.error(f"Error: {e}")
|
79
|
-
logging.error(f"Response: {
|
80
|
+
logging.error(f"Response: {resp_json}")
|
81
|
+
raise e
|
82
|
+
except Exception as e:
|
83
|
+
logging.error(f"Error: {e}")
|
84
|
+
logging.error(f"Response: {resp.text()}")
|
80
85
|
raise e
|
81
86
|
return resp.json()
|
82
87
|
|
83
88
|
def get_users(self, **kwargs) -> list[UserData]:
|
84
89
|
users_dict = self._request(endpoint="website/users", **kwargs)
|
85
90
|
|
86
|
-
return [
|
87
|
-
UserData(user_id=user.get("uid"), **user) for user in users_dict
|
88
|
-
]
|
91
|
+
return [UserData(user_id=user.get("uid"), **user) for user in users_dict]
|
89
92
|
|
90
93
|
def get_user(self, user_id: str, **kwargs) -> UserData:
|
91
|
-
user_dict = self._request(
|
94
|
+
user_dict = self._request(
|
95
|
+
endpoint=f"website/users/{user_id}",
|
96
|
+
**kwargs,
|
97
|
+
)
|
92
98
|
return UserData(user_id=user_dict.get("uid"), **user_dict)
|
93
99
|
|
94
100
|
def get_user_by_credentials(self, credentials: dict, **kwargs) -> UserData:
|
@@ -138,9 +144,7 @@ class UssoAPI(metaclass=Singleton):
|
|
138
144
|
return UserData(user_id=user_dict.get("uid"), **user_dict)
|
139
145
|
|
140
146
|
def get_user_payload(self, user_id: str, **kwargs) -> dict:
|
141
|
-
return self._request(
|
142
|
-
endpoint=f"website/users/{user_id}/payload", **kwargs
|
143
|
-
)
|
147
|
+
return self._request(endpoint=f"website/users/{user_id}/payload", **kwargs)
|
144
148
|
|
145
149
|
def update_user_payload(
|
146
150
|
self,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: usso
|
3
|
-
Version: 0.20.
|
3
|
+
Version: 0.20.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>
|
@@ -35,13 +35,11 @@ Classifier: Intended Audience :: Developers
|
|
35
35
|
Classifier: Topic :: Software Development :: Build Tools
|
36
36
|
Classifier: License :: OSI Approved :: MIT License
|
37
37
|
Classifier: Programming Language :: Python :: 3
|
38
|
-
Classifier: Programming Language :: Python :: 3.8
|
39
|
-
Classifier: Programming Language :: Python :: 3.9
|
40
38
|
Classifier: Programming Language :: Python :: 3.10
|
41
39
|
Classifier: Programming Language :: Python :: 3.11
|
42
40
|
Classifier: Programming Language :: Python :: 3.12
|
43
41
|
Classifier: Programming Language :: Python :: 3 :: Only
|
44
|
-
Requires-Python: >=3.
|
42
|
+
Requires-Python: >=3.9
|
45
43
|
Description-Content-Type: text/markdown
|
46
44
|
License-File: LICENSE.txt
|
47
45
|
Requires-Dist: peppercorn
|
@@ -1,14 +1,14 @@
|
|
1
1
|
usso/__init__.py,sha256=RN0E6HI9kHedvDxheDPVWiAmh-169IrhXfvq_sHphQc,65
|
2
|
-
usso/api.py,sha256=
|
2
|
+
usso/api.py,sha256=veAA0S-ae7GiwjU5S2RDYHM_k98yrYzcduETBQOFBIU,5096
|
3
3
|
usso/b64tools.py,sha256=6YCBx2lLaYFdk36f064VNZ1RejJTHtmgxqq0eT1sCwQ,518
|
4
4
|
usso/core.py,sha256=JQbwx6u53epwurBeSPOA5JHccRCf-bsz-9oQrVBr2t0,3048
|
5
5
|
usso/exceptions.py,sha256=hawOAuVbvQtjgRfwp1KFZ4SmV7fh720y5Gom9JVA8W8,504
|
6
6
|
usso/package_data.dat,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
7
7
|
usso/fastapi/__init__.py,sha256=TRTDVJo8bwZQDAuCQFhh-g1XbIspf6TdFYXGAO5cgAU,130
|
8
8
|
usso/fastapi/integration.py,sha256=9Q10dfy8UagOkmG49-Ar0mj6PPsiKS8ioLFgBIREpWQ,1823
|
9
|
-
usso-0.20.
|
10
|
-
usso-0.20.
|
11
|
-
usso-0.20.
|
12
|
-
usso-0.20.
|
13
|
-
usso-0.20.
|
14
|
-
usso-0.20.
|
9
|
+
usso-0.20.5.dist-info/LICENSE.txt,sha256=ceC9ZJOV9H6CtQDcYmHOS46NA3dHJ_WD4J9blH513pc,1081
|
10
|
+
usso-0.20.5.dist-info/METADATA,sha256=_zHYZyWiQBPC72q1WkXZCsIrXsTUr2zzm5SHUW-0ex0,4234
|
11
|
+
usso-0.20.5.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
12
|
+
usso-0.20.5.dist-info/entry_points.txt,sha256=4Zgpm5ELaAWPf0jPGJFz1_X69H7un8ycT3WdGoJ0Vvk,35
|
13
|
+
usso-0.20.5.dist-info/top_level.txt,sha256=g9Jf6h1Oyidh0vPiFni7UHInTJjSvu6cUalpLTIvthg,5
|
14
|
+
usso-0.20.5.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|