scim2-server 0.8.3__tar.gz → 0.8.4__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 (31) hide show
  1. {scim2_server-0.8.3 → scim2_server-0.8.4}/PKG-INFO +1 -1
  2. {scim2_server-0.8.3 → scim2_server-0.8.4}/pyproject.toml +5 -4
  3. {scim2_server-0.8.3 → scim2_server-0.8.4}/pyproject.toml.orig +5 -4
  4. {scim2_server-0.8.3 → scim2_server-0.8.4}/scim2_server/applications/asgi.py +7 -1
  5. {scim2_server-0.8.3 → scim2_server-0.8.4}/scim2_server/applications/base.py +16 -1
  6. {scim2_server-0.8.3 → scim2_server-0.8.4}/scim2_server/applications/wsgi.py +7 -1
  7. {scim2_server-0.8.3 → scim2_server-0.8.4}/LICENSE +0 -0
  8. {scim2_server-0.8.3 → scim2_server-0.8.4}/README.md +0 -0
  9. {scim2_server-0.8.3 → scim2_server-0.8.4}/scim2_server/__init__.py +0 -0
  10. {scim2_server-0.8.3 → scim2_server-0.8.4}/scim2_server/applications/__init__.py +0 -0
  11. {scim2_server-0.8.3 → scim2_server-0.8.4}/scim2_server/bulk.py +0 -0
  12. {scim2_server-0.8.3 → scim2_server-0.8.4}/scim2_server/conditions.py +0 -0
  13. {scim2_server-0.8.3 → scim2_server-0.8.4}/scim2_server/cursor.py +0 -0
  14. {scim2_server-0.8.3 → scim2_server-0.8.4}/scim2_server/errors.py +0 -0
  15. {scim2_server-0.8.3 → scim2_server-0.8.4}/scim2_server/handler.py +0 -0
  16. {scim2_server-0.8.3 → scim2_server-0.8.4}/scim2_server/memory.py +0 -0
  17. {scim2_server-0.8.3 → scim2_server-0.8.4}/scim2_server/py.typed +0 -0
  18. {scim2_server-0.8.3 → scim2_server-0.8.4}/scim2_server/requests.py +0 -0
  19. {scim2_server-0.8.3 → scim2_server-0.8.4}/scim2_server/resources/default-resource-types.json +0 -0
  20. {scim2_server-0.8.3 → scim2_server-0.8.4}/scim2_server/resources/default-schemas.json +0 -0
  21. {scim2_server-0.8.3 → scim2_server-0.8.4}/scim2_server/resources/default-service-provider-config.json +0 -0
  22. {scim2_server-0.8.3 → scim2_server-0.8.4}/scim2_server/responses.py +0 -0
  23. {scim2_server-0.8.3 → scim2_server-0.8.4}/scim2_server/routing.py +0 -0
  24. {scim2_server-0.8.3 → scim2_server-0.8.4}/scim2_server/service.py +0 -0
  25. {scim2_server-0.8.3 → scim2_server-0.8.4}/scim2_server/storage.py +0 -0
  26. {scim2_server-0.8.3 → scim2_server-0.8.4}/scim2_server/testing.py +0 -0
  27. {scim2_server-0.8.3 → scim2_server-0.8.4}/scim2_server/testserver/__init__.py +0 -0
  28. {scim2_server-0.8.3 → scim2_server-0.8.4}/scim2_server/testserver/application.py +0 -0
  29. {scim2_server-0.8.3 → scim2_server-0.8.4}/scim2_server/testserver/cli.py +0 -0
  30. {scim2_server-0.8.3 → scim2_server-0.8.4}/scim2_server/testserver/precis.py +0 -0
  31. {scim2_server-0.8.3 → scim2_server-0.8.4}/scim2_server/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: scim2-server
3
- Version: 0.8.3
3
+ Version: 0.8.4
4
4
  Summary: SCIM server core for any storage and web framework
5
5
  Keywords: scim,scim2,provisioning,rfc7643,rfc7644
6
6
  Author: Yaal Coop, Christian Friedrich Coors
@@ -1,10 +1,10 @@
1
1
  [build-system]
2
- requires = ["uv_build>=0.12.13,<0.13.0"]
2
+ requires = ["uv_build>=0.12.13,<0.14.0"]
3
3
  build-backend = "uv_build"
4
4
 
5
5
  [project]
6
6
  name = "scim2-server"
7
- version = "0.8.3"
7
+ version = "0.8.4"
8
8
  description = "SCIM server core for any storage and web framework"
9
9
  readme = "README.md"
