scim2-models 0.3.7__py3-none-any.whl → 0.4.0__py3-none-any.whl
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/__init__.py +41 -41
- scim2_models/attributes.py +2 -2
- scim2_models/base.py +140 -42
- scim2_models/context.py +1 -1
- scim2_models/{rfc7644 → messages}/bulk.py +2 -2
- scim2_models/{rfc7644 → messages}/error.py +2 -2
- scim2_models/{rfc7644 → messages}/list_response.py +3 -3
- scim2_models/{rfc7644 → messages}/message.py +16 -7
- scim2_models/messages/patch_op.py +478 -0
- scim2_models/{rfc7644 → messages}/search_request.py +51 -2
- scim2_models/{rfc7643 → resources}/resource.py +32 -26
- scim2_models/{rfc7643 → resources}/schema.py +10 -10
- scim2_models/scim_object.py +1 -78
- scim2_models/urn.py +109 -0
- scim2_models/utils.py +107 -5
- {scim2_models-0.3.7.dist-info → scim2_models-0.4.0.dist-info}/METADATA +1 -1
- scim2_models-0.4.0.dist-info/RECORD +30 -0
- scim2_models/rfc7644/patch_op.py +0 -84
- scim2_models-0.3.7.dist-info/RECORD +0 -29
- /scim2_models/{rfc7643 → messages}/__init__.py +0 -0
- /scim2_models/{rfc7644 → resources}/__init__.py +0 -0
- /scim2_models/{rfc7643 → resources}/enterprise_user.py +0 -0
- /scim2_models/{rfc7643 → resources}/group.py +0 -0
- /scim2_models/{rfc7643 → resources}/resource_type.py +0 -0
- /scim2_models/{rfc7643 → resources}/service_provider_config.py +0 -0
- /scim2_models/{rfc7643 → resources}/user.py +0 -0
- {scim2_models-0.3.7.dist-info → scim2_models-0.4.0.dist-info}/WHEEL +0 -0
- {scim2_models-0.3.7.dist-info → scim2_models-0.4.0.dist-info}/licenses/LICENSE +0 -0
scim2_models/rfc7644/patch_op.py
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
from enum import Enum
|
|
2
|
-
from typing import Annotated
|
|
3
|
-
from typing import Any
|
|
4
|
-
from typing import Optional
|
|
5
|
-
|
|
6
|
-
from pydantic import Field
|
|
7
|
-
from pydantic import field_validator
|
|
8
|
-
from pydantic import model_validator
|
|
9
|
-
from typing_extensions import Self
|
|
10
|
-
|
|
11
|
-
from ..annotations import Required
|
|
12
|
-
from ..attributes import ComplexAttribute
|
|
13
|
-
from .message import Message
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
class PatchOperation(ComplexAttribute):
|
|
17
|
-
class Op(str, Enum):
|
|
18
|
-
replace_ = "replace"
|
|
19
|
-
remove = "remove"
|
|
20
|
-
add = "add"
|
|
21
|
-
|
|
22
|
-
op: Op
|
|
23
|
-
"""Each PATCH operation object MUST have exactly one "op" member, whose
|
|
24
|
-
value indicates the operation to perform and MAY be one of "add", "remove",
|
|
25
|
-
or "replace".
|
|
26
|
-
|
|
27
|
-
.. note::
|
|
28
|
-
|
|
29
|
-
For the sake of compatibility with Microsoft Entra,
|
|
30
|
-
despite :rfc:`RFC7644 §3.5.2 <7644#section-3.5.2>`, op is case-insensitive.
|
|
31
|
-
"""
|
|
32
|
-
|
|
33
|
-
path: Optional[str] = None
|
|
34
|
-
"""The "path" attribute value is a String containing an attribute path
|
|
35
|
-
describing the target of the operation."""
|
|
36
|
-
|
|
37
|
-
@model_validator(mode="after")
|
|
38
|
-
def validate_path(self) -> Self:
|
|
39
|
-
# The "path" attribute value is a String containing an attribute path
|
|
40
|
-
# describing the target of the operation. The "path" attribute is
|
|
41
|
-
# OPTIONAL for "add" and "replace" and is REQUIRED for "remove"
|
|
42
|
-
# operations. See relevant operation sections below for details.
|
|
43
|
-
|
|
44
|
-
if self.path is None and self.op == PatchOperation.Op.remove:
|
|
45
|
-
raise ValueError("Op.path is required for remove operations")
|
|
46
|
-
|
|
47
|
-
return self
|
|
48
|
-
|
|
49
|
-
value: Optional[Any] = None
|
|
50
|
-
|
|
51
|
-
@field_validator("op", mode="before")
|
|
52
|
-
@classmethod
|
|
53
|
-
def normalize_op(cls, v: Any) -> Any:
|
|
54
|
-
"""Ignorecase for op.
|
|
55
|
-
|
|
56
|
-
This brings
|
|
57
|
-
`compatibility with Microsoft Entra <https://learn.microsoft.com/en-us/entra/identity/app-provisioning/use-scim-to-provision-users-and-groups#general>`_:
|
|
58
|
-
|
|
59
|
-
Don't require a case-sensitive match on structural elements in SCIM,
|
|
60
|
-
in particular PATCH op operation values, as defined in section 3.5.2.
|
|
61
|
-
Microsoft Entra ID emits the values of op as Add, Replace, and Remove.
|
|
62
|
-
"""
|
|
63
|
-
if isinstance(v, str):
|
|
64
|
-
return v.lower()
|
|
65
|
-
return v
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
class PatchOp(Message):
|
|
69
|
-
"""Patch Operation as defined in :rfc:`RFC7644 §3.5.2 <7644#section-3.5.2>`.
|
|
70
|
-
|
|
71
|
-
.. todo::
|
|
72
|
-
|
|
73
|
-
The models for Patch operations are defined, but their behavior is not implemented nor tested yet.
|
|
74
|
-
"""
|
|
75
|
-
|
|
76
|
-
schemas: Annotated[list[str], Required.true] = [
|
|
77
|
-
"urn:ietf:params:scim:api:messages:2.0:PatchOp"
|
|
78
|
-
]
|
|
79
|
-
|
|
80
|
-
operations: Annotated[Optional[list[PatchOperation]], Required.true] = Field(
|
|
81
|
-
None, serialization_alias="Operations", min_length=1
|
|
82
|
-
)
|
|
83
|
-
"""The body of an HTTP PATCH request MUST contain the attribute
|
|
84
|
-
"Operations", whose value is an array of one or more PATCH operations."""
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
scim2_models/__init__.py,sha256=yqYNm1B18OD-c8Y3QC3VWWv6Yoxw4PAvpC9eABhxef0,3128
|
|
2
|
-
scim2_models/annotations.py,sha256=oRjlKL1fqrYfa9UtaMdxF5fOT8CUUN3m-rdzvf7aiSA,3304
|
|
3
|
-
scim2_models/attributes.py,sha256=VloM7txtM2oexPrHO4phVY6nDzORMr3Vqf6EFAEZzyk,1804
|
|
4
|
-
scim2_models/base.py,sha256=BcAjsbwaHhO8AnGJJF05MqfL636UBlM2njFuCvFL_SY,16795
|
|
5
|
-
scim2_models/constants.py,sha256=9egq8JW0dFAqPng85CiHoH5T6pRtYL87-gC0C-IMGsk,573
|
|
6
|
-
scim2_models/context.py,sha256=oV8BCBSl9NvXuue11q4EYnoSze1yqtja9U_HEdrR-88,9125
|
|
7
|
-
scim2_models/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
-
scim2_models/reference.py,sha256=EQM8bbSr_kxbFMNlWYf_4sAJlSsOS5wUrn-9_eF0Ykc,2483
|
|
9
|
-
scim2_models/scim_object.py,sha256=t1p6ha719w1YU2Gtcy_k2NY-X0kc8PJxwstKOGP0oPA,5183
|
|
10
|
-
scim2_models/utils.py,sha256=1fmJoVCtrFURmvBegGti8UnXdj9EnzkNmg83jtpj70A,2755
|
|
11
|
-
scim2_models/rfc7643/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
|
-
scim2_models/rfc7643/enterprise_user.py,sha256=TVa5aS-eLHcDkwyr58hZYsRKk0AwjUaUaSFhU51mn5E,1806
|
|
13
|
-
scim2_models/rfc7643/group.py,sha256=lJXKopa__LoWhkaNqu0JFVyQaOMe-AF4vISaq0Gg7cE,1458
|
|
14
|
-
scim2_models/rfc7643/resource.py,sha256=jPP6nGGEVOLIX7Zmka5xHLGk3jJBfpaMBPizU1mXFoo,17275
|
|
15
|
-
scim2_models/rfc7643/resource_type.py,sha256=scLqbD3HX3fXT2JOXY9OUVnZz7i5ty2lx4VuiVxt6DE,3314
|
|
16
|
-
scim2_models/rfc7643/schema.py,sha256=DJQvDx31jYYZyfS3noTu4-8C429u0ctUqRysmvUULyI,10647
|
|
17
|
-
scim2_models/rfc7643/service_provider_config.py,sha256=6xJ182T-1szEQnN5Zb1cTdQCgTYIFi4XKygbvDlTKTM,5446
|
|
18
|
-
scim2_models/rfc7643/user.py,sha256=ErOghhilUF7fipwDRqARyLwJhbntQx4GJG3u2sZNJXs,10664
|
|
19
|
-
scim2_models/rfc7644/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
|
-
scim2_models/rfc7644/bulk.py,sha256=ZVGtitEDy--iDBzU2WR-LT7_rIizZFBD3sOo6rJ_WII,2590
|
|
21
|
-
scim2_models/rfc7644/error.py,sha256=KZBJfI2z4TByAK6W3mN3e3m0ZrDguPLm66v9W971Awk,6302
|
|
22
|
-
scim2_models/rfc7644/list_response.py,sha256=8o1_WR3AOZNv0hbCGcgq8lyeXaNjo1CiLxfteq8gctk,2396
|
|
23
|
-
scim2_models/rfc7644/message.py,sha256=rX2KezTdM81Z9mw7JTJYjWF-VDnDeUm6-ZxsarmVdsE,3738
|
|
24
|
-
scim2_models/rfc7644/patch_op.py,sha256=Yk2qr-vsuU6MMh6uFijo3Tw1vgo-clbgj1T0B8S1Tcs,2856
|
|
25
|
-
scim2_models/rfc7644/search_request.py,sha256=kLhIfyjAjc7ar6wkT7t-A2ySB-_3XYP-gf_LspLU2RU,3063
|
|
26
|
-
scim2_models-0.3.7.dist-info/METADATA,sha256=tqCuz5S5ESdKVlEQhpsOVxgXHUDfUyAC32rkIOH1w98,16288
|
|
27
|
-
scim2_models-0.3.7.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
28
|
-
scim2_models-0.3.7.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
29
|
-
scim2_models-0.3.7.dist-info/RECORD,,
|
|
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
|