scim2-models 0.5.1__tar.gz → 0.5.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_models-0.5.1 → scim2_models-0.5.2}/PKG-INFO +1 -1
- {scim2_models-0.5.1 → scim2_models-0.5.2}/pyproject.toml +1 -1
- {scim2_models-0.5.1 → scim2_models-0.5.2}/scim2_models/base.py +16 -9
- {scim2_models-0.5.1 → scim2_models-0.5.2}/LICENSE +0 -0
- {scim2_models-0.5.1 → scim2_models-0.5.2}/README.md +0 -0
- {scim2_models-0.5.1 → scim2_models-0.5.2}/scim2_models/__init__.py +0 -0
- {scim2_models-0.5.1 → scim2_models-0.5.2}/scim2_models/annotations.py +0 -0
- {scim2_models-0.5.1 → scim2_models-0.5.2}/scim2_models/attributes.py +0 -0
- {scim2_models-0.5.1 → scim2_models-0.5.2}/scim2_models/constants.py +0 -0
- {scim2_models-0.5.1 → scim2_models-0.5.2}/scim2_models/context.py +0 -0
- {scim2_models-0.5.1 → scim2_models-0.5.2}/scim2_models/messages/__init__.py +0 -0
- {scim2_models-0.5.1 → scim2_models-0.5.2}/scim2_models/messages/bulk.py +0 -0
- {scim2_models-0.5.1 → scim2_models-0.5.2}/scim2_models/messages/error.py +0 -0
- {scim2_models-0.5.1 → scim2_models-0.5.2}/scim2_models/messages/list_response.py +0 -0
- {scim2_models-0.5.1 → scim2_models-0.5.2}/scim2_models/messages/message.py +0 -0
- {scim2_models-0.5.1 → scim2_models-0.5.2}/scim2_models/messages/patch_op.py +0 -0
- {scim2_models-0.5.1 → scim2_models-0.5.2}/scim2_models/messages/search_request.py +0 -0
- {scim2_models-0.5.1 → scim2_models-0.5.2}/scim2_models/py.typed +0 -0
- {scim2_models-0.5.1 → scim2_models-0.5.2}/scim2_models/reference.py +0 -0
- {scim2_models-0.5.1 → scim2_models-0.5.2}/scim2_models/resources/__init__.py +0 -0
- {scim2_models-0.5.1 → scim2_models-0.5.2}/scim2_models/resources/enterprise_user.py +0 -0
- {scim2_models-0.5.1 → scim2_models-0.5.2}/scim2_models/resources/group.py +0 -0
- {scim2_models-0.5.1 → scim2_models-0.5.2}/scim2_models/resources/resource.py +0 -0
- {scim2_models-0.5.1 → scim2_models-0.5.2}/scim2_models/resources/resource_type.py +0 -0
- {scim2_models-0.5.1 → scim2_models-0.5.2}/scim2_models/resources/schema.py +0 -0
- {scim2_models-0.5.1 → scim2_models-0.5.2}/scim2_models/resources/service_provider_config.py +0 -0
- {scim2_models-0.5.1 → scim2_models-0.5.2}/scim2_models/resources/user.py +0 -0
- {scim2_models-0.5.1 → scim2_models-0.5.2}/scim2_models/scim_object.py +0 -0
- {scim2_models-0.5.1 → scim2_models-0.5.2}/scim2_models/urn.py +0 -0
- {scim2_models-0.5.1 → scim2_models-0.5.2}/scim2_models/utils.py +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "uv_build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "scim2-models"
|
|
7
|
-
version = "0.5.
|
|
7
|
+
version = "0.5.2"
|
|
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"}
|
|
@@ -29,12 +29,21 @@ from scim2_models.utils import _normalize_attribute_name
|
|
|
29
29
|
from scim2_models.utils import _to_camel
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
def
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
def _is_attribute_requested(requested_urns: list[str], current_urn: str) -> bool:
|
|
33
|
+
"""Check if an attribute should be included based on the requested URNs.
|
|
34
|
+
|
|
35
|
+
Returns True if:
|
|
36
|
+
- The current attribute is explicitly requested
|
|
37
|
+
- A sub-attribute of the current attribute is requested
|
|
38
|
+
- The current attribute is a sub-attribute of a requested attribute
|
|
39
|
+
"""
|
|
40
|
+
return (
|
|
41
|
+
current_urn in requested_urns
|
|
42
|
+
or any(
|
|
43
|
+
item.startswith(f"{current_urn}.") or item.startswith(f"{current_urn}:")
|
|
44
|
+
for item in requested_urns
|
|
45
|
+
)
|
|
46
|
+
or any(current_urn.startswith(f"{item}.") for item in requested_urns)
|
|
38
47
|
)
|
|
39
48
|
|
|
40
49
|
|
|
@@ -478,9 +487,7 @@ class BaseModel(PydanticBaseModel):
|
|
|
478
487
|
if returnability == Returned.default and (
|
|
479
488
|
(
|
|
480
489
|
included_urns
|
|
481
|
-
and not
|
|
482
|
-
included_urns, attribute_urn
|
|
483
|
-
)
|
|
490
|
+
and not _is_attribute_requested(included_urns, attribute_urn)
|
|
484
491
|
)
|
|
485
492
|
or attribute_urn in excluded_urns
|
|
486
493
|
):
|
|
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
|