scim2-models 0.4.2__tar.gz → 0.5.1__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 (121) hide show
  1. scim2_models-0.5.1/PKG-INFO +280 -0
  2. {scim2_models-0.4.2 → scim2_models-0.5.1}/pyproject.toml +11 -7
  3. {scim2_models-0.4.2 → scim2_models-0.5.1}/scim2_models/attributes.py +7 -8
  4. {scim2_models-0.4.2 → scim2_models-0.5.1}/scim2_models/base.py +3 -3
  5. {scim2_models-0.4.2 → scim2_models-0.5.1}/scim2_models/messages/bulk.py +11 -12
  6. {scim2_models-0.4.2 → scim2_models-0.5.1}/scim2_models/messages/error.py +3 -4
  7. {scim2_models-0.4.2 → scim2_models-0.5.1}/scim2_models/messages/list_response.py +4 -7
  8. {scim2_models-0.4.2 → scim2_models-0.5.1}/scim2_models/messages/message.py +4 -5
  9. {scim2_models-0.4.2 → scim2_models-0.5.1}/scim2_models/messages/patch_op.py +23 -10
  10. {scim2_models-0.4.2 → scim2_models-0.5.1}/scim2_models/messages/search_request.py +15 -16
  11. {scim2_models-0.4.2 → scim2_models-0.5.1}/scim2_models/reference.py +1 -1
  12. {scim2_models-0.4.2 → scim2_models-0.5.1}/scim2_models/resources/enterprise_user.py +9 -10
  13. {scim2_models-0.4.2 → scim2_models-0.5.1}/scim2_models/resources/group.py +7 -10
  14. {scim2_models-0.4.2 → scim2_models-0.5.1}/scim2_models/resources/resource.py +26 -31
  15. {scim2_models-0.4.2 → scim2_models-0.5.1}/scim2_models/resources/resource_type.py +8 -9
  16. {scim2_models-0.4.2 → scim2_models-0.5.1}/scim2_models/resources/schema.py +26 -31
  17. {scim2_models-0.4.2 → scim2_models-0.5.1}/scim2_models/resources/service_provider_config.py +28 -31
  18. {scim2_models-0.4.2 → scim2_models-0.5.1}/scim2_models/resources/user.py +99 -70
  19. {scim2_models-0.4.2 → scim2_models-0.5.1}/scim2_models/scim_object.py +3 -4
  20. {scim2_models-0.4.2 → scim2_models-0.5.1}/scim2_models/urn.py +27 -12
  21. {scim2_models-0.4.2 → scim2_models-0.5.1}/scim2_models/utils.py +14 -7
  22. scim2_models-0.4.2/.github/FUNDING.yml +0 -2
  23. scim2_models-0.4.2/.github/workflows/release.yml +0 -51
  24. scim2_models-0.4.2/.github/workflows/tests.yaml +0 -122
  25. scim2_models-0.4.2/.gitignore +0 -14
  26. scim2_models-0.4.2/.pre-commit-config.yaml +0 -31
  27. scim2_models-0.4.2/.readthedocs.yml +0 -15
  28. scim2_models-0.4.2/PKG-INFO +0 -280
  29. scim2_models-0.4.2/conftest.py +0 -12
  30. scim2_models-0.4.2/doc/changelog.rst +0 -371
  31. scim2_models-0.4.2/doc/conf.py +0 -102
  32. scim2_models-0.4.2/doc/contributing.rst +0 -47
  33. scim2_models-0.4.2/doc/index.rst +0 -15
  34. scim2_models-0.4.2/doc/reference.rst +0 -22
  35. scim2_models-0.4.2/doc/tutorial.rst +0 -451
  36. scim2_models-0.4.2/samples/rfc7643-8.1-user-minimal.json +0 -14
  37. scim2_models-0.4.2/samples/rfc7643-8.2-user-full.json +0 -113
  38. scim2_models-0.4.2/samples/rfc7643-8.3-enterprise_user.json +0 -126
  39. scim2_models-0.4.2/samples/rfc7643-8.4-group.json +0 -26
  40. scim2_models-0.4.2/samples/rfc7643-8.5-service_provider_configuration.json +0 -51
  41. scim2_models-0.4.2/samples/rfc7643-8.6-resource_type-group.json +0 -14
  42. scim2_models-0.4.2/samples/rfc7643-8.6-resource_type-user.json +0 -20
  43. scim2_models-0.4.2/samples/rfc7643-8.7.1-schema-enterprise_user.json +0 -114
  44. scim2_models-0.4.2/samples/rfc7643-8.7.1-schema-group.json +0 -86
  45. scim2_models-0.4.2/samples/rfc7643-8.7.1-schema-user.json +0 -781
  46. scim2_models-0.4.2/samples/rfc7643-8.7.2-schema-resource_type.json +0 -103
  47. scim2_models-0.4.2/samples/rfc7643-8.7.2-schema-schema.json +0 -347
  48. scim2_models-0.4.2/samples/rfc7643-8.7.2-schema-service_provider_configuration.json +0 -233
  49. scim2_models-0.4.2/samples/rfc7644-3.12-error-bad_request.json +0 -8
  50. scim2_models-0.4.2/samples/rfc7644-3.12-error-not_found.json +0 -5
  51. scim2_models-0.4.2/samples/rfc7644-3.14-user-post_request.json +0 -10
  52. scim2_models-0.4.2/samples/rfc7644-3.14-user-post_response.json +0 -17
  53. scim2_models-0.4.2/samples/rfc7644-3.3-user-post_request.json +0 -10
  54. scim2_models-0.4.2/samples/rfc7644-3.3-user-post_response.json +0 -19
  55. scim2_models-0.4.2/samples/rfc7644-3.4.1-user-known-resource.json +0 -31
  56. scim2_models-0.4.2/samples/rfc7644-3.4.2-list_response-partial_attributes.json +0 -14
  57. scim2_models-0.4.2/samples/rfc7644-3.4.3-list_response-post_query.json +0 -19
  58. scim2_models-0.4.2/samples/rfc7644-3.4.3-search_request.json +0 -12
  59. scim2_models-0.4.2/samples/rfc7644-3.5.1-user-put_request.json +0 -21
  60. scim2_models-0.4.2/samples/rfc7644-3.5.1-user-put_response.json +0 -27
  61. scim2_models-0.4.2/samples/rfc7644-3.5.2.1-patch_op-add_emails.json +0 -19
  62. scim2_models-0.4.2/samples/rfc7644-3.5.2.1-patch_op-add_members.json +0 -18
  63. scim2_models-0.4.2/samples/rfc7644-3.5.2.2-patch_op-remove_all_members.json +0 -11
  64. scim2_models-0.4.2/samples/rfc7644-3.5.2.2-patch_op-remove_and_add_one_member.json +0 -22
  65. scim2_models-0.4.2/samples/rfc7644-3.5.2.2-patch_op-remove_multi_complex_value.json +0 -11
  66. scim2_models-0.4.2/samples/rfc7644-3.5.2.2-patch_op-remove_one_member.json +0 -11
  67. scim2_models-0.4.2/samples/rfc7644-3.5.2.3-patch_op-replace_all_email_values.json +0 -24
  68. scim2_models-0.4.2/samples/rfc7644-3.5.2.3-patch_op-replace_all_members.json +0 -27
  69. scim2_models-0.4.2/samples/rfc7644-3.5.2.3-patch_op-replace_street_address.json +0 -12
  70. scim2_models-0.4.2/samples/rfc7644-3.5.2.3-patch_op-replace_user_work_address.json +0 -21
  71. scim2_models-0.4.2/samples/rfc7644-3.6-error-not_found.json +0 -7
  72. scim2_models-0.4.2/samples/rfc7644-3.7.1-bulk_request-circular_conflict.json +0 -41
  73. scim2_models-0.4.2/samples/rfc7644-3.7.1-list_response-circular_reference.json +0 -50
  74. scim2_models-0.4.2/samples/rfc7644-3.7.2-bulk_request-enterprise_user.json +0 -36
  75. scim2_models-0.4.2/samples/rfc7644-3.7.2-bulk_request-temporary_identifier.json +0 -35
  76. scim2_models-0.4.2/samples/rfc7644-3.7.2-bulk_response-temporary_identifier.json +0 -21
  77. scim2_models-0.4.2/samples/rfc7644-3.7.3-bulk_request-multiple_operations.json +0 -52
  78. scim2_models-0.4.2/samples/rfc7644-3.7.3-bulk_response-error_invalid_syntax.json +0 -20
  79. scim2_models-0.4.2/samples/rfc7644-3.7.3-bulk_response-multiple_errors.json +0 -56
  80. scim2_models-0.4.2/samples/rfc7644-3.7.3-bulk_response-multiple_operations.json +0 -31
  81. scim2_models-0.4.2/samples/rfc7644-3.7.3-error-invalid_syntax.json +0 -8
  82. scim2_models-0.4.2/samples/rfc7644-3.7.4-error-payload_too_large.json +0 -7
  83. scim2_models-0.4.2/samples/rfc7644-3.9-user-partial_response.json +0 -5
  84. scim2_models-0.4.2/samples/rfc7644-4-list_response-resource_types.json +0 -34
  85. scim2_models-0.4.2/scim2_models/resources/__init__.py +0 -0
  86. scim2_models-0.4.2/tests/__init__.py +0 -0
  87. scim2_models-0.4.2/tests/conftest.py +0 -12
  88. scim2_models-0.4.2/tests/test_dynamic_resources.py +0 -2783
  89. scim2_models-0.4.2/tests/test_dynamic_schemas.py +0 -200
  90. scim2_models-0.4.2/tests/test_enterprise_user.py +0 -120
  91. scim2_models-0.4.2/tests/test_errors.py +0 -17
  92. scim2_models-0.4.2/tests/test_group.py +0 -37
  93. scim2_models-0.4.2/tests/test_list_response.py +0 -242
  94. scim2_models-0.4.2/tests/test_model_attributes.py +0 -352
  95. scim2_models-0.4.2/tests/test_model_serialization.py +0 -428
  96. scim2_models-0.4.2/tests/test_model_validation.py +0 -551
  97. scim2_models-0.4.2/tests/test_models.py +0 -159
  98. scim2_models-0.4.2/tests/test_patch_op_add.py +0 -278
  99. scim2_models-0.4.2/tests/test_patch_op_extensions.py +0 -335
  100. scim2_models-0.4.2/tests/test_patch_op_remove.py +0 -289
  101. scim2_models-0.4.2/tests/test_patch_op_replace.py +0 -219
  102. scim2_models-0.4.2/tests/test_patch_op_validation.py +0 -499
  103. scim2_models-0.4.2/tests/test_path_validation.py +0 -112
  104. scim2_models-0.4.2/tests/test_reference.py +0 -80
  105. scim2_models-0.4.2/tests/test_resource_extension.py +0 -350
  106. scim2_models-0.4.2/tests/test_resource_type.py +0 -97
  107. scim2_models-0.4.2/tests/test_schema.py +0 -125
  108. scim2_models-0.4.2/tests/test_search_request.py +0 -243
  109. scim2_models-0.4.2/tests/test_service_provider_configuration.py +0 -64
  110. scim2_models-0.4.2/tests/test_user.py +0 -126
  111. scim2_models-0.4.2/tests/test_utils.py +0 -29
  112. scim2_models-0.4.2/uv.lock +0 -1403
  113. {scim2_models-0.4.2 → scim2_models-0.5.1}/LICENSE +0 -0
  114. {scim2_models-0.4.2 → scim2_models-0.5.1}/README.md +0 -0
  115. {scim2_models-0.4.2 → scim2_models-0.5.1}/scim2_models/__init__.py +0 -0
  116. {scim2_models-0.4.2 → scim2_models-0.5.1}/scim2_models/annotations.py +0 -0
  117. {scim2_models-0.4.2 → scim2_models-0.5.1}/scim2_models/constants.py +0 -0
  118. {scim2_models-0.4.2 → scim2_models-0.5.1}/scim2_models/context.py +0 -0
  119. {scim2_models-0.4.2/doc → scim2_models-0.5.1/scim2_models/messages}/__init__.py +0 -0
  120. {scim2_models-0.4.2 → scim2_models-0.5.1}/scim2_models/py.typed +0 -0
  121. {scim2_models-0.4.2/scim2_models/messages → scim2_models-0.5.1/scim2_models/resources}/__init__.py +0 -0
@@ -0,0 +1,280 @@
1
+ Metadata-Version: 2.3
2
+ Name: scim2-models
3
+ Version: 0.5.1
4
+ Summary: SCIM2 models serialization and validation with pydantic
5
+ Keywords: scim,scim2,provisioning,pydantic,rfc7643,rfc7644
6
+ Author: Yaal Coop
7
+ Author-email: Yaal Coop <contact@yaal.coop>
8
+ License: Apache License
9
+ Version 2.0, January 2004
10
+ http://www.apache.org/licenses/
11
+
12
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
13
+
14
+ 1. Definitions.
15
+
16
+ "License" shall mean the terms and conditions for use, reproduction,
17
+ and distribution as defined by Sections 1 through 9 of this document.
18
+
19
+ "Licensor" shall mean the copyright owner or entity authorized by
20
+ the copyright owner that is granting the License.
21
+
22
+ "Legal Entity" shall mean the union of the acting entity and all
23
+ other entities that control, are controlled by, or are under common
24
+ control with that entity. For the purposes of this definition,
25
+ "control" means (i) the power, direct or indirect, to cause the
26
+ direction or management of such entity, whether by contract or
27
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
28
+ outstanding shares, or (iii) beneficial ownership of such entity.
29
+
30
+ "You" (or "Your") shall mean an individual or Legal Entity
31
+ exercising permissions granted by this License.
32
+
33
+ "Source" form shall mean the preferred form for making modifications,
34
+ including but not limited to software source code, documentation
35
+ source, and configuration files.
36
+
37
+ "Object" form shall mean any form resulting from mechanical
38
+ transformation or translation of a Source form, including but
39
+ not limited to compiled object code, generated documentation,
40
+ and conversions to other media types.
41
+
42
+ "Work" shall mean the work of authorship, whether in Source or
43
+ Object form, made available under the License, as indicated by a
44
+ copyright notice that is included in or attached to the work
45
+ (an example is provided in the Appendix below).
46
+
47
+ "Derivative Works" shall mean any work, whether in Source or Object
48
+ form, that is based on (or derived from) the Work and for which the
49
+ editorial revisions, annotations, elaborations, or other modifications
50
+ represent, as a whole, an original work of authorship. For the purposes
51
+ of this License, Derivative Works shall not include works that remain
52
+ separable from, or merely link (or bind by name) to the interfaces of,
53
+ the Work and Derivative Works thereof.
54
+
55
+ "Contribution" shall mean any work of authorship, including
56
+ the original version of the Work and any modifications or additions
57
+ to that Work or Derivative Works thereof, that is intentionally
58
+ submitted to Licensor for inclusion in the Work by the copyright owner
59
+ or by an individual or Legal Entity authorized to submit on behalf of
60
+ the copyright owner. For the purposes of this definition, "submitted"
61
+ means any form of electronic, verbal, or written communication sent
62
+ to the Licensor or its representatives, including but not limited to
63
+ communication on electronic mailing lists, source code control systems,
64
+ and issue tracking systems that are managed by, or on behalf of, the
65
+ Licensor for the purpose of discussing and improving the Work, but
66
+ excluding communication that is conspicuously marked or otherwise
67
+ designated in writing by the copyright owner as "Not a Contribution."
68
+
69
+ "Contributor" shall mean Licensor and any individual or Legal Entity
70
+ on behalf of whom a Contribution has been received by Licensor and
71
+ subsequently incorporated within the Work.
72
+
73
+ 2. Grant of Copyright License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ copyright license to reproduce, prepare Derivative Works of,
77
+ publicly display, publicly perform, sublicense, and distribute the
78
+ Work and such Derivative Works in Source or Object form.
79
+
80
+ 3. Grant of Patent License. Subject to the terms and conditions of
81
+ this License, each Contributor hereby grants to You a perpetual,
82
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
83
+ (except as stated in this section) patent license to make, have made,
84
+ use, offer to sell, sell, import, and otherwise transfer the Work,
85
+ where such license applies only to those patent claims licensable
86
+ by such Contributor that are necessarily infringed by their
87
+ Contribution(s) alone or by combination of their Contribution(s)
88
+ with the Work to which such Contribution(s) was submitted. If You
89
+ institute patent litigation against any entity (including a
90
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
91
+ or a Contribution incorporated within the Work constitutes direct
92
+ or contributory patent infringement, then any patent licenses
93
+ granted to You under this License for that Work shall terminate
94
+ as of the date such litigation is filed.
95
+
96
+ 4. Redistribution. You may reproduce and distribute copies of the
97
+ Work or Derivative Works thereof in any medium, with or without
98
+ modifications, and in Source or Object form, provided that You
99
+ meet the following conditions:
100
+
101
+ (a) You must give any other recipients of the Work or
102
+ Derivative Works a copy of this License; and
103
+
104
+ (b) You must cause any modified files to carry prominent notices
105
+ stating that You changed the files; and
106
+
107
+ (c) You must retain, in the Source form of any Derivative Works
108
+ that You distribute, all copyright, patent, trademark, and
109
+ attribution notices from the Source form of the Work,
110
+ excluding those notices that do not pertain to any part of
111
+ the Derivative Works; and
112
+
113
+ (d) If the Work includes a "NOTICE" text file as part of its
114
+ distribution, then any Derivative Works that You distribute must
115
+ include a readable copy of the attribution notices contained
116
+ within such NOTICE file, excluding those notices that do not
117
+ pertain to any part of the Derivative Works, in at least one
118
+ of the following places: within a NOTICE text file distributed
119
+ as part of the Derivative Works; within the Source form or
120
+ documentation, if provided along with the Derivative Works; or,
121
+ within a display generated by the Derivative Works, if and
122
+ wherever such third-party notices normally appear. The contents
123
+ of the NOTICE file are for informational purposes only and
124
+ do not modify the License. You may add Your own attribution
125
+ notices within Derivative Works that You distribute, alongside
126
+ or as an addendum to the NOTICE text from the Work, provided
127
+ that such additional attribution notices cannot be construed
128
+ as modifying the License.
129
+
130
+ You may add Your own copyright statement to Your modifications and
131
+ may provide additional or different license terms and conditions
132
+ for use, reproduction, or distribution of Your modifications, or
133
+ for any such Derivative Works as a whole, provided Your use,
134
+ reproduction, and distribution of the Work otherwise complies with
135
+ the conditions stated in this License.
136
+
137
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
138
+ any Contribution intentionally submitted for inclusion in the Work
139
+ by You to the Licensor shall be under the terms and conditions of
140
+ this License, without any additional terms or conditions.
141
+ Notwithstanding the above, nothing herein shall supersede or modify
142
+ the terms of any separate license agreement you may have executed
143
+ with Licensor regarding such Contributions.
144
+
145
+ 6. Trademarks. This License does not grant permission to use the trade
146
+ names, trademarks, service marks, or product names of the Licensor,
147
+ except as required for reasonable and customary use in describing the
148
+ origin of the Work and reproducing the content of the NOTICE file.
149
+
150
+ 7. Disclaimer of Warranty. Unless required by applicable law or
151
+ agreed to in writing, Licensor provides the Work (and each
152
+ Contributor provides its Contributions) on an "AS IS" BASIS,
153
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
154
+ implied, including, without limitation, any warranties or conditions
155
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
156
+ PARTICULAR PURPOSE. You are solely responsible for determining the
157
+ appropriateness of using or redistributing the Work and assume any
158
+ risks associated with Your exercise of permissions under this License.
159
+
160
+ 8. Limitation of Liability. In no event and under no legal theory,
161
+ whether in tort (including negligence), contract, or otherwise,
162
+ unless required by applicable law (such as deliberate and grossly
163
+ negligent acts) or agreed to in writing, shall any Contributor be
164
+ liable to You for damages, including any direct, indirect, special,
165
+ incidental, or consequential damages of any character arising as a
166
+ result of this License or out of the use or inability to use the
167
+ Work (including but not limited to damages for loss of goodwill,
168
+ work stoppage, computer failure or malfunction, or any and all
169
+ other commercial damages or losses), even if such Contributor
170
+ has been advised of the possibility of such damages.
171
+
172
+ 9. Accepting Warranty or Additional Liability. While redistributing
173
+ the Work or Derivative Works thereof, You may choose to offer,
174
+ and charge a fee for, acceptance of support, warranty, indemnity,
175
+ or other liability obligations and/or rights consistent with this
176
+ License. However, in accepting such obligations, You may act only
177
+ on Your own behalf and on Your sole responsibility, not on behalf
178
+ of any other Contributor, and only if You agree to indemnify,
179
+ defend, and hold each Contributor harmless for any liability
180
+ incurred by, or claims asserted against, such Contributor by reason
181
+ of your accepting any such warranty or additional liability.
182
+
183
+ END OF TERMS AND CONDITIONS
184
+
185
+ APPENDIX: How to apply the Apache License to your work.
186
+
187
+ To apply the Apache License to your work, attach the following
188
+ boilerplate notice, with the fields enclosed by brackets "[]"
189
+ replaced with your own identifying information. (Don't include
190
+ the brackets!) The text should be enclosed in the appropriate
191
+ comment syntax for the file format. We also recommend that a
192
+ file or class name and description of purpose be included on the
193
+ same "printed page" as the copyright notice for easier
194
+ identification within third-party archives.
195
+
196
+ Copyright [yyyy] [name of copyright owner]
197
+
198
+ Licensed under the Apache License, Version 2.0 (the "License");
199
+ you may not use this file except in compliance with the License.
200
+ You may obtain a copy of the License at
201
+
202
+ http://www.apache.org/licenses/LICENSE-2.0
203
+
204
+ Unless required by applicable law or agreed to in writing, software
205
+ distributed under the License is distributed on an "AS IS" BASIS,
206
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
207
+ See the License for the specific language governing permissions and
208
+ limitations under the License.
209
+ Classifier: Intended Audience :: Developers
210
+ Classifier: Development Status :: 3 - Alpha
211
+ Classifier: Programming Language :: Python :: 3.9
212
+ Classifier: Programming Language :: Python :: 3.10
213
+ Classifier: Programming Language :: Python :: 3.11
214
+ Classifier: Programming Language :: Python :: 3.12
215
+ Classifier: Programming Language :: Python :: 3.13
216
+ Classifier: Programming Language :: Python :: Implementation :: CPython
217
+ Classifier: License :: OSI Approved :: Apache Software License
218
+ Classifier: Environment :: Web Environment
219
+ Classifier: Programming Language :: Python
220
+ Classifier: Operating System :: OS Independent
221
+ Requires-Dist: pydantic[email]>=2.7.0
222
+ Requires-Python: >=3.10
223
+ Project-URL: changelog, https://scim2-models.readthedocs.io/en/latest/changelog.html
224
+ Project-URL: documentation, https://scim2-models.readthedocs.io
225
+ Project-URL: funding, https://github.com/sponsors/python-scim
226
+ Project-URL: repository, https://github.com/python-scim/scim2-models
227
+ Description-Content-Type: text/markdown
228
+
229
+ # scim2-models
230
+
231
+ [Pydantic](https://docs.pydantic.dev) models for SCIM schemas defined in [RFC7643](https://datatracker.ietf.org/doc/html/rfc7643.html) and [RFC7644](https://datatracker.ietf.org/doc/html/rfc7644.html).
232
+
233
+ This library provides utilities to parse and produce SCIM2 payloads, and handle them with native Python objects.
234
+ It aims to be used as a basis to build SCIM2 servers and clients.
235
+
236
+ ## What's SCIM anyway?
237
+
238
+ SCIM stands for System for Cross-domain Identity Management, and it is a provisioning protocol.
239
+ Provisioning is the action of managing a set of resources across different services, usually users and groups.
240
+ SCIM is often used between Identity Providers and applications in completion of standards like OAuth2 and OpenID Connect.
241
+ It allows users and groups creations, modifications and deletions to be synchronized between applications.
242
+
243
+ ## Installation
244
+
245
+ ```shell
246
+ pip install scim2-models
247
+ ```
248
+
249
+ ## Usage
250
+
251
+ Check the [tutorial](https://scim2-models.readthedocs.io/en/latest/tutorial.html) and the [reference](https://scim2-models.readthedocs.io/en/latest/reference.html) for more details.
252
+
253
+ ```python
254
+ from scim2_models import User
255
+ import datetime
256
+
257
+ payload = {
258
+ "schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
259
+ "id": "2819c223-7f76-453a-919d-413861904646",
260
+ "userName": "bjensen@example.com",
261
+ "meta": {
262
+ "resourceType": "User",
263
+ "created": "2010-01-23T04:56:22Z",
264
+ "lastModified": "2011-05-13T04:42:34Z",
265
+ "version": 'W\\/"3694e05e9dff590"',
266
+ "location": "https://example.com/v2/Users/2819c223-7f76-453a-919d-413861904646",
267
+ },
268
+ }
269
+
270
+ user = User.model_validate(payload)
271
+ assert user.user_name == "bjensen@example.com"
272
+ assert user.meta.created == datetime.datetime(
273
+ 2010, 1, 23, 4, 56, 22, tzinfo=datetime.timezone.utc
274
+ )
275
+ ```
276
+
277
+ scim2-models belongs in a collection of SCIM tools developed by [Yaal Coop](https://yaal.coop),
278
+ with [scim2-client](https://github.com/python-scim/scim2-client),
279
+ [scim2-tester](https://github.com/python-scim/scim2-tester) and
280
+ [scim2-cli](https://github.com/python-scim/scim2-cli)
@@ -1,10 +1,10 @@
1
1
  [build-system]
2
- requires = ["hatchling"]
3
- build-backend = "hatchling.build"
2
+ requires = ["uv_build>=0.8.9,<0.9.0"]
3
+ build-backend = "uv_build"
4
4
 
5
5
  [project]
6
6
  name = "scim2-models"
7
- version = "0.4.2"
7
+ version = "0.5.1"
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"}
@@ -25,7 +25,7 @@ classifiers = [
25
25
  "Operating System :: OS Independent",
26
26
  ]
27
27
 
28
- requires-python = ">= 3.9"
28
+ requires-python = ">= 3.10"
29
29
  dependencies = [
30
30
  "pydantic[email]>=2.7.0"
31
31
  ]
@@ -36,12 +36,15 @@ repository = "https://github.com/python-scim/scim2-models"
36
36
  changelog = "https://scim2-models.readthedocs.io/en/latest/changelog.html"
37
37
  funding = "https://github.com/sponsors/python-scim"
38
38
 
39
+ [tool.uv.build-backend]
40
+ module-root = ""
41
+
39
42
  [dependency-groups]
40
43
  dev = [
41
44
  "mypy>=1.13.0",
42
45
  "pytest>=8.2.1",
43
46
  "pytest-cov>=6.0.0",
44
- "pre-commit-uv>=4.1.4",
47
+ "prek>=0.1.0",
45
48
  "tox-uv>=1.16.0",
46
49
  ]
47
50
  doc = [
@@ -125,11 +128,11 @@ warn_required_dynamic_aliases = true
125
128
  requires = ["tox>=4.19"]
126
129
  env_list = [
127
130
  "style",
128
- "py39",
129
131
  "py310",
130
132
  "py311",
131
133
  "py312",
132
134
  "py313",
135
+ "py314",
133
136
  "minversions",
134
137
  "doc",
135
138
  "coverage",
@@ -146,12 +149,13 @@ commands = [
146
149
  skip_install = true
147
150
  runner = "uv-venv-runner"
148
151
  commands = [
149
- ["pre-commit", "run", "--all-files", "--show-diff-on-failure"],
152
+ ["prek", "run", "--all-files", "--show-diff-on-failure"],
150
153
  ]
151
154
 
152
155
  [tool.tox.env.minversions]
153
156
  runner = "uv-venv-runner"
154
157
  uv_resolution = "lowest-direct"
158
+ base_python = ["3.10"]
155
159
 
156
160
  [tool.tox.env.doc]
157
161
  dependency_groups = ["doc"]
@@ -1,7 +1,6 @@
1
1
  from inspect import isclass
2
2
  from typing import Annotated
3
3
  from typing import Any
4
- from typing import Optional
5
4
  from typing import get_origin
6
5
 
7
6
  from pydantic import Field
@@ -16,7 +15,7 @@ from .reference import Reference
16
15
  class ComplexAttribute(BaseModel):
17
16
  """A complex attribute as defined in :rfc:`RFC7643 §2.3.8 <7643#section-2.3.8>`."""
18
17
 
19
- _attribute_urn: Optional[str] = None
18
+ _attribute_urn: str | None = None
20
19
 
21
20
  def get_attribute_urn(self, field_name: str) -> str:
22
21
  """Build the full URN of the attribute.
@@ -30,20 +29,20 @@ class ComplexAttribute(BaseModel):
30
29
 
31
30
 
32
31
  class MultiValuedComplexAttribute(ComplexAttribute):
33
- type: Optional[str] = None
32
+ type: str | None = None
34
33
  """A label indicating the attribute's function."""
35
34
 
36
- primary: Optional[bool] = None
35
+ primary: bool | None = None
37
36
  """A Boolean value indicating the 'primary' or preferred attribute value
38
37
  for this attribute."""
39
38
 
40
- display: Annotated[Optional[str], Mutability.immutable] = None
39
+ display: Annotated[str | None, Mutability.immutable] = None
41
40
  """A human-readable name, primarily used for display purposes."""
42
41
 
43
- value: Optional[Any] = None
42
+ value: Any | None = None
44
43
  """The value of an entitlement."""
45
44
 
46
- ref: Optional[Reference[Any]] = Field(None, serialization_alias="$ref")
45
+ ref: Reference[Any] | None = Field(None, serialization_alias="$ref")
47
46
  """The reference URI of a target resource, if the attribute is a
48
47
  reference."""
49
48
 
@@ -53,5 +52,5 @@ def is_complex_attribute(type_: type) -> bool:
53
52
  return (
54
53
  get_origin(type_) != Reference
55
54
  and isclass(type_)
56
- and issubclass(type_, (ComplexAttribute, MultiValuedComplexAttribute))
55
+ and issubclass(type_, ComplexAttribute)
57
56
  )
@@ -96,7 +96,7 @@ class BaseModel(PydanticBaseModel):
96
96
  return field_annotation
97
97
 
98
98
  @classmethod
99
- def get_field_root_type(cls, attribute_name: str) -> Optional[type]:
99
+ def get_field_root_type(cls, attribute_name: str) -> type | None:
100
100
  """Extract the root type from a model field.
101
101
 
102
102
  This method unwraps complex type annotations to find the underlying
@@ -244,7 +244,7 @@ class BaseModel(PydanticBaseModel):
244
244
  return result
245
245
 
246
246
  def normalize_value(
247
- val: Any, model_class: Optional[type["BaseModel"]] = None
247
+ val: Any, model_class: type["BaseModel"] | None = None
248
248
  ) -> Any:
249
249
  """Normalize input value based on model class."""
250
250
  if not isinstance(val, dict):
@@ -504,7 +504,7 @@ class BaseModel(PydanticBaseModel):
504
504
  def model_validate(
505
505
  cls,
506
506
  *args: Any,
507
- scim_ctx: Optional[Context] = Context.DEFAULT,
507
+ scim_ctx: Context | None = Context.DEFAULT,
508
508
  original: Optional["BaseModel"] = None,
509
509
  **kwargs: Any,
510
510
  ) -> Self:
@@ -1,7 +1,6 @@
1
1
  from enum import Enum
2
2
  from typing import Annotated
3
3
  from typing import Any
4
- from typing import Optional
5
4
 
6
5
  from pydantic import Field
7
6
  from pydantic import PlainSerializer
@@ -19,30 +18,30 @@ class BulkOperation(ComplexAttribute):
19
18
  patch = "PATCH"
20
19
  delete = "DELETE"
21
20
 
22
- method: Optional[Method] = None
21
+ method: Method | None = None
23
22
  """The HTTP method of the current operation."""
24
23
 
25
- bulk_id: Optional[str] = None
24
+ bulk_id: str | None = None
26
25
  """The transient identifier of a newly created resource, unique within a
27
26
  bulk request and created by the client."""
28
27
 
29
- version: Optional[str] = None
28
+ version: str | None = None
30
29
  """The current resource version."""
31
30
 
32
- path: Optional[str] = None
31
+ path: str | None = None
33
32
  """The resource's relative path to the SCIM service provider's root."""
34
33
 
35
- data: Optional[Any] = None
34
+ data: Any | None = None
36
35
  """The resource data as it would appear for a single SCIM POST, PUT, or
37
36
  PATCH operation."""
38
37
 
39
- location: Optional[str] = None
38
+ location: str | None = None
40
39
  """The resource endpoint URL."""
41
40
 
42
- response: Optional[Any] = None
41
+ response: Any | None = None
43
42
  """The HTTP response body for the specified request operation."""
44
43
 
45
- status: Annotated[Optional[int], PlainSerializer(_int_to_str)] = None
44
+ status: Annotated[int | None, PlainSerializer(_int_to_str)] = None
46
45
  """The HTTP response status code for the requested operation."""
47
46
 
48
47
 
@@ -58,12 +57,12 @@ class BulkRequest(Message):
58
57
  "urn:ietf:params:scim:api:messages:2.0:BulkRequest"
59
58
  ]
60
59
 
61
- fail_on_errors: Optional[int] = None
60
+ fail_on_errors: int | None = None
62
61
  """An integer specifying the number of errors that the service provider
63
62
  will accept before the operation is terminated and an error response is
64
63
  returned."""
65
64
 
66
- operations: Optional[list[BulkOperation]] = Field(
65
+ operations: list[BulkOperation] | None = Field(
67
66
  None, serialization_alias="Operations"
68
67
  )
69
68
  """Defines operations within a bulk job."""
@@ -81,7 +80,7 @@ class BulkResponse(Message):
81
80
  "urn:ietf:params:scim:api:messages:2.0:BulkResponse"
82
81
  ]
83
82
 
84
- operations: Optional[list[BulkOperation]] = Field(
83
+ operations: list[BulkOperation] | None = Field(
85
84
  None, serialization_alias="Operations"
86
85
  )
87
86
  """Defines operations within a bulk job."""
@@ -1,5 +1,4 @@
1
1
  from typing import Annotated
2
- from typing import Optional
3
2
 
4
3
  from pydantic import PlainSerializer
5
4
 
@@ -15,14 +14,14 @@ class Error(Message):
15
14
  "urn:ietf:params:scim:api:messages:2.0:Error"
16
15
  ]
17
16
 
18
- status: Annotated[Optional[int], PlainSerializer(_int_to_str)] = None
17
+ status: Annotated[int | None, PlainSerializer(_int_to_str)] = None
19
18
  """The HTTP status code (see Section 6 of [RFC7231]) expressed as a JSON
20
19
  string."""
21
20
 
22
- scim_type: Optional[str] = None
21
+ scim_type: str | None = None
23
22
  """A SCIM detail error keyword."""
24
23
 
25
- detail: Optional[str] = None
24
+ detail: str | None = None
26
25
  """A detailed human-readable message."""
27
26
 
28
27
  @classmethod
@@ -1,7 +1,6 @@
1
1
  from typing import Annotated
2
2
  from typing import Any
3
3
  from typing import Generic
4
- from typing import Optional
5
4
 
6
5
  from pydantic import Field
7
6
  from pydantic import ValidationInfo
@@ -22,19 +21,17 @@ class ListResponse(Message, Generic[AnyResource], metaclass=_GenericMessageMetac
22
21
  "urn:ietf:params:scim:api:messages:2.0:ListResponse"
23
22
  ]
24
23
 
25
- total_results: Optional[int] = None
24
+ total_results: int | None = None
26
25
  """The total number of results returned by the list or query operation."""
27
26
 
28
- start_index: Optional[int] = None
27
+ start_index: int | None = None
29
28
  """The 1-based index of the first result in the current set of list
30
29
  results."""
31
30
 
32
- items_per_page: Optional[int] = None
31
+ items_per_page: int | None = None
33
32
  """The number of resources returned in a list response page."""
34
33
 
35
- resources: Optional[list[AnyResource]] = Field(
36
- None, serialization_alias="Resources"
37
- )
34
+ resources: list[AnyResource] | None = Field(None, serialization_alias="Resources")
38
35
  """A multi-valued list of complex objects containing the requested
39
36
  resources."""
40
37
 
@@ -1,7 +1,6 @@
1
+ from collections.abc import Callable
1
2
  from typing import Annotated
2
3
  from typing import Any
3
- from typing import Callable
4
- from typing import Optional
5
4
  from typing import Union
6
5
  from typing import get_args
7
6
  from typing import get_origin
@@ -23,14 +22,14 @@ class Message(ScimObject):
23
22
 
24
23
  def _create_schema_discriminator(
25
24
  resource_types_schemas: list[str],
26
- ) -> Callable[[Any], Optional[str]]:
25
+ ) -> Callable[[Any], str | None]:
27
26
  """Create a schema discriminator function for the given resource schemas.
28
27
 
29
28
  :param resource_types_schemas: List of valid resource schemas
30
29
  :return: Discriminator function for Pydantic
31
30
  """
32
31
 
33
- def get_schema_from_payload(payload: Any) -> Optional[str]:
32
+ def get_schema_from_payload(payload: Any) -> str | None:
34
33
  """Extract schema from SCIM payload for discrimination.
35
34
 
36
35
  :param payload: SCIM payload dict or object
@@ -89,7 +88,7 @@ def _create_tagged_resource_union(resource_union: Any) -> Any:
89
88
  for resource_type in resource_types
90
89
  ]
91
90
  # Dynamic union construction from tuple - MyPy can't validate this at compile time
92
- union = Union[tuple(tagged_resources)] # type: ignore
91
+ union = Union[tuple(tagged_resources)] # type: ignore # noqa: UP007
93
92
  return Annotated[union, discriminator]
94
93
 
95
94