Skip to content

Commit 5ee1f18

Browse files
committed
chore: bump to scim2-client 0.8.0
1 parent 34081fc commit 5ee1f18

20 files changed

Lines changed: 668 additions & 514 deletions

‎doc/changelog.rst‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,33 @@
11
Changelog
22
=========
33

4+
[Unreleased]
5+
------------
6+
7+
Added
8+
^^^^^
9+
- The ``httpx2`` packaging extra, pulling ``scim2-client[httpx2]``.
10+
11+
Changed
12+
^^^^^^^
13+
- scim2-client 0.8.0 is now the minimum supported version.
14+
- The :attr:`~scim2_tester.CheckResult.data` of a failed check holds the server response
15+
instead of the request payload, as scim2-client 0.8 attaches the response to the
16+
exceptions it raises.
17+
18+
Deprecated
19+
^^^^^^^^^^
20+
- The ``httpx`` packaging extra, in favor of the ``httpx2`` extra. Will be removed
21+
when scim2-client drops its own ``httpx`` extra.
22+
23+
Fixed
24+
^^^^^
25+
- Checks performing one request per attribute, such as the PATCH ones, report one result
26+
per attribute again when the server answers a SCIM error, instead of a single result
27+
for the whole check.
28+
- ``check_server`` no longer registers the debugging data of a failed discovery check
29+
as the resource types, the schemas or the service provider configuration of the client.
30+
431
[0.2.8] - 2026-04-02
532
--------------------
633

‎doc/tutorial.rst‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ and pass it to the :meth:`~scim2_tester.check_server` method:
2222

