scim2-client 0.4.0__tar.gz → 0.4.2__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.
- {scim2_client-0.4.0 → scim2_client-0.4.2}/PKG-INFO +1 -1
- {scim2_client-0.4.0 → scim2_client-0.4.2}/doc/changelog.rst +19 -0
- {scim2_client-0.4.0 → scim2_client-0.4.2}/pyproject.toml +1 -1
- {scim2_client-0.4.0 → scim2_client-0.4.2}/scim2_client/client.py +50 -20
- {scim2_client-0.4.0 → scim2_client-0.4.2}/scim2_client/engines/werkzeug.py +6 -1
- {scim2_client-0.4.0 → scim2_client-0.4.2}/tests/engines/test_httpx.py +14 -0
- {scim2_client-0.4.0 → scim2_client-0.4.2}/uv.lock +7 -7
- {scim2_client-0.4.0 → scim2_client-0.4.2}/.github/FUNDING.yml +0 -0
- {scim2_client-0.4.0 → scim2_client-0.4.2}/.github/workflows/release.yml +0 -0
- {scim2_client-0.4.0 → scim2_client-0.4.2}/.github/workflows/tests.yaml +0 -0
- {scim2_client-0.4.0 → scim2_client-0.4.2}/.gitignore +0 -0
- {scim2_client-0.4.0 → scim2_client-0.4.2}/.pre-commit-config.yaml +0 -0
- {scim2_client-0.4.0 → scim2_client-0.4.2}/.readthedocs.yml +0 -0
- {scim2_client-0.4.0 → scim2_client-0.4.2}/LICENSE.md +0 -0
- {scim2_client-0.4.0 → scim2_client-0.4.2}/README.md +0 -0
- {scim2_client-0.4.0 → scim2_client-0.4.2}/doc/__init__.py +0 -0
- {scim2_client-0.4.0 → scim2_client-0.4.2}/doc/conf.py +0 -0
- {scim2_client-0.4.0 → scim2_client-0.4.2}/doc/contributing.rst +0 -0
- {scim2_client-0.4.0 → scim2_client-0.4.2}/doc/index.rst +0 -0
- {scim2_client-0.4.0 → scim2_client-0.4.2}/doc/reference.rst +0 -0
- {scim2_client-0.4.0 → scim2_client-0.4.2}/doc/tutorial.rst +0 -0
- {scim2_client-0.4.0 → scim2_client-0.4.2}/scim2_client/__init__.py +0 -0
- {scim2_client-0.4.0 → scim2_client-0.4.2}/scim2_client/engines/__init__.py +0 -0
- {scim2_client-0.4.0 → scim2_client-0.4.2}/scim2_client/engines/httpx.py +0 -0
- {scim2_client-0.4.0 → scim2_client-0.4.2}/scim2_client/errors.py +0 -0
- {scim2_client-0.4.0 → scim2_client-0.4.2}/scim2_client/py.typed +0 -0
- {scim2_client-0.4.0 → scim2_client-0.4.2}/tests/__init__.py +0 -0
- {scim2_client-0.4.0 → scim2_client-0.4.2}/tests/conftest.py +0 -0
- {scim2_client-0.4.0 → scim2_client-0.4.2}/tests/engines/__init__.py +0 -0
- {scim2_client-0.4.0 → scim2_client-0.4.2}/tests/engines/test_werkzeug.py +0 -0
- {scim2_client-0.4.0 → scim2_client-0.4.2}/tests/test_create.py +0 -0
- {scim2_client-0.4.0 → scim2_client-0.4.2}/tests/test_delete.py +0 -0
- {scim2_client-0.4.0 → scim2_client-0.4.2}/tests/test_query.py +0 -0
- {scim2_client-0.4.0 → scim2_client-0.4.2}/tests/test_replace.py +0 -0
- {scim2_client-0.4.0 → scim2_client-0.4.2}/tests/test_search.py +0 -0
- {scim2_client-0.4.0 → scim2_client-0.4.2}/tests/test_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: scim2-client
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.2
|
|
4
4
|
Summary: Pythonically build SCIM requests and parse SCIM responses
|
|
5
5
|
Project-URL: documentation, https://scim2-client.readthedocs.io
|
|
6
6
|
Project-URL: repository, https://github.com/python-scim/scim2-client
|
|
@@ -1,6 +1,25 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
[0.4.2] - 2024-12-03
|
|
5
|
+
--------------------
|
|
6
|
+
|
|
7
|
+
Added
|
|
8
|
+
^^^^^
|
|
9
|
+
- :class:`~scim2_client.client.BaseSyncSCIMClient.discover` has parameters to select which objects to discover.
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
[0.4.1] - 2024-12-02
|
|
13
|
+
--------------------
|
|
14
|
+
|
|
15
|
+
Added
|
|
16
|
+
^^^^^
|
|
17
|
+
- :class:`~scim2_client.engines.werkzeug.TestSCIMClient` can handle absolute URLs.
|
|
18
|
+
|
|
19
|
+
Changed
|
|
20
|
+
^^^^^^^
|
|
21
|
+
- Avoid to initialize :paramref:`~scim2_client.SCIMClient.resource_models` with configuration resources.
|
|
22
|
+
|
|
4
23
|
[0.4.0] - 2024-12-02
|
|
5
24
|
--------------------
|
|
6
25
|
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "scim2-client"
|
|
7
|
-
version = "0.4.
|
|
7
|
+
version = "0.4.2"
|
|
8
8
|
description = "Pythonically build SCIM requests and parse SCIM responses"
|
|
9
9
|
authors = [{name="Yaal Coop", email="contact@yaal.coop"}]
|
|
10
10
|
license = {file = "LICENSE.md"}
|
|
@@ -158,7 +158,7 @@ class SCIMClient:
|
|
|
158
158
|
check_response_payload: bool = True,
|
|
159
159
|
raise_scim_errors: bool = True,
|
|
160
160
|
):
|
|
161
|
-
self.resource_models = tuple(
|
|
161
|
+
self.resource_models = tuple(resource_models or [])
|
|
162
162
|
self.resource_types = resource_types
|
|
163
163
|
self.service_provider_config = service_provider_config
|
|
164
164
|
self.check_request_payload = check_request_payload
|
|
@@ -798,14 +798,25 @@ class BaseSyncSCIMClient(SCIMClient):
|
|
|
798
798
|
"""
|
|
799
799
|
raise NotImplementedError()
|
|
800
800
|
|
|
801
|
-
def discover(self):
|
|
802
|
-
"""Dynamically discover the server
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
801
|
+
def discover(self, schemas=True, resource_types=True, service_provider_config=True):
|
|
802
|
+
"""Dynamically discover the server configuration objects.
|
|
803
|
+
|
|
804
|
+
:param schemas: Whether to discover the :class:`~scim2_models.Schema` endpoint.
|
|
805
|
+
:param resource_types: Whether to discover the :class:`~scim2_models.ResourceType` endpoint.
|
|
806
|
+
:param service_provider_config: Whether to discover the :class:`~scim2_models.ServiceProviderConfig` endpoint.
|
|
807
|
+
"""
|
|
808
|
+
if resource_types:
|
|
809
|
+
resource_types_response = self.query(ResourceType)
|
|
810
|
+
self.resource_types = resource_types_response.resources
|
|
811
|
+
|
|
812
|
+
if schemas:
|
|
813
|
+
schemas_response = self.query(Schema)
|
|
814
|
+
self.resource_models = self.build_resource_models(
|
|
815
|
+
self.resource_types, schemas_response.resources
|
|
816
|
+
)
|
|
817
|
+
|
|
818
|
+
if service_provider_config:
|
|
819
|
+
self.service_provider_config = self.query(ServiceProviderConfig)
|
|
809
820
|
|
|
810
821
|
|
|
811
822
|
class BaseAsyncSCIMClient(SCIMClient):
|
|
@@ -1064,14 +1075,33 @@ class BaseAsyncSCIMClient(SCIMClient):
|
|
|
1064
1075
|
"""
|
|
1065
1076
|
raise NotImplementedError()
|
|
1066
1077
|
|
|
1067
|
-
async def discover(
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
schemas
|
|
1077
|
-
|
|
1078
|
+
async def discover(
|
|
1079
|
+
self, schemas=True, resource_types=True, service_provider_config=True
|
|
1080
|
+
):
|
|
1081
|
+
"""Dynamically discover the server configuration objects.
|
|
1082
|
+
|
|
1083
|
+
:param schemas: Whether to discover the :class:`~scim2_models.Schema` endpoint.
|
|
1084
|
+
:param resource_types: Whether to discover the :class:`~scim2_models.ResourceType` endpoint.
|
|
1085
|
+
:param service_provider_config: Whether to discover the :class:`~scim2_models.ServiceProviderConfig` endpoint.
|
|
1086
|
+
"""
|
|
1087
|
+
if schemas:
|
|
1088
|
+
schemas_task = asyncio.create_task(self.query(Schema))
|
|
1089
|
+
|
|
1090
|
+
if resource_types:
|
|
1091
|
+
resources_types_task = asyncio.create_task(self.query(ResourceType))
|
|
1092
|
+
|
|
1093
|
+
if service_provider_config:
|
|
1094
|
+
spc_task = asyncio.create_task(self.query(ServiceProviderConfig))
|
|
1095
|
+
|
|
1096
|
+
if resource_types:
|
|
1097
|
+
resource_types_response = await resources_types_task
|
|
1098
|
+
self.resource_types = resource_types_response.resources
|
|
1099
|
+
|
|
1100
|
+
if schemas:
|
|
1101
|
+
schemas_response = await schemas_task
|
|
1102
|
+
self.resource_models = self.build_resource_models(
|
|
1103
|
+
self.resource_types, schemas_response.resources
|
|
1104
|
+
)
|
|
1105
|
+
|
|
1106
|
+
if service_provider_config:
|
|
1107
|
+
self.service_provider_config = await spc_task
|
|
@@ -72,12 +72,17 @@ class TestSCIMClient(BaseSyncSCIMClient):
|
|
|
72
72
|
self.scim_prefix = scim_prefix
|
|
73
73
|
|
|
74
74
|
def make_url(self, url: Optional[str]) -> str:
|
|
75
|
+
url = url or ""
|
|
75
76
|
prefix = (
|
|
76
77
|
self.scim_prefix[:-1]
|
|
77
78
|
if self.scim_prefix.endswith("/")
|
|
78
79
|
else self.scim_prefix
|
|
79
80
|
)
|
|
80
|
-
return
|
|
81
|
+
return (
|
|
82
|
+
url
|
|
83
|
+
if url.startswith("http://") or url.startswith("https://")
|
|
84
|
+
else f"{prefix}{url}"
|
|
85
|
+
)
|
|
81
86
|
|
|
82
87
|
def create(
|
|
83
88
|
self,
|
|
@@ -45,6 +45,13 @@ def test_sync_engine(server):
|
|
|
45
45
|
client = Client(base_url=f"http://{host}:{port}")
|
|
46
46
|
scim_client = SyncSCIMClient(client)
|
|
47
47
|
|
|
48
|
+
scim_client.discover(
|
|
49
|
+
schemas=False, resource_types=False, service_provider_config=False
|
|
50
|
+
)
|
|
51
|
+
assert not scim_client.resource_models
|
|
52
|
+
assert not scim_client.resource_types
|
|
53
|
+
assert not scim_client.service_provider_config
|
|
54
|
+
|
|
48
55
|
scim_client.discover()
|
|
49
56
|
assert isinstance(scim_client.service_provider_config, ServiceProviderConfig)
|
|
50
57
|
User = scim_client.get_resource_model("User")
|
|
@@ -82,6 +89,13 @@ async def test_async_engine(server):
|
|
|
82
89
|
client = AsyncClient(base_url=f"http://{host}:{port}")
|
|
83
90
|
scim_client = AsyncSCIMClient(client)
|
|
84
91
|
|
|
92
|
+
await scim_client.discover(
|
|
93
|
+
schemas=False, resource_types=False, service_provider_config=False
|
|
94
|
+
)
|
|
95
|
+
assert not scim_client.resource_models
|
|
96
|
+
assert not scim_client.resource_types
|
|
97
|
+
assert not scim_client.service_provider_config
|
|
98
|
+
|
|
85
99
|
await scim_client.discover()
|
|
86
100
|
assert isinstance(scim_client.service_provider_config, ServiceProviderConfig)
|
|
87
101
|
User = scim_client.get_resource_model("User")
|
|
@@ -678,16 +678,16 @@ wheels = [
|
|
|
678
678
|
|
|
679
679
|
[[package]]
|
|
680
680
|
name = "pydantic"
|
|
681
|
-
version = "2.10.
|
|
681
|
+
version = "2.10.3"
|
|
682
682
|
source = { registry = "https://pypi.org/simple" }
|
|
683
683
|
dependencies = [
|
|
684
684
|
{ name = "annotated-types" },
|
|
685
685
|
{ name = "pydantic-core" },
|
|
686
686
|
{ name = "typing-extensions" },
|
|
687
687
|
]
|
|
688
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
|
688
|
+
sdist = { url = "https://files.pythonhosted.org/packages/45/0f/27908242621b14e649a84e62b133de45f84c255eecb350ab02979844a788/pydantic-2.10.3.tar.gz", hash = "sha256:cb5ac360ce894ceacd69c403187900a02c4b20b693a9dd1d643e1effab9eadf9", size = 786486 }
|
|
689
689
|
wheels = [
|
|
690
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
690
|
+
{ url = "https://files.pythonhosted.org/packages/62/51/72c18c55cf2f46ff4f91ebcc8f75aa30f7305f3d726be3f4ebffb4ae972b/pydantic-2.10.3-py3-none-any.whl", hash = "sha256:be04d85bbc7b65651c5f8e6b9976ed9c6f41782a55524cef079a34a0bb82144d", size = 456997 },
|
|
691
691
|
]
|
|
692
692
|
|
|
693
693
|
[package.optional-dependencies]
|
|
@@ -984,7 +984,7 @@ wheels = [
|
|
|
984
984
|
|
|
985
985
|
[[package]]
|
|
986
986
|
name = "scim2-client"
|
|
987
|
-
version = "0.4.
|
|
987
|
+
version = "0.4.2"
|
|
988
988
|
source = { editable = "." }
|
|
989
989
|
dependencies = [
|
|
990
990
|
{ name = "scim2-models" },
|
|
@@ -1063,14 +1063,14 @@ wheels = [
|
|
|
1063
1063
|
|
|
1064
1064
|
[[package]]
|
|
1065
1065
|
name = "scim2-models"
|
|
1066
|
-
version = "0.2.
|
|
1066
|
+
version = "0.2.10"
|
|
1067
1067
|
source = { registry = "https://pypi.org/simple" }
|
|
1068
1068
|
dependencies = [
|
|
1069
1069
|
{ name = "pydantic", extra = ["email"] },
|
|
1070
1070
|
]
|
|
1071
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
|
1071
|
+
sdist = { url = "https://files.pythonhosted.org/packages/d6/ab/30c537635c2f4591db3a74acc90d8bd5a87107a01645f6c5a64c9f9e7619/scim2_models-0.2.10.tar.gz", hash = "sha256:1cbdaab551ec9fd06b3eaf4d1540f7c60cf065fdd6932ee5493e109d33163e2f", size = 131248 }
|
|
1072
1072
|
wheels = [
|
|
1073
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
1073
|
+
{ url = "https://files.pythonhosted.org/packages/97/8c/ec957904e8e2d3f8cfa83c65f144aaa72527a816a485881eb7d5fb75968c/scim2_models-0.2.10-py3-none-any.whl", hash = "sha256:a8576a6c7a87bcfce9c5851f58ea1361ccbb6c53452cc96e70a2dda571cedcea", size = 39925 },
|
|
1074
1074
|
]
|
|
1075
1075
|
|
|
1076
1076
|
[[package]]
|
|
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
|
|
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
|