usso 0.24.3__tar.gz → 0.24.5__tar.gz

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.
Files changed (27) hide show
  1. {usso-0.24.3/src/usso.egg-info → usso-0.24.5}/PKG-INFO +1 -1
  2. {usso-0.24.3 → usso-0.24.5}/pyproject.toml +1 -1
  3. {usso-0.24.3 → usso-0.24.5}/src/usso/django/middleware.py +2 -1
  4. {usso-0.24.3 → usso-0.24.5}/src/usso/fastapi/integration.py +2 -0
  5. {usso-0.24.3 → usso-0.24.5/src/usso.egg-info}/PKG-INFO +1 -1
  6. {usso-0.24.3 → usso-0.24.5}/LICENSE.txt +0 -0
  7. {usso-0.24.3 → usso-0.24.5}/README.md +0 -0
  8. {usso-0.24.3 → usso-0.24.5}/setup.cfg +0 -0
  9. {usso-0.24.3 → usso-0.24.5}/src/usso/__init__.py +0 -0
  10. {usso-0.24.3 → usso-0.24.5}/src/usso/api.py +0 -0
  11. {usso-0.24.3 → usso-0.24.5}/src/usso/async_api.py +0 -0
  12. {usso-0.24.3 → usso-0.24.5}/src/usso/async_session.py +0 -0
  13. {usso-0.24.3 → usso-0.24.5}/src/usso/b64tools.py +0 -0
  14. {usso-0.24.3 → usso-0.24.5}/src/usso/core.py +0 -0
  15. {usso-0.24.3 → usso-0.24.5}/src/usso/django/__init__.py +0 -0
  16. {usso-0.24.3 → usso-0.24.5}/src/usso/exceptions.py +0 -0
  17. {usso-0.24.3 → usso-0.24.5}/src/usso/fastapi/__init__.py +0 -0
  18. {usso-0.24.3 → usso-0.24.5}/src/usso/package_data.dat +0 -0
  19. {usso-0.24.3 → usso-0.24.5}/src/usso/session.py +0 -0
  20. {usso-0.24.3 → usso-0.24.5}/src/usso.egg-info/SOURCES.txt +0 -0
  21. {usso-0.24.3 → usso-0.24.5}/src/usso.egg-info/dependency_links.txt +0 -0
  22. {usso-0.24.3 → usso-0.24.5}/src/usso.egg-info/entry_points.txt +0 -0
  23. {usso-0.24.3 → usso-0.24.5}/src/usso.egg-info/requires.txt +0 -0
  24. {usso-0.24.3 → usso-0.24.5}/src/usso.egg-info/top_level.txt +0 -0
  25. {usso-0.24.3 → usso-0.24.5}/tests/test_api.py +0 -0
  26. {usso-0.24.3 → usso-0.24.5}/tests/test_core.py +0 -0
  27. {usso-0.24.3 → usso-0.24.5}/tests/test_simple.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: usso
3
- Version: 0.24.3
3
+ Version: 0.24.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>
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "usso"
7
- version = "0.24.3"
7
+ version = "0.24.5"
8
8
  description = "A plug-and-play client for integrating universal single sign-on (SSO) with Python frameworks, enabling secure and seamless authentication across microservices."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -19,13 +19,14 @@ class USSOAuthenticationMiddleware(MiddlewareMixin):
19
19
  Middleware to authenticate users by JWT token and create or return a user in the database.
20
20
  """
21
21
  try:
22
- if request.user.is_authenticated:
22
+ if hasattr(request, "user") and request.user.is_authenticated:
23
23
  return
24
24
 
25
25
  user_data = self.jwt_access_security_none(request)
26
26
  if user_data:
27
27
  user = self.get_or_create_user(user_data)
28
28
  request.user = user
29
+ request._dont_enforce_csrf_checks = True
29
30
  except USSOException as e:
30
31
  # Handle any errors raised by USSO authentication
31
32
  return JsonResponse({"error": str(e)}, status=401)
@@ -11,6 +11,8 @@ logger = logging.getLogger("usso")
11
11
 
12
12
  def get_request_token(request: Request | WebSocket) -> UserData | None:
13
13
  authorization = request.headers.get("Authorization")
14
+ token = None
15
+
14
16
  if authorization:
15
17
  scheme, credentials = Usso().get_authorization_scheme_param(authorization)
16
18
  if scheme.lower() == "bearer":
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: usso
3
- Version: 0.24.3
3
+ Version: 0.24.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>
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes