usso 0.28.20__py3-none-any.whl → 0.28.22__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.
@@ -1,5 +1,4 @@
1
1
  import fnmatch
2
- import logging
3
2
  from urllib.parse import parse_qs
4
3
 
5
4
  PRIVILEGE_LEVELS = {
@@ -120,7 +119,7 @@ def is_path_match(
120
119
  return True
121
120
 
122
121
 
123
- def is_filter_match(user_filters: dict, requested_filters: dict):
122
+ def is_filter_match(user_filters: dict, requested_filters: dict) -> bool:
124
123
  """All user filters must match requested filters."""
125
124
  for k, v in user_filters.items():
126
125
  if k not in requested_filters or not fnmatch.fnmatch(
@@ -137,7 +136,7 @@ def is_authorized(
137
136
  reuested_filter: dict[str, str] | None = None,
138
137
  *,
139
138
  strict: bool = False,
140
- ):
139
+ ) -> bool:
141
140
  user_action, user_path, user_filters = parse_scope(user_scope)
142
141
 
143
142
  if not is_path_match(user_path, requested_path, strict=strict):
@@ -161,7 +160,7 @@ def check_access(
161
160
  *,
162
161
  filters: list[dict[str, str]] | dict[str, str] | None = None,
163
162
  strict: bool = False,
164
- ):
163
+ ) -> bool:
165
164
  """
166
165
  Check if the user has the required access to a resource.
167
166
 
@@ -189,7 +188,6 @@ def check_access(
189
188
  strict=strict,
190
189
  ):
191
190
  return True
192
- print(f"auth failed {filter}, {scope}")
193
191
 
194
192
  return False
195
193
 
@@ -215,8 +213,6 @@ def is_subset_scope(*, subset_scope: str, super_scope: str) -> bool:
215
213
  if child_filters.get(k) != v:
216
214
  return False
217
215
 
218
- logging.error(f"{parent_level}, {child_level}")
219
-
220
216
  return True
221
217
 
222
218
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: usso
3
- Version: 0.28.20
3
+ Version: 0.28.22
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=a_XW0rRK_rJ5tO0bzYFB07saRKc2PZfLXaUhitznAy0,7066
5
+ usso/auth/authorization.py,sha256=a71VKLfjAZXXGGx1x5eAhNKVdeKQxd-bvOgL-wocgPY,6970
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.20.dist-info/licenses/LICENSE.txt,sha256=ceC9ZJOV9H6CtQDcYmHOS46NA3dHJ_WD4J9blH513pc,1081
22
- usso-0.28.20.dist-info/METADATA,sha256=Ft11FA6MTI67WsaChYkiKQmD7YOD_STtrzR1Pyn8QCo,5061
23
- usso-0.28.20.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
24
- usso-0.28.20.dist-info/entry_points.txt,sha256=4Zgpm5ELaAWPf0jPGJFz1_X69H7un8ycT3WdGoJ0Vvk,35
25
- usso-0.28.20.dist-info/top_level.txt,sha256=g9Jf6h1Oyidh0vPiFni7UHInTJjSvu6cUalpLTIvthg,5
26
- usso-0.28.20.dist-info/RECORD,,
21
+ usso-0.28.22.dist-info/licenses/LICENSE.txt,sha256=ceC9ZJOV9H6CtQDcYmHOS46NA3dHJ_WD4J9blH513pc,1081
22
+ usso-0.28.22.dist-info/METADATA,sha256=qkMvwYVGxju0Tmb0WUhys3lEiPIV27hhhskCXixYjlg,5061
23
+ usso-0.28.22.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
24
+ usso-0.28.22.dist-info/entry_points.txt,sha256=4Zgpm5ELaAWPf0jPGJFz1_X69H7un8ycT3WdGoJ0Vvk,35
25
+ usso-0.28.22.dist-info/top_level.txt,sha256=g9Jf6h1Oyidh0vPiFni7UHInTJjSvu6cUalpLTIvthg,5
26
+ usso-0.28.22.dist-info/RECORD,,
File without changes