2323
.. code-block:: python
2424
25-
from httpx import Client
26-
from scim2_client.engines.httpx import SyncSCIMClient
25+
from httpx2 import Client
26+
from scim2_client.engines.httpx2 import SyncSCIMClient
2727
from scim2_tester import check_server
2828
2929
httpx_client = Client(

‎pyproject.toml‎

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,15 @@ classifiers = [
1919
"Programming Language :: Python :: 3.13",
2020
"Programming Language :: Python :: 3.14",
2121
"Programming Language :: Python :: Implementation :: CPython",
22-
"License :: OSI Approved :: Apache Software License",
2322
"Environment :: Web Environment",
2423
"Programming Language :: Python",
2524
"Operating System :: OS Independent",
2625
]
2726

2827
requires-python = ">= 3.10"
2928
dependencies = [
30-
"scim2-client>=0.7.0",
31-
"scim2-models>=0.6.1",
29+
"scim2-client>=0.8.0",
30+
"scim2-models>=0.7.0",
3231
]
3332

3433
[project.urls]
@@ -41,8 +40,13 @@ funding = "https://github.com/sponsors/python-scim"
4140
module-root = ""
4241

4342
[project.optional-dependencies]
43+
httpx2 = [
44+
"scim2-client[httpx2]>=0.8.0",
45+
]
46+
47+
# Deprecated, will be removed in 0.9.
4448
httpx = [
45-
"scim2-client[httpx]>=0.7.4",
49+
"scim2-client[httpx]>=0.8.0",
4650
]
4751

4852
[dependency-groups]
@@ -134,13 +138,14 @@ env_list = [
134138
"py312",
135139
"py313",
136140
"py314",
141+
"legacy",
137142
"minversions",
138143
"doc",
139144
"coverage",
140145
]
141146

142147
[tool.tox.env_run_base]
143-
extras = ["httpx"]
148+
extras = ["httpx2"]
144149
runner = "uv-venv-lock-runner"
145150
dependency_groups = ["dev"]
146151
commands = [
@@ -153,6 +158,9 @@ commands = [
153158
["prek", "run", "--all-files", "--show-diff-on-failure"],
154159
]
155160

161+
[tool.tox.env.legacy]
162+
extras = ["httpx"]
163+
156164
[tool.tox.env.minversions]
157165
base_python = ["python3.10"]
158166
runner = "uv-venv-runner"

‎scim2_tester/checker.py‎

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
from scim2_client.engines.httpx import SyncSCIMClient
1+
from typing import Any
2+
3+
from scim2_client.engines.httpx2 import SyncSCIMClient
24

35
from scim2_tester.checkers import random_url
46
from scim2_tester.checkers import resource_type_tests
@@ -11,6 +13,16 @@
1113
from scim2_tester.utils import Status
1214

1315

16+
def _discovered_objects(results: list[CheckResult]) -> Any:
17+
"""Extract the objects a discovery endpoint exposed.
18+
19+
Discovery orchestrators run the check querying the whole collection first,
20+
so its result comes first. The data of the other statuses describes why the
21+
check failed and must not be mistaken for discovered objects.
22+
"""
23+
return results[0].data if results[0].status == Status.SUCCESS else None
24+
25+
1426
def check_server(
1527
client: SyncSCIMClient,
1628
raise_exceptions: bool = False,
@@ -72,29 +84,23 @@ def check_server(
7284
context = CheckContext(client, conf)
7385
results = []
7486

75-
result_spc_list = service_provider_config_endpoint(context)
76-
results.extend(result_spc_list)
77-
result_spc = result_spc_list[0] # Get the first (and only) result
78-
if result_spc.status != Status.SKIPPED and not client.service_provider_config:
79-
client.service_provider_config = result_spc.data
87+
results_spc = service_provider_config_endpoint(context)
88+
results.extend(results_spc)
89+
if not client.service_provider_config:
90+
client.service_provider_config = _discovered_objects(results_spc)
8091

8192
results_resource_types = _resource_types_endpoint(context)
8293
results.extend(results_resource_types)
8394
if not client.resource_types:
84-
for rt_result in results_resource_types:
85-
if rt_result.status != Status.SKIPPED and rt_result.data:
86-
client.resource_types = rt_result.data
87-
break
95+
client.resource_types = _discovered_objects(results_resource_types)
8896

8997
results_schemas = _schemas_endpoint(context)
9098
results.extend(results_schemas)
91-
if not client.resource_models:
92-
for schema_result in results_schemas:
93-
if schema_result.status != Status.SKIPPED and schema_result.data:
94-
client.resource_models = client.build_resource_models(
95-
client.resource_types or [], schema_result.data or []
96-
)
97-
break
99+
schemas = _discovered_objects(results_schemas)
100+
if not client.resource_models and schemas:
101+
client.resource_models = client.build_resource_models(
102+
client.resource_types or [], schemas
103+
)
98104

99105
if (
100106
not client.service_provider_config

‎scim2_tester/checkers/_discovery_utils.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Utility functions for discovery endpoint testing."""
22

3-
from scim2_client import SCIMClientError
3+
from scim2_client import SCIMClientException
4+
from scim2_models import SCIMException
45

56
from ..utils import CheckContext
67
from ..utils import CheckResult
@@ -53,7 +54,7 @@ def _test_discovery_endpoint_methods(
5354
data=response,
5455
)
5556
)
56-
except SCIMClientError as e:
57+
except (SCIMClientException, SCIMException) as e:
5758
results.append(
5859
check_result(
5960
context,

‎scim2_tester/checkers/patch_add.py‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22

33
from typing import Any
44

5-
from scim2_client import SCIMClientError
5+
from scim2_client import SCIMClientException
66
from scim2_models import Mutability
77
from scim2_models import PatchOp
88
from scim2_models import PatchOperation
99
from scim2_models import Required
1010
from scim2_models import Resource
11+
from scim2_models import SCIMException
1112
from scim2_models.path import Path
1213

1314
from ..filling import generate_random_value
@@ -99,11 +100,11 @@ def check_add_attribute(
99100

100101
try:
101102
modify_result = context.client.modify(
102-
resource_model=type(base_resource),
103+
resource=type(base_resource),
103104
id=base_resource.id,
104105
patch_op=patch_op,
105106
)
106-
except SCIMClientError as exc:
107+
except (SCIMClientException, SCIMException) as exc:
107108
results.append(
108109
check_result(
109110
context,
@@ -148,7 +149,7 @@ def check_add_attribute(
148149
type(base_resource),
149150
base_resource.id,
150151
)
151-
except SCIMClientError as exc:
152+
except (SCIMClientException, SCIMException) as exc:
152153
results.append(
153154
check_result(
154155
context,

‎scim2_tester/checkers/patch_remove.py‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22

33
from typing import Any
44

5-
from scim2_client import SCIMClientError
5+
from scim2_client import SCIMClientException
66
from scim2_models import Mutability
77
from scim2_models import PatchOp
88
from scim2_models import PatchOperation
99
from scim2_models import Required
1010
from scim2_models import Resource
11+
from scim2_models import SCIMException
1112
from scim2_models.path import Path
1213

1314
from ..utils import CheckContext
@@ -95,11 +96,11 @@ def check_remove_attribute(
9596

9697
try:
9798
modify_result = context.client.modify(
98-
resource_model=type(full_resource),
99+
resource=type(full_resource),
99100
id=full_resource.id,
100101
patch_op=remove_op,
101102
)
102-
except SCIMClientError as exc:
103+
except (SCIMClientException, SCIMException) as exc:
103104
results.append(
104105
check_result(
105106
context,
@@ -141,7 +142,7 @@ def check_remove_attribute(
141142
type(full_resource),
142143
full_resource.id,
143144
)
144-
except SCIMClientError as exc:
145+
except (SCIMClientException, SCIMException) as exc:
145146
results.append(
146147
check_result(
147148
context,

‎scim2_tester/checkers/patch_replace.py‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22

33
from typing import Any
44

5-
from scim2_client import SCIMClientError
5+
from scim2_client import SCIMClientException
66
from scim2_models import Mutability
77
from scim2_models import PatchOp
88
from scim2_models import PatchOperation
99
from scim2_models import Resource
10+
from scim2_models import SCIMException
1011
from scim2_models.path import Path
1112

1213
from ..filling import generate_random_value
@@ -93,11 +94,11 @@ def check_replace_attribute(
9394

9495
try:
9596
modify_result = context.client.modify(
96-
resource_model=type(base_resource),
97+
resource=type(base_resource),
9798
id=base_resource.id,
9899
patch_op=patch_op,
99100
)
100-
except SCIMClientError as exc:
101+
except (SCIMClientException, SCIMException) as exc:
101102
results.append(
102103
check_result(
103104
context,
@@ -142,7 +143,7 @@ def check_replace_attribute(
142143
type(base_resource),
143144
base_resource.id,
144145
)
145-
except SCIMClientError as exc:
146+
except (SCIMClientException, SCIMException) as exc:
146147
results.append(
147148
check_result(
148149
context,

‎scim2_tester/checkers/resource_types.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import uuid
22

3-
from scim2_client import SCIMClientError
3+
from scim2_client import SCIMClientException
44
from scim2_models import Error
55
from scim2_models import ResourceType
66
from scim2_models import Schema
7+
from scim2_models import SCIMException
78

89
from ..utils import CheckContext
910
from ..utils import CheckResult
@@ -116,7 +117,7 @@ def resource_types_schema_validation(
116117
data=schema_response,
117118
)
118119
)
119-
except SCIMClientError as e:
120+
except (SCIMClientException, SCIMException) as e:
120121
results.append(
121122
check_result(
122123
context,

‎scim2_tester/checkers/schemas.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import uuid
22

3-
from scim2_client import SCIMClientError
3+
from scim2_client import SCIMClientException
44
from scim2_models import Error
55
from scim2_models import Schema
6+
from scim2_models import SCIMException
67

78
from ..utils import CheckContext
89
from ..utils import CheckResult
@@ -195,7 +196,7 @@ def access_schema_by_id(
195196
data=response,
196197
)
197198
)
198-
except SCIMClientError as e:
199+
except (SCIMClientException, SCIMException) as e:
199200
results.append(
200201
check_result(
201202
context,

0 commit comments

Comments
 (0)