usso 0.28.13__tar.gz → 0.28.14__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 (33) hide show
  1. {usso-0.28.13/src/usso.egg-info → usso-0.28.14}/PKG-INFO +1 -1
  2. {usso-0.28.13 → usso-0.28.14}/pyproject.toml +1 -1
  3. {usso-0.28.13 → usso-0.28.14}/src/usso/integrations/fastapi/dependency.py +8 -2
  4. {usso-0.28.13 → usso-0.28.14/src/usso.egg-info}/PKG-INFO +1 -1
  5. {usso-0.28.13 → usso-0.28.14}/LICENSE.txt +0 -0
  6. {usso-0.28.13 → usso-0.28.14}/MANIFEST.in +0 -0
  7. {usso-0.28.13 → usso-0.28.14}/README.md +0 -0
  8. {usso-0.28.13 → usso-0.28.14}/pytest.ini +0 -0
  9. {usso-0.28.13 → usso-0.28.14}/setup.cfg +0 -0
  10. {usso-0.28.13 → usso-0.28.14}/src/usso/__init__.py +0 -0
  11. {usso-0.28.13 → usso-0.28.14}/src/usso/auth/__init__.py +0 -0
  12. {usso-0.28.13 → usso-0.28.14}/src/usso/auth/api_key.py +0 -0
  13. {usso-0.28.13 → usso-0.28.14}/src/usso/auth/client.py +0 -0
  14. {usso-0.28.13 → usso-0.28.14}/src/usso/auth/config.py +0 -0
  15. {usso-0.28.13 → usso-0.28.14}/src/usso/exceptions.py +0 -0
  16. {usso-0.28.13 → usso-0.28.14}/src/usso/integrations/django/__init__.py +0 -0
  17. {usso-0.28.13 → usso-0.28.14}/src/usso/integrations/django/middleware.py +0 -0
  18. {usso-0.28.13 → usso-0.28.14}/src/usso/integrations/fastapi/__init__.py +0 -0
  19. {usso-0.28.13 → usso-0.28.14}/src/usso/integrations/fastapi/handler.py +0 -0
  20. {usso-0.28.13 → usso-0.28.14}/src/usso/models/user.py +0 -0
  21. {usso-0.28.13 → usso-0.28.14}/src/usso/session/__init__.py +0 -0
  22. {usso-0.28.13 → usso-0.28.14}/src/usso/session/async_session.py +0 -0
  23. {usso-0.28.13 → usso-0.28.14}/src/usso/session/base_session.py +0 -0
  24. {usso-0.28.13 → usso-0.28.14}/src/usso/session/session.py +0 -0
  25. {usso-0.28.13 → usso-0.28.14}/src/usso/utils/__init__.py +0 -0
  26. {usso-0.28.13 → usso-0.28.14}/src/usso/utils/method_utils.py +0 -0
  27. {usso-0.28.13 → usso-0.28.14}/src/usso/utils/string_utils.py +0 -0
  28. {usso-0.28.13 → usso-0.28.14}/src/usso.egg-info/SOURCES.txt +0 -0
  29. {usso-0.28.13 → usso-0.28.14}/src/usso.egg-info/dependency_links.txt +0 -0
  30. {usso-0.28.13 → usso-0.28.14}/src/usso.egg-info/entry_points.txt +0 -0
  31. {usso-0.28.13 → usso-0.28.14}/src/usso.egg-info/requires.txt +0 -0
  32. {usso-0.28.13 → usso-0.28.14}/src/usso.egg-info/top_level.txt +0 -0
  33. {usso-0.28.13 → usso-0.28.14}/tests/test_fastapi.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: usso
3
- Version: 0.28.13
3
+ Version: 0.28.14
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.28.13"
7
+ version = "0.28.14"
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"
@@ -16,12 +16,14 @@ class USSOAuthentication(UssoAuth):
16
16
  self,
17
17
  jwt_config: AvailableJwtConfigs | None = None,
18
18
  raise_exception: bool = True,
19
+ expected_token_type: str = "access",
19
20
  ):
20
21
  if jwt_config is None:
21
22
  jwt_config = AuthConfig()
22
23
 
23
24
  super().__init__(jwt_config=jwt_config)
24
25
  self.raise_exception = raise_exception
26
+ self.expected_token_type = expected_token_type
25
27
 
26
28
  def __call__(self, request: Request) -> UserData:
27
29
  return self.usso_access_security(request)
@@ -52,7 +54,9 @@ class USSOAuthentication(UssoAuth):
52
54
  token = self.get_request_jwt(request)
53
55
  if token:
54
56
  return self.user_data_from_token(
55
- token, raise_exception=self.raise_exception
57
+ token,
58
+ raise_exception=self.raise_exception,
59
+ expected_token_type=self.expected_token_type,
56
60
  )
57
61
 
58
62
  _handle_exception(
@@ -71,7 +75,9 @@ class USSOAuthentication(UssoAuth):
71
75
  token = self.get_request_jwt(websocket)
72
76
  if token:
73
77
  return self.user_data_from_token(
74
- token, raise_exception=self.raise_exception
78
+ token,
79
+ raise_exception=self.raise_exception,
80
+ expected_token_type=self.expected_token_type,
75
81
  )
76
82
  _handle_exception(
77
83
  "Unauthorized",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: usso
3
- Version: 0.28.13
3
+ Version: 0.28.14
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