usso 0.28.19__py3-none-any.whl → 0.28.21__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/authorization.py +16 -9
- {usso-0.28.19.dist-info → usso-0.28.21.dist-info}/METADATA +1 -1
- {usso-0.28.19.dist-info → usso-0.28.21.dist-info}/RECORD +7 -7
- {usso-0.28.19.dist-info → usso-0.28.21.dist-info}/WHEEL +0 -0
- {usso-0.28.19.dist-info → usso-0.28.21.dist-info}/entry_points.txt +0 -0
- {usso-0.28.19.dist-info → usso-0.28.21.dist-info}/licenses/LICENSE.txt +0 -0
- {usso-0.28.19.dist-info → usso-0.28.21.dist-info}/top_level.txt +0 -0
usso/auth/authorization.py
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
import fnmatch
|
2
|
-
import
|
3
|
-
from urllib.parse import parse_qs, urlparse
|
2
|
+
from urllib.parse import parse_qs
|
4
3
|
|
5
4
|
PRIVILEGE_LEVELS = {
|
6
5
|
"read": 10,
|
@@ -33,12 +32,22 @@ def parse_scope(scope: str) -> tuple[str, list[str], dict[str, str]]:
|
|
33
32
|
- filters: dict[str, str]
|
34
33
|
"""
|
35
34
|
|
36
|
-
|
37
|
-
|
38
|
-
|
35
|
+
colon_idx = scope.find(":")
|
36
|
+
question_idx = scope.find("?")
|
37
|
+
if question_idx == -1:
|
38
|
+
question_idx = len(scope)
|
39
|
+
|
40
|
+
if colon_idx != -1 and colon_idx < question_idx:
|
41
|
+
action = scope[:colon_idx]
|
42
|
+
resource_path = scope[colon_idx + 1 : question_idx]
|
43
|
+
else:
|
44
|
+
action = ""
|
45
|
+
resource_path = scope[:question_idx]
|
46
|
+
|
47
|
+
query = scope[question_idx + 1 :]
|
39
48
|
filters = {k: v[0] for k, v in parse_qs(query).items()}
|
40
|
-
|
41
|
-
return
|
49
|
+
resource_path_parts = resource_path.split("/") if resource_path else ["*"]
|
50
|
+
return action, resource_path_parts, filters
|
42
51
|
|
43
52
|
|
44
53
|
def is_path_match(
|
@@ -205,8 +214,6 @@ def is_subset_scope(*, subset_scope: str, super_scope: str) -> bool:
|
|
205
214
|
if child_filters.get(k) != v:
|
206
215
|
return False
|
207
216
|
|
208
|
-
logging.error(f"{parent_level}, {child_level}")
|
209
|
-
|
210
217
|
return True
|
211
218
|
|
212
219
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: usso
|
3
|
-
Version: 0.28.
|
3
|
+
Version: 0.28.21
|
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>
|
@@ -2,7 +2,7 @@ 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=EIW9yCOu52EzF9I16yOmBHtIJQAXZ6YhMwJUsBtuWVA,1162
|
5
|
-
usso/auth/authorization.py,sha256=
|
5
|
+
usso/auth/authorization.py,sha256=ppLdqrYxHmXXdOEEGeto9nQNkJqTSlRYnLoLSwS-7BE,6998
|
6
6
|
usso/auth/client.py,sha256=WFB7I9_fzr_P-oK_elaiCe5EIZZ9kY_LkkJls6BGWZk,2645
|
7
7
|
usso/auth/config.py,sha256=SQMr6Y0zJFA9jvx8UKKv6PPJ0GVBzlwKXfAhwQn2fjU,3750
|
8
8
|
usso/integrations/django/__init__.py,sha256=dKpbffHS5ouGtW6ooI2ivzjPmH_1rOBny85htR-KqrY,97
|
@@ -18,9 +18,9 @@ usso/session/session.py,sha256=briCgDMoF-b59H6Aie_Lmjy4qnPBBSmKnVhAwef34F0,1637
|
|
18
18
|
usso/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
19
19
|
usso/utils/method_utils.py,sha256=1NMN4le04PWXDSJZK-nf7q2IFqOMkwYcCnslFXAzlH8,355
|
20
20
|
usso/utils/string_utils.py,sha256=7tziAa2Cwa7xhwM_NF4DSY3BHoqVaWgJ21VuV8LvhrY,253
|
21
|
-
usso-0.28.
|
22
|
-
usso-0.28.
|
23
|
-
usso-0.28.
|
24
|
-
usso-0.28.
|
25
|
-
usso-0.28.
|
26
|
-
usso-0.28.
|
21
|
+
usso-0.28.21.dist-info/licenses/LICENSE.txt,sha256=ceC9ZJOV9H6CtQDcYmHOS46NA3dHJ_WD4J9blH513pc,1081
|
22
|
+
usso-0.28.21.dist-info/METADATA,sha256=KVcfZRc0IeWh_2lxyiE3tAuNFzXl8gqIgmJYHZErEHA,5061
|
23
|
+
usso-0.28.21.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
24
|
+
usso-0.28.21.dist-info/entry_points.txt,sha256=4Zgpm5ELaAWPf0jPGJFz1_X69H7un8ycT3WdGoJ0Vvk,35
|
25
|
+
usso-0.28.21.dist-info/top_level.txt,sha256=g9Jf6h1Oyidh0vPiFni7UHInTJjSvu6cUalpLTIvthg,5
|
26
|
+
usso-0.28.21.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|