usso 0.27.4__tar.gz → 0.27.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 (30) hide show
  1. {usso-0.27.4/src/usso.egg-info → usso-0.27.5}/PKG-INFO +1 -1
  2. {usso-0.27.4 → usso-0.27.5}/pyproject.toml +1 -1
  3. {usso-0.27.4 → usso-0.27.5}/src/usso/exceptions.py +1 -0
  4. {usso-0.27.4 → usso-0.27.5}/src/usso/fastapi/integration.py +8 -0
  5. {usso-0.27.4 → usso-0.27.5/src/usso.egg-info}/PKG-INFO +1 -1
  6. {usso-0.27.4 → usso-0.27.5}/LICENSE.txt +0 -0
  7. {usso-0.27.4 → usso-0.27.5}/README.md +0 -0
  8. {usso-0.27.4 → usso-0.27.5}/setup.cfg +0 -0
  9. {usso-0.27.4 → usso-0.27.5}/src/usso/__init__.py +0 -0
  10. {usso-0.27.4 → usso-0.27.5}/src/usso/b64tools.py +0 -0
  11. {usso-0.27.4 → usso-0.27.5}/src/usso/client/__init__.py +0 -0
  12. {usso-0.27.4 → usso-0.27.5}/src/usso/client/api.py +0 -0
  13. {usso-0.27.4 → usso-0.27.5}/src/usso/client/async_api.py +0 -0
  14. {usso-0.27.4 → usso-0.27.5}/src/usso/core.py +0 -0
  15. {usso-0.27.4 → usso-0.27.5}/src/usso/django/__init__.py +0 -0
  16. {usso-0.27.4 → usso-0.27.5}/src/usso/django/middleware.py +0 -0
  17. {usso-0.27.4 → usso-0.27.5}/src/usso/fastapi/__init__.py +0 -0
  18. {usso-0.27.4 → usso-0.27.5}/src/usso/schemas.py +0 -0
  19. {usso-0.27.4 → usso-0.27.5}/src/usso/session/__init__.py +0 -0
  20. {usso-0.27.4 → usso-0.27.5}/src/usso/session/async_session.py +0 -0
  21. {usso-0.27.4 → usso-0.27.5}/src/usso/session/base_session.py +0 -0
  22. {usso-0.27.4 → usso-0.27.5}/src/usso/session/session.py +0 -0
  23. {usso-0.27.4 → usso-0.27.5}/src/usso.egg-info/SOURCES.txt +0 -0
  24. {usso-0.27.4 → usso-0.27.5}/src/usso.egg-info/dependency_links.txt +0 -0
  25. {usso-0.27.4 → usso-0.27.5}/src/usso.egg-info/entry_points.txt +0 -0
  26. {usso-0.27.4 → usso-0.27.5}/src/usso.egg-info/requires.txt +0 -0
  27. {usso-0.27.4 → usso-0.27.5}/src/usso.egg-info/top_level.txt +0 -0
  28. {usso-0.27.4 → usso-0.27.5}/tests/test_api.py +0 -0
  29. {usso-0.27.4 → usso-0.27.5}/tests/test_core.py +0 -0
  30. {usso-0.27.4 → usso-0.27.5}/tests/test_simple.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: usso
3
- Version: 0.27.4
3
+ Version: 0.27.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.27.4"
7
+ version = "0.27.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"
@@ -14,3 +14,4 @@ class USSOException(Exception):
14
14
  if message is None:
15
15
  self.message = error_messages[error]
16
16
  super().__init__(message)
17
+
@@ -1,6 +1,7 @@
1
1
  import logging
2
2
 
3
3
  from fastapi import Request, WebSocket
4
+ from fastapi.responses import JSONResponse
4
5
  from starlette.status import HTTP_401_UNAUTHORIZED
5
6
 
6
7
  from usso.exceptions import USSOException
@@ -73,3 +74,10 @@ def jwt_access_security_ws(websocket: WebSocket, jwt_config=None) -> UserData |
73
74
  )
74
75
 
75
76
  return Usso(jwt_config=jwt_config).user_data_from_token(token)
77
+
78
+
79
+ async def usso_exception_handler(request: Request, exc: USSOException):
80
+ return JSONResponse(
81
+ status_code=exc.status_code,
82
+ content={"message": exc.message, "error": exc.error},
83
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: usso
3
- Version: 0.27.4
3
+ Version: 0.27.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