scim2-client 0.4.1__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.
Files changed (36) hide show
  1. {scim2_client-0.4.1 → scim2_client-0.4.2}/PKG-INFO +1 -1
  2. {scim2_client-0.4.1 → scim2_client-0.4.2}/doc/changelog.rst +8 -0
  3. {scim2_client-0.4.1 → scim2_client-0.4.2}/pyproject.toml +1 -1
  4. {scim2_client-0.4.1 → scim2_client-0.4.2}/scim2_client/client.py +49 -19
  5. {scim2_client-0.4.1 → scim2_client-0.4.2}/tests/engines/test_httpx.py +14 -0
  6. {scim2_client-0.4.1 → scim2_client-0.4.2}/uv.lock +7 -7
  7. {scim2_client-0.4.1 → scim2_client-0.4.2}/.github/FUNDING.yml +0 -0
  8. {scim2_client-0.4.1 → scim2_client-0.4.2}/.github/workflows/release.yml +0 -0
  9. {scim2_client-0.4.1 → scim2_client-0.4.2}/.github/workflows/tests.yaml +0 -0
  10. {scim2_client-0.4.1 → scim2_client-0.4.2}/.gitignore +0 -0
  11. {scim2_client-0.4.1 → scim2_client-0.4.2}/.pre-commit-config.yaml +0 -0
  12. {scim2_client-0.4.1 → scim2_client-0.4.2}/.readthedocs.yml +0 -0
  13. {scim2_client-0.4.1 → scim2_client-0.4.2}/LICENSE.md +0 -0
  14. {scim2_client-0.4.1 → scim2_client-0.4.2}/README.md +0 -0
  15. {scim2_client-0.4.1 → scim2_client-0.4.2}/doc/__init__.py +0 -0
  16. {scim2_client-0.4.1 → scim2_client-0.4.2}/doc/conf.py +0 -0
  17. {scim2_client-0.4.1 → scim2_client-0.4.2}/doc/contributing.rst +0 -0
  18. {scim2_client-0.4.1 → scim2_client-0.4.2}/doc/index.rst +0 -0
  19. {scim2_client-0.4.1 → scim2_client-0.4.2}/doc/reference.rst +0 -0
  20. {scim2_client-0.4.1 → scim2_client-0.4.2}/doc/tutorial.rst +0 -0
  21. {scim2_client-0.4.1 → scim2_client-0.4.2}/scim2_client/__init__.py +0 -0
  22. {scim2_client-0.4.1 → scim2_client-0.4.2}/scim2_client/engines/__init__.py +0 -0
  23. {scim2_client-0.4.1 → scim2_client-0.4.2}/scim2_client/engines/httpx.py +0 -0
  24. {scim2_client-0.4.1 → scim2_client-0.4.2}/scim2_client/engines/werkzeug.py +0 -0
  25. {scim2_client-0.4.1 → scim2_client-0.4.2}/scim2_client/errors.py +0 -0
  26. {scim2_client-0.4.1 → scim2_client-0.4.2}/scim2_client/py.typed +0 -0
  27. {scim2_client-0.4.1 → scim2_client-0.4.2}/tests/__init__.py +0 -0
  28. {scim2_client-0.4.1 → scim2_client-0.4.2}/tests/conftest.py +0 -0
  29. {scim2_client-0.4.1 → scim2_client-0.4.2}/tests/engines/__init__.py +0 -0
  30. {scim2_client-0.4.1 → scim2_client-0.4.2}/tests/engines/test_werkzeug.py +0 -0
  31. {scim2_client-0.4.1 → scim2_client-0.4.2}/tests/test_create.py +0 -0
  32. {scim2_client-0.4.1 → scim2_client-0.4.2}/tests/test_delete.py +0 -0
  33. {scim2_client-0.4.1 → scim2_client-0.4.2}/tests/test_query.py +0 -0
  34. {scim2_client-0.4.1 → scim2_client-0.4.2}/tests/test_replace.py +0 -0
  35. {scim2_client-0.4.1 → scim2_client-0.4.2}/tests/test_search.py +0 -0
  36. {scim2_client-0.4.1 → 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.1
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,14 @@
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
+
4
12
  [0.4.1] - 2024-12-02
5
13
  --------------------
6
14
 
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "scim2-client"
7
- version = "0.4.1"
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"}
@@ -798,14 +798,25 @@ class BaseSyncSCIMClient(SCIMClient):
798
798
  """
799
799
  raise NotImplementedError()
800
800
 
801
- def discover(self):
802
- """Dynamically discover the server models :class:`~scim2_models.Schema` and :class:`~scim2_models.ResourceType`."""
803
- resource_types_response = self.query(ResourceType)
804
- schemas_response = self.query(Schema)
805
- self.service_provider_config = self.query(ServiceProviderConfig)
806
- self.resource_types = resource_types_response.resources
807
- schemas = schemas_response.resources
808
- self.resource_models = self.build_resource_models(self.resource_types, schemas)
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(self):
1068
- """Dynamically discover the server models :class:`~scim2_models.Schema` and :class:`~scim2_models.ResourceType`."""
1069
- resources_task = asyncio.create_task(self.query(ResourceType))
1070
- schemas_task = asyncio.create_task(self.query(Schema))
1071
- spc_task = asyncio.create_task(self.query(ServiceProviderConfig))
1072
- resource_types_response = await resources_task
1073
- schemas_response = await schemas_task
1074
- self.service_provider_config = await spc_task
1075
- self.resource_types = resource_types_response.resources
1076
- schemas = schemas_response.resources
1077
- self.resource_models = self.build_resource_models(self.resource_types, schemas)
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
@@ -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.2"
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/41/86/a03390cb12cf64e2a8df07c267f3eb8d5035e0f9a04bb20fb79403d2a00e/pydantic-2.10.2.tar.gz", hash = "sha256:2bc2d7f17232e0841cbba4641e65ba1eb6fafb3a08de3a091ff3ce14a197c4fa", size = 785401 }
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/d5/74/da832196702d0c56eb86b75bfa346db9238617e29b0b7ee3b8b4eccfe654/pydantic-2.10.2-py3-none-any.whl", hash = "sha256:cfb96e45951117c3024e6b67b25cdc33a3cb7b2fa62e239f7af1378358a1d99e", size = 456364 },
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.1"
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.9"
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/5e/59/e152ca11f3586ef9df4d18587c7cdcf0fc8086b26e0dfff971e2e0718b88/scim2_models-0.2.9.tar.gz", hash = "sha256:a0aeffdeb5f4350639beac0a3c330dd0962df13e633d7038b406964a40a3b607", size = 130685 }
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/7a/8d/370842da196ee3eac821c53d72cf4a6194e95238a8aee3d1a4d0f757eb8d/scim2_models-0.2.9-py3-none-any.whl", hash = "sha256:74ca4c96cb482bb9704c8a749d883f590714df79389259aa33252dbebe2e8b69", size = 39174 },
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