scim2-models 0.3.1__tar.gz → 0.3.3__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_models-0.3.1 → scim2_models-0.3.3}/.pre-commit-config.yaml +1 -1
- {scim2_models-0.3.1 → scim2_models-0.3.3}/PKG-INFO +1 -1
- {scim2_models-0.3.1 → scim2_models-0.3.3}/doc/changelog.rst +16 -2
- {scim2_models-0.3.1 → scim2_models-0.3.3}/pyproject.toml +1 -1
- {scim2_models-0.3.1 → scim2_models-0.3.3}/scim2_models/base.py +9 -5
- {scim2_models-0.3.1 → scim2_models-0.3.3}/scim2_models/rfc7643/schema.py +1 -1
- {scim2_models-0.3.1 → scim2_models-0.3.3}/scim2_models/rfc7643/user.py +2 -1
- {scim2_models-0.3.1 → scim2_models-0.3.3}/tests/test_dynamic_resources.py +3 -3
- {scim2_models-0.3.1 → scim2_models-0.3.3}/tests/test_list_response.py +1 -1
- {scim2_models-0.3.1 → scim2_models-0.3.3}/tests/test_schema.py +3 -3
- scim2_models-0.3.3/uv.lock +1359 -0
- scim2_models-0.3.1/uv.lock +0 -1197
- {scim2_models-0.3.1 → scim2_models-0.3.3}/.github/FUNDING.yml +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/.github/workflows/release.yml +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/.github/workflows/tests.yaml +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/.gitignore +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/.readthedocs.yml +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/LICENSE +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/README.md +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/conftest.py +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/doc/__init__.py +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/doc/conf.py +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/doc/contributing.rst +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/doc/index.rst +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/doc/reference.rst +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/doc/tutorial.rst +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7643-8.1-user-minimal.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7643-8.2-user-full.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7643-8.3-enterprise_user.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7643-8.4-group.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7643-8.5-service_provider_configuration.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7643-8.6-resource_type-group.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7643-8.6-resource_type-user.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7643-8.7.1-schema-enterprise_user.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7643-8.7.1-schema-group.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7643-8.7.1-schema-user.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7643-8.7.2-schema-resource_type.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7643-8.7.2-schema-schema.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7643-8.7.2-schema-service_provider_configuration.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7644-3.12-error-bad_request.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7644-3.12-error-not_found.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7644-3.14-user-post_request.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7644-3.14-user-post_response.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7644-3.3-user-post_request.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7644-3.3-user-post_response.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7644-3.4.1-user-known-resource.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7644-3.4.2-list_response-partial_attributes.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7644-3.4.3-list_response-post_query.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7644-3.4.3-search_request.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7644-3.5.1-user-put_request.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7644-3.5.1-user-put_response.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7644-3.5.2.1-patch_op-add_emails.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7644-3.5.2.1-patch_op-add_members.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7644-3.5.2.2-patch_op-remove_all_members.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7644-3.5.2.2-patch_op-remove_and_add_one_member.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7644-3.5.2.2-patch_op-remove_multi_complex_value.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7644-3.5.2.2-patch_op-remove_one_member.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7644-3.5.2.3-patch_op-replace_all_email_values.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7644-3.5.2.3-patch_op-replace_all_members.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7644-3.5.2.3-patch_op-replace_street_address.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7644-3.5.2.3-patch_op-replace_user_work_address.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7644-3.6-error-not_found.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7644-3.7.1-bulk_request-circular_conflict.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7644-3.7.1-list_response-circular_reference.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7644-3.7.2-bulk_request-enterprise_user.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7644-3.7.2-bulk_request-temporary_identifier.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7644-3.7.2-bulk_response-temporary_identifier.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7644-3.7.3-bulk_request-multiple_operations.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7644-3.7.3-bulk_response-error_invalid_syntax.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7644-3.7.3-bulk_response-multiple_errors.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7644-3.7.3-bulk_response-multiple_operations.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7644-3.7.3-error-invalid_syntax.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7644-3.7.4-error-payload_too_large.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7644-3.9-user-partial_response.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/samples/rfc7644-4-list_response-resource_types.json +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/scim2_models/__init__.py +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/scim2_models/constants.py +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/scim2_models/py.typed +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/scim2_models/rfc7643/__init__.py +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/scim2_models/rfc7643/enterprise_user.py +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/scim2_models/rfc7643/group.py +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/scim2_models/rfc7643/resource.py +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/scim2_models/rfc7643/resource_type.py +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/scim2_models/rfc7643/service_provider_config.py +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/scim2_models/rfc7644/__init__.py +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/scim2_models/rfc7644/bulk.py +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/scim2_models/rfc7644/error.py +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/scim2_models/rfc7644/list_response.py +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/scim2_models/rfc7644/message.py +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/scim2_models/rfc7644/patch_op.py +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/scim2_models/rfc7644/search_request.py +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/scim2_models/utils.py +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/tests/__init__.py +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/tests/conftest.py +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/tests/test_dynamic_schemas.py +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/tests/test_enterprise_user.py +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/tests/test_errors.py +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/tests/test_group.py +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/tests/test_model_attributes.py +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/tests/test_model_serialization.py +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/tests/test_model_validation.py +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/tests/test_models.py +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/tests/test_patch_op.py +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/tests/test_resource_extension.py +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/tests/test_resource_type.py +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/tests/test_search_request.py +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/tests/test_service_provider_configuration.py +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/tests/test_user.py +0 -0
- {scim2_models-0.3.1 → scim2_models-0.3.3}/tests/test_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: scim2-models
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.3
|
|
4
4
|
Summary: SCIM2 models serialization and validation with pydantic
|
|
5
5
|
Project-URL: documentation, https://scim2-models.readthedocs.io
|
|
6
6
|
Project-URL: repository, https://github.com/python-scim/scim2-models
|
|
@@ -1,13 +1,27 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
[0.3.3] - 2025-05-21
|
|
5
|
+
--------------------
|
|
6
|
+
|
|
7
|
+
Fixed
|
|
8
|
+
^^^^^
|
|
9
|
+
- User class typing. :pr:`92`
|
|
10
|
+
|
|
11
|
+
[0.3.2] - 2025-03-28
|
|
12
|
+
--------------------
|
|
13
|
+
|
|
14
|
+
Fixed
|
|
15
|
+
^^^^^
|
|
16
|
+
- Pydantic warning.
|
|
17
|
+
|
|
4
18
|
[0.3.1] - 2025-03-07
|
|
5
19
|
--------------------
|
|
6
20
|
|
|
7
21
|
Fixed
|
|
8
22
|
^^^^^
|
|
9
|
-
- Fix :attr:`~SearchRequest.start_index` and :attr:`~SearchRequest.count` limits. :issue:`84`
|
|
10
|
-
- :attr:`~ListResponse.total_resuls` is required.
|
|
23
|
+
- Fix :attr:`~scim2_models.SearchRequest.start_index` and :attr:`~scim2_models.SearchRequest.count` limits. :issue:`84`
|
|
24
|
+
- :attr:`~scim2_models.ListResponse.total_resuls` is required. :issue:`88`
|
|
11
25
|
|
|
12
26
|
[0.3.0] - 2024-12-11
|
|
13
27
|
--------------------
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "scim2-models"
|
|
7
|
-
version = "0.3.
|
|
7
|
+
version = "0.3.3"
|
|
8
8
|
description = "SCIM2 models serialization and validation with pydantic"
|
|
9
9
|
authors = [{name="Yaal Coop", email="contact@yaal.coop"}]
|
|
10
10
|
license = {file = "LICENSE"}
|
|
@@ -649,14 +649,14 @@ class BaseModel(PydanticBaseModel):
|
|
|
649
649
|
"""
|
|
650
650
|
from scim2_models.rfc7643.resource import Resource
|
|
651
651
|
|
|
652
|
-
for field_name in self.model_fields:
|
|
652
|
+
for field_name in self.__class__.model_fields:
|
|
653
653
|
attr_type = self.get_field_root_type(field_name)
|
|
654
654
|
if not is_complex_attribute(attr_type):
|
|
655
655
|
continue
|
|
656
656
|
|
|
657
657
|
main_schema = (
|
|
658
658
|
getattr(self, "_schema", None)
|
|
659
|
-
or self.model_fields["schemas"].default[0]
|
|
659
|
+
or self.__class__.model_fields["schemas"].default[0]
|
|
660
660
|
)
|
|
661
661
|
|
|
662
662
|
separator = ":" if isinstance(self, Resource) else "."
|
|
@@ -847,8 +847,10 @@ class BaseModel(PydanticBaseModel):
|
|
|
847
847
|
|
|
848
848
|
See :rfc:`RFC7644 §3.10 <7644#section-3.10>`.
|
|
849
849
|
"""
|
|
850
|
-
main_schema = self.model_fields["schemas"].default[0]
|
|
851
|
-
alias =
|
|
850
|
+
main_schema = self.__class__.model_fields["schemas"].default[0]
|
|
851
|
+
alias = (
|
|
852
|
+
self.__class__.model_fields[field_name].serialization_alias or field_name
|
|
853
|
+
)
|
|
852
854
|
|
|
853
855
|
# if alias contains a ':' this is an extension urn
|
|
854
856
|
full_urn = alias if ":" in alias else f"{main_schema}:{alias}"
|
|
@@ -865,7 +867,9 @@ class ComplexAttribute(BaseModel):
|
|
|
865
867
|
|
|
866
868
|
See :rfc:`RFC7644 §3.10 <7644#section-3.10>`.
|
|
867
869
|
"""
|
|
868
|
-
alias =
|
|
870
|
+
alias = (
|
|
871
|
+
self.__class__.model_fields[field_name].serialization_alias or field_name
|
|
872
|
+
)
|
|
869
873
|
return f"{self._schema}.{alias}"
|
|
870
874
|
|
|
871
875
|
|
|
@@ -3,7 +3,7 @@ from datetime import datetime
|
|
|
3
3
|
from enum import Enum
|
|
4
4
|
from typing import Annotated
|
|
5
5
|
from typing import Any
|
|
6
|
-
from typing import List # noqa : UP005
|
|
6
|
+
from typing import List # noqa : UP005,UP035
|
|
7
7
|
from typing import Literal
|
|
8
8
|
from typing import Optional
|
|
9
9
|
from typing import Union
|
|
@@ -17,6 +17,7 @@ from ..base import Required
|
|
|
17
17
|
from ..base import Returned
|
|
18
18
|
from ..base import Uniqueness
|
|
19
19
|
from ..utils import Base64Bytes
|
|
20
|
+
from .resource import AnyExtension
|
|
20
21
|
from .resource import Resource
|
|
21
22
|
|
|
22
23
|
|
|
@@ -213,7 +214,7 @@ class X509Certificate(MultiValuedComplexAttribute):
|
|
|
213
214
|
"""The value of an X.509 certificate."""
|
|
214
215
|
|
|
215
216
|
|
|
216
|
-
class User(Resource):
|
|
217
|
+
class User(Resource[AnyExtension]):
|
|
217
218
|
schemas: Annotated[list[str], Required.true] = [
|
|
218
219
|
"urn:ietf:params:scim:schemas:core:2.0:User"
|
|
219
220
|
]
|
|
@@ -2720,7 +2720,7 @@ def test_make_schema_model_from_schema(load_sample):
|
|
|
2720
2720
|
assert obj.attributes[0].type == "string"
|
|
2721
2721
|
assert not obj.attributes[0].multi_valued
|
|
2722
2722
|
assert obj.attributes[0].description == (
|
|
2723
|
-
"A human-readable name for the Group.
|
|
2723
|
+
"A human-readable name for the Group. REQUIRED."
|
|
2724
2724
|
)
|
|
2725
2725
|
assert not obj.attributes[0].required
|
|
2726
2726
|
assert not obj.attributes[0].case_exact
|
|
@@ -2749,7 +2749,7 @@ def test_make_schema_model_from_schema(load_sample):
|
|
|
2749
2749
|
assert obj.attributes[1].sub_attributes[1].reference_types == ["User", "Group"]
|
|
2750
2750
|
assert not obj.attributes[1].sub_attributes[1].multi_valued
|
|
2751
2751
|
assert obj.attributes[1].sub_attributes[1].description == (
|
|
2752
|
-
"The URI corresponding to a SCIM resource
|
|
2752
|
+
"The URI corresponding to a SCIM resource that is a member of this Group."
|
|
2753
2753
|
)
|
|
2754
2754
|
assert not obj.attributes[1].sub_attributes[1].required
|
|
2755
2755
|
assert not obj.attributes[1].sub_attributes[1].case_exact
|
|
@@ -2760,7 +2760,7 @@ def test_make_schema_model_from_schema(load_sample):
|
|
|
2760
2760
|
assert obj.attributes[1].sub_attributes[2].type == "string"
|
|
2761
2761
|
assert not obj.attributes[1].sub_attributes[2].multi_valued
|
|
2762
2762
|
assert obj.attributes[1].sub_attributes[2].description == (
|
|
2763
|
-
"A label indicating the type of resource,
|
|
2763
|
+
"A label indicating the type of resource, e.g., 'User' or 'Group'."
|
|
2764
2764
|
)
|
|
2765
2765
|
assert not obj.attributes[1].sub_attributes[2].required
|
|
2766
2766
|
assert not obj.attributes[1].sub_attributes[2].case_exact
|
|
@@ -40,7 +40,7 @@ def test_enterprise_user(load_sample):
|
|
|
40
40
|
}
|
|
41
41
|
response = ListResponse[User[EnterpriseUser]].model_validate(payload)
|
|
42
42
|
obj = response.resources[0]
|
|
43
|
-
assert isinstance(obj, User
|
|
43
|
+
assert isinstance(obj, User)
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
def test_group(load_sample):
|
|
@@ -19,7 +19,7 @@ def test_group_schema(load_sample):
|
|
|
19
19
|
assert obj.attributes[0].type == Attribute.Type.string
|
|
20
20
|
assert not obj.attributes[0].multi_valued
|
|
21
21
|
assert obj.attributes[0].description == (
|
|
22
|
-
"A human-readable name for the Group.
|
|
22
|
+
"A human-readable name for the Group. REQUIRED."
|
|
23
23
|
)
|
|
24
24
|
assert not obj.attributes[0].required
|
|
25
25
|
assert not obj.attributes[0].case_exact
|
|
@@ -48,7 +48,7 @@ def test_group_schema(load_sample):
|
|
|
48
48
|
assert obj.attributes[1].sub_attributes[1].reference_types == ["User", "Group"]
|
|
49
49
|
assert not obj.attributes[1].sub_attributes[1].multi_valued
|
|
50
50
|
assert obj.attributes[1].sub_attributes[1].description == (
|
|
51
|
-
"The URI corresponding to a SCIM resource
|
|
51
|
+
"The URI corresponding to a SCIM resource that is a member of this Group."
|
|
52
52
|
)
|
|
53
53
|
assert not obj.attributes[1].sub_attributes[1].required
|
|
54
54
|
assert not obj.attributes[1].sub_attributes[1].case_exact
|
|
@@ -59,7 +59,7 @@ def test_group_schema(load_sample):
|
|
|
59
59
|
assert obj.attributes[1].sub_attributes[2].type == Attribute.Type.string
|
|
60
60
|
assert not obj.attributes[1].sub_attributes[2].multi_valued
|
|
61
61
|
assert obj.attributes[1].sub_attributes[2].description == (
|
|
62
|
-
"A label indicating the type of resource,
|
|
62
|
+
"A label indicating the type of resource, e.g., 'User' or 'Group'."
|
|
63
63
|
)
|
|
64
64
|
assert not obj.attributes[1].sub_attributes[2].required
|
|
65
65
|
assert not obj.attributes[1].sub_attributes[2].case_exact
|