10
10
  keywords = [
@@ -65,8 +65,8 @@ dev = [
65
65
  "aiosqlite>=0.22.1",
66
66
  "precis-i18n>=1.1.2",
67
67
  "mypy>=2.3.1",
68
- "scim2-client>=0.12.0",
69
- "scim2-tester>=0.5.1",
68
+ "scim2-client>=0.14.0",
69
+ "scim2-tester[testing]>=0.6.2",
70
70
  "werkzeug>=3.0.3",
71
71
  "cryptography>=50.0.1",
72
72
  ]
@@ -159,6 +159,7 @@ docstring-code-format = true
159
159
  addopts = "--doctest-modules --doctest-glob='*.rst' --ignore=doc/conf.py"
160
160
  pythonpath = ["doc/_examples"]
161
161
  doctest_optionflags = "ALLOW_UNICODE IGNORE_EXCEPTION_DETAIL ELLIPSIS"
162
+ filterwarnings = ["error::scim2_tester.testing.ScimDeviationWarning"]
162
163
 
163
164
  [tool.tox]
164
165
  requires = ["tox>=4.19"]
@@ -1,10 +1,10 @@
1
1
  [build-system]
2
- requires = ["uv_build>=0.12.13,<0.13.0"]
2
+ requires = ["uv_build>=0.12.13,<0.14.0"]
3
3
  build-backend = "uv_build"
4
4
 
5
5
  [project]
6
6
  name = "scim2-server"
7
- version = "0.8.3"
7
+ version = "0.8.4"
8
8
  description = "SCIM server core for any storage and web framework"
9
9
  authors = [
10
10
  {name="Yaal Coop", email="contact@yaal.coop"},
@@ -62,8 +62,8 @@ dev = [
62
62
  "aiosqlite>=0.22.1",
63
63
  "precis-i18n>=1.1.2",
64
64
  "mypy>=2.3.1",
65
- "scim2-client>=0.12.0",
66
- "scim2-tester>=0.5.1",
65
+ "scim2-client>=0.14.0",
66
+ "scim2-tester[testing]>=0.6.2",
67
67
  "werkzeug>=3.0.3",
68
68
  "cryptography>=50.0.1",
69
69
  ]
@@ -148,6 +148,7 @@ docstring-code-format = true
148
148
  addopts = "--doctest-modules --doctest-glob='*.rst' --ignore=doc/conf.py"
149
149
  pythonpath = ["doc/_examples"]
150
150
  doctest_optionflags= "ALLOW_UNICODE IGNORE_EXCEPTION_DETAIL ELLIPSIS"
151
+ filterwarnings = ["error::scim2_tester.testing.ScimDeviationWarning"]
151
152
 
152
153
  [tool.tox]
153
154
  requires = ["tox>=4.19"]
@@ -32,6 +32,8 @@ class ASGIApplication(BaseApplication):
32
32
  :param storage: The storage of the resources.
33
33
  :param provider: The description of the service.
34
34
  :param service: The service serving the requests, built upon ``provider``.
35
+ :param propagate_exceptions: Whether an unexpected exception reaches the
36
+ caller of the application, instead of answering 500.
35
37
  """
36
38
 
37
39
  def __init__(
@@ -39,8 +41,10 @@ class ASGIApplication(BaseApplication):
39
41
  storage: AsyncScimStorage,
40
42
  provider: ScimProvider,
41
43
  service: ScimService | None = None,
44
+ *,
45
+ propagate_exceptions: bool = False,
42
46
  ):
43
- super().__init__(provider, service)
47
+ super().__init__(provider, service, propagate_exceptions=propagate_exceptions)
44
48
  self.storage = storage
45
49
  self.handler = AsyncScimHandler(self.service, storage)
46
50
 
@@ -106,6 +110,8 @@ class ASGIApplication(BaseApplication):
106
110
  try:
107
111
  response = await self.dispatch_request(request)
108
112
  except Exception as exception:
113
+ if self._propagates(exception):
114
+ raise
109
115
  response = self.handle_exception(request, exception)
110
116
  return self.finalize_response(request, response)
111
117
 
@@ -23,17 +23,32 @@ class BaseApplication:
23
23
  :class:`~scim2_server.service.ScimService` of ``provider`` by default,
24
24
  whose secret comes from the ``SCIM2_SERVER_SECRET`` environment
25
25
  variable.
26
+ :param propagate_exceptions: Whether an unexpected exception reaches the
27
+ caller of the application, instead of answering 500. The
28
+ :class:`~scim2_models.SCIMException` still answer a SCIM error. Enable
29
+ it in tests, to see the traceback of a bug.
26
30
  """
27
31
 
28
- def __init__(self, provider: ScimProvider, service: ScimService | None = None):
32
+ def __init__(
33
+ self,
34
+ provider: ScimProvider,
35
+ service: ScimService | None = None,
36
+ *,
37
+ propagate_exceptions: bool = False,
38
+ ):
29
39
  self.provider = provider
30
40
  self.service = (
31
41
  service
32
42
  if service is not None
33
43
  else ScimService(provider, secret=os.environ.get("SCIM2_SERVER_SECRET"))
34
44
  )
45
+ self.propagate_exceptions = propagate_exceptions
35
46
  self.log = logging.getLogger("scim2_server")
36
47
 
48
+ def _propagates(self, exception: Exception) -> bool:
49
+ """Tell whether an exception raised while serving a request reaches the caller."""
50
+ return self.propagate_exceptions and not isinstance(exception, SCIMException)
51
+
37
52
  @staticmethod
38
53
  def split_path(path: str) -> str:
39
54
  """Return the path of a request, relative to the root URL of the SCIM endpoints.
@@ -47,6 +47,8 @@ class WSGIApplication(BaseApplication):
47
47
  :param storage: The storage of the resources.
48
48
  :param provider: The description of the service.
49
49
  :param service: The service serving the requests, built upon ``provider``.
50
+ :param propagate_exceptions: Whether an unexpected exception reaches the
51
+ caller of the application, instead of answering 500.
50
52
  """
51
53
 
52
54
  def __init__(
@@ -54,8 +56,10 @@ class WSGIApplication(BaseApplication):
54
56
  storage: ScimStorage,
55
57
  provider: ScimProvider,
56
58
  service: ScimService | None = None,
59
+ *,
60
+ propagate_exceptions: bool = False,
57
61
  ):
58
- super().__init__(provider, service)
62
+ super().__init__(provider, service, propagate_exceptions=propagate_exceptions)
59
63
  self.storage = storage
60
64
  self.handler = ScimHandler(self.service, storage)
61
65
 
@@ -122,6 +126,8 @@ class WSGIApplication(BaseApplication):
122
126
  try:
123
127
  response = self.dispatch_request(request)
124
128
  except Exception as exception:
129
+ if self._propagates(exception):
130
+ raise
125
131
  response = self.handle_exception(request, exception)
126
132
  return self.finalize_response(request, response)
127
133
 
File without changes
File without changes