scim2-client 0.2.0__py3-none-any.whl → 0.2.2__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_client/client.py CHANGED
@@ -1,11 +1,7 @@
1
1
  import json
2
2
  import json.decoder
3
3
  import sys
4
- from typing import Dict
5
- from typing import List
6
4
  from typing import Optional
7
- from typing import Tuple
8
- from typing import Type
9
5
  from typing import Union
10
6
 
11
7
  from httpx import Client
@@ -52,7 +48,7 @@ class SCIMClient:
52
48
  :class:`~scim2_models.ResourceType`, :class:`~scim2_models.Schema` and :class:`scim2_models.ServiceProviderConfig` are pre-loaded by default.
53
49
  """
54
50
 
55
- CREATION_RESPONSE_STATUS_CODES: List[int] = [
51
+ CREATION_RESPONSE_STATUS_CODES: list[int] = [
56
52
  201,
57
53
  409,
58
54
  307,
@@ -69,14 +65,14 @@ class SCIMClient:
69
65
  :rfc:`RFC7644 §3.12 <7644#section-3.12>`.
70
66
  """
71
67
 
72
- QUERY_RESPONSE_STATUS_CODES: List[int] = [200, 400, 307, 308, 401, 403, 404, 500]
68
+ QUERY_RESPONSE_STATUS_CODES: list[int] = [200, 400, 307, 308, 401, 403, 404, 500]
73
69
  """Resource querying HTTP codes.
74
70
 
75
71
  As defined at :rfc:`RFC7644 §3.4.2 <7644#section-3.4.2>` and
76
72
  :rfc:`RFC7644 §3.12 <7644#section-3.12>`.
77
73
  """
78
74
 
79
- SEARCH_RESPONSE_STATUS_CODES: List[int] = [
75
+ SEARCH_RESPONSE_STATUS_CODES: list[int] = [
80
76
  200,
81
77
  307,
82
78
  308,
@@ -95,7 +91,7 @@ class SCIMClient:
95
91
  :rfc:`RFC7644 §3.12 <7644#section-3.12>`.
96
92
  """
97
93
 
98
- DELETION_RESPONSE_STATUS_CODES: List[int] = [
94
+ DELETION_RESPONSE_STATUS_CODES: list[int] = [
99
95
  204,
100
96
  307,
101
97
  308,
@@ -113,7 +109,7 @@ class SCIMClient:
113
109
  :rfc:`RFC7644 §3.12 <7644#section-3.12>`.
114
110
  """
115
111
 
116
- REPLACEMENT_RESPONSE_STATUS_CODES: List[int] = [
112
+ REPLACEMENT_RESPONSE_STATUS_CODES: list[int] = [
117
113
  200,
118
114
  307,
119
115
  308,
@@ -132,17 +128,19 @@ class SCIMClient:
132
128
  :rfc:`RFC7644 §3.12 <7644#section-3.12>`.
133
129
  """
134
130
 
135
- def __init__(self, client: Client, resource_types: Optional[Tuple[Type]] = None):
131
+ def __init__(
132
+ self, client: Client, resource_types: Optional[tuple[type[Resource]]] = None
133
+ ):
136
134
  self.client = client
137
135
  self.resource_types = tuple(
138
136
  set(resource_types or []) | {ResourceType, Schema, ServiceProviderConfig}
139
137
  )
140
138
 
141
- def check_resource_type(self, resource_type):
139
+ def check_resource_type(self, resource_type: type[Resource]) -> None:
142
140
  if resource_type not in self.resource_types:
143
141
  raise SCIMRequestError(f"Unknown resource type: '{resource_type}'")
144
142
 
145
- def resource_endpoint(self, resource_type: Type):
143
+ def resource_endpoint(self, resource_type: Optional[type[Resource]]) -> str:
146
144
  if resource_type is None:
147
145
  return "/"
148
146
 
@@ -160,12 +158,12 @@ class SCIMClient:
160
158
  def check_response(
161
159
  self,
162
160
  response: Response,
163
- expected_status_codes: List[int],
164
- expected_types: Optional[Type] = None,
161
+ expected_status_codes: Optional[list[int]] = None,
162
+ expected_types: Optional[list[type[Resource]]] = None,
165
163
  check_response_payload: bool = True,
166
164
  raise_scim_errors: bool = True,
167
165
  scim_ctx: Optional[Context] = None,
168
- ):
166
+ ) -> Union[Error, None, dict, type[Resource]]:
169
167
  if expected_status_codes and response.status_code not in expected_status_codes:
170
168
  raise UnexpectedStatusCode(source=response)
171
169
 
@@ -175,11 +173,9 @@ class SCIMClient:
175
173
  # SCIM are known to informally use "application/json".
176
174
  # https://datatracker.ietf.org/doc/html/rfc7644.html#section-8.1
177
175
 
176
+ actual_content_type = response.headers.get("content-type", "").split(";").pop(0)
178
177
  expected_response_content_types = ("application/scim+json", "application/json")
179
- if (
180
- response.headers.get("content-type").split(";").pop(0)
181
- not in expected_response_content_types
182
- ):
178
+ if actual_content_type not in expected_response_content_types:
183
179
  raise UnexpectedContentType(source=response)
184
180
 
185
181
  # In addition to returning an HTTP response code, implementers MUST return
@@ -215,11 +211,11 @@ class SCIMClient:
215
211
  expected_types, response_payload, with_extensions=False
216
212
  )
217
213
 
218
- if not actual_type:
219
- expected = ", ".join([type.__name__ for type in expected_types])
214
+ if response_payload and not actual_type:
215
+ expected = ", ".join([type_.__name__ for type_ in expected_types])
220
216
  try:
221
217
  schema = ", ".join(response_payload["schemas"])
222
- message = f"Expected type {expected} but got unknow resource with schemas: {schema}"
218
+ message = f"Expected type {expected} but got unknown resource with schemas: {schema}"
223
219
  except KeyError:
224
220
  message = (
225
221
  f"Expected type {expected} but got undefined object with no schema"
@@ -237,15 +233,14 @@ class SCIMClient:
237
233
 
238
234
  def create(
239
235
  self,
240
- resource: Union[AnyResource, Dict],
236
+ resource: Union[AnyResource, dict],
241
237
  check_request_payload: bool = True,
242
238
  check_response_payload: bool = True,
243
- expected_status_codes: Optional[List[int]] = CREATION_RESPONSE_STATUS_CODES,
239
+ expected_status_codes: Optional[list[int]] = CREATION_RESPONSE_STATUS_CODES,
244
240
  raise_scim_errors: bool = True,
245
241
  **kwargs,
246
- ) -> Union[AnyResource, Error, Dict]:
247
- """Perform a POST request to create, as defined in :rfc:`RFC7644 §3.3
248
- <7644#section-3.3>`.
242
+ ) -> Union[AnyResource, Error, dict]:
243
+ """Perform a POST request to create, as defined in :rfc:`RFC7644 §3.3 <7644#section-3.3>`.
249
244
 
250
245
  :param resource: The resource to create
251
246
  If is a :data:`dict`, the resource type will be guessed from the schema.
@@ -300,10 +295,10 @@ class SCIMClient:
300
295
  try:
301
296
  resource = resource_type.model_validate(resource)
302
297
  except ValidationError as exc:
303
- scim_exc = RequestPayloadValidationError(source=resource)
298
+ scim_validation_exc = RequestPayloadValidationError(source=resource)
304
299
  if sys.version_info >= (3, 11): # pragma: no cover
305
- scim_exc.add_note(str(exc))
306
- raise scim_exc from exc
300
+ scim_validation_exc.add_note(str(exc))
301
+ raise scim_validation_exc from exc
307
302
 
308
303
  self.check_resource_type(resource_type)
309
304
  url = kwargs.pop("url", self.resource_endpoint(resource_type))
@@ -312,10 +307,10 @@ class SCIMClient:
312
307
  try:
313
308
  response = self.client.post(url, json=payload, **kwargs)
314
309
  except RequestError as exc:
315
- scim_exc = RequestNetworkError(source=payload)
310
+ scim_network_exc = RequestNetworkError(source=payload)
316
311
  if sys.version_info >= (3, 11): # pragma: no cover
317
- scim_exc.add_note(str(exc))
318
- raise scim_exc from exc
312
+ scim_network_exc.add_note(str(exc))
313
+ raise scim_network_exc from exc
319
314
 
320
315
  return self.check_response(
321
316
  response=response,
@@ -328,17 +323,16 @@ class SCIMClient:
328
323
 
329
324
  def query(
330
325
  self,
331
- resource_type: Optional[Type] = None,
326
+ resource_type: Optional[type[Resource]] = None,
332
327
  id: Optional[str] = None,
333
- search_request: Optional[Union[SearchRequest, Dict]] = None,
328
+ search_request: Optional[Union[SearchRequest, dict]] = None,
334
329
  check_request_payload: bool = True,
335
330
  check_response_payload: bool = True,
336
- expected_status_codes: Optional[List[int]] = QUERY_RESPONSE_STATUS_CODES,
331
+ expected_status_codes: Optional[list[int]] = QUERY_RESPONSE_STATUS_CODES,
337
332
  raise_scim_errors: bool = True,
338
333
  **kwargs,
339
- ) -> Union[AnyResource, ListResponse[AnyResource], Error, Dict]:
340
- """Perform a GET request to read resources, as defined in :rfc:`RFC7644
341
- §3.4.2 <7644#section-3.4.2>`.
334
+ ) -> Union[AnyResource, ListResponse[AnyResource], Error, dict]:
335
+ """Perform a GET request to read resources, as defined in :rfc:`RFC7644 §3.4.2 <7644#section-3.4.2>`.
342
336
 
343
337
  - If `id` is not :data:`None`, the resource with the exact id will be reached.
344
338
  - If `id` is :data:`None`, all the resources with the given type will be reached.
@@ -404,19 +398,19 @@ class SCIMClient:
404
398
  if resource_type and check_request_payload:
405
399
  self.check_resource_type(resource_type)
406
400
 
401
+ payload: Optional[SearchRequest]
407
402
  if not check_request_payload:
408
403
  payload = search_request
409
404
 
410
- else:
411
- payload = (
412
- search_request.model_dump(
413
- exclude_unset=True,
414
- scim_ctx=Context.RESOURCE_QUERY_REQUEST,
415
- )
416
- if search_request
417
- else None
405
+ elif isinstance(search_request, SearchRequest):
406
+ payload = search_request.model_dump(
407
+ exclude_unset=True,
408
+ scim_ctx=Context.RESOURCE_QUERY_REQUEST,
418
409
  )
419
410
 
411
+ else:
412
+ payload = None
413
+
420
414
  url = kwargs.pop("url", self.resource_endpoint(resource_type))
421
415
 
422
416
  if resource_type is None:
@@ -459,12 +453,11 @@ class SCIMClient:
459
453
  search_request: Optional[SearchRequest] = None,
460
454
  check_request_payload: bool = True,
461
455
  check_response_payload: bool = True,
462
- expected_status_codes: Optional[List[int]] = SEARCH_RESPONSE_STATUS_CODES,
456
+ expected_status_codes: Optional[list[int]] = SEARCH_RESPONSE_STATUS_CODES,
463
457
  raise_scim_errors: bool = True,
464
458
  **kwargs,
465
- ) -> Union[AnyResource, ListResponse[AnyResource], Error, Dict]:
466
- """Perform a POST search request to read all available resources, as
467
- defined in :rfc:`RFC7644 §3.4.3 <7644#section-3.4.3>`.
459
+ ) -> Union[AnyResource, ListResponse[AnyResource], Error, dict]:
460
+ """Perform a POST search request to read all available resources, as defined in :rfc:`RFC7644 §3.4.3 <7644#section-3.4.3>`.
468
461
 
469
462
  :param resource_types: Resource type or union of types expected
470
463
  to be read from the response.
@@ -536,15 +529,14 @@ class SCIMClient:
536
529
 
537
530
  def delete(
538
531
  self,
539
- resource_type: Type,
532
+ resource_type: type,
540
533
  id: str,
541
534
  check_response_payload: bool = True,
542
- expected_status_codes: Optional[List[int]] = DELETION_RESPONSE_STATUS_CODES,
535
+ expected_status_codes: Optional[list[int]] = DELETION_RESPONSE_STATUS_CODES,
543
536
  raise_scim_errors: bool = True,
544
537
  **kwargs,
545
- ) -> Optional[Union[Error, Dict]]:
546
- """Perform a DELETE request to create, as defined in :rfc:`RFC7644 §3.6
547
- <7644#section-3.6>`.
538
+ ) -> Optional[Union[Error, dict]]:
539
+ """Perform a DELETE request to create, as defined in :rfc:`RFC7644 §3.6 <7644#section-3.6>`.
548
540
 
549
541
  :param resource_type: The type of the resource to delete.
550
542
  :param id: The type id the resource to delete.
@@ -593,15 +585,14 @@ class SCIMClient:
593
585
 
594
586
  def replace(
595
587
  self,
596
- resource: Union[AnyResource, Dict],
588
+ resource: Union[AnyResource, dict],
597
589
  check_request_payload: bool = True,
598
590
  check_response_payload: bool = True,
599
- expected_status_codes: Optional[List[int]] = REPLACEMENT_RESPONSE_STATUS_CODES,
591
+ expected_status_codes: Optional[list[int]] = REPLACEMENT_RESPONSE_STATUS_CODES,
600
592
  raise_scim_errors: bool = True,
601
593
  **kwargs,
602
- ) -> Union[AnyResource, Error, Dict]:
603
- """Perform a PUT request to replace a resource, as defined in
604
- :rfc:`RFC7644 §3.5.1 <7644#section-3.5.1>`.
594
+ ) -> Union[AnyResource, Error, dict]:
595
+ """Perform a PUT request to replace a resource, as defined in :rfc:`RFC7644 §3.5.1 <7644#section-3.5.1>`.
605
596
 
606
597
  :param resource: The new resource to replace.
607
598
  If is a :data:`dict`, the resource type will be guessed from the schema.
@@ -630,8 +621,7 @@ class SCIMClient:
630
621
 
631
622
  user = scim.query(User, "my-used-id")
632
623
  user.display_name = "Fancy New Name"
633
- response = scim.update(user)
634
- # 'response' may be a User or an Error object
624
+ updated_user = scim.replace(user)
635
625
 
636
626
  .. tip::
637
627
 
@@ -659,10 +649,10 @@ class SCIMClient:
659
649
  try:
660
650
  resource = resource_type.model_validate(resource)
661
651
  except ValidationError as exc:
662
- scim_exc = RequestPayloadValidationError(source=resource)
652
+ scim_validation_exc = RequestPayloadValidationError(source=resource)
663
653
  if sys.version_info >= (3, 11): # pragma: no cover
664
- scim_exc.add_note(str(exc))
665
- raise scim_exc from exc
654
+ scim_validation_exc.add_note(str(exc))
655
+ raise scim_validation_exc from exc
666
656
 
667
657
  self.check_resource_type(resource_type)
668
658
 
@@ -677,10 +667,10 @@ class SCIMClient:
677
667
  try:
678
668
  response = self.client.put(url, json=payload, **kwargs)
679
669
  except RequestError as exc:
680
- scim_exc = RequestNetworkError(source=payload)
670
+ scim_network_exc = RequestNetworkError(source=payload)
681
671
  if sys.version_info >= (3, 11): # pragma: no cover
682
- scim_exc.add_note(str(exc))
683
- raise scim_exc from exc
672
+ scim_network_exc.add_note(str(exc))
673
+ raise scim_network_exc from exc
684
674
 
685
675
  return self.check_response(
686
676
  response=response,
@@ -692,6 +682,6 @@ class SCIMClient:
692
682
  )
693
683
 
694
684
  def modify(
695
- self, resource: Union[AnyResource, Dict], op: PatchOp, **kwargs
696
- ) -> Optional[Union[AnyResource, Dict]]:
685
+ self, resource: Union[AnyResource, dict], op: PatchOp, **kwargs
686
+ ) -> Optional[Union[AnyResource, dict]]:
697
687
  raise NotImplementedError()
scim2_client/errors.py CHANGED
@@ -25,7 +25,7 @@ class SCIMRequestError(SCIMClientError):
25
25
  class RequestNetworkError(SCIMRequestError):
26
26
  """Error raised when a network error happened during request.
27
27
 
28
- This error is raised when a :class:`httpx.RequestError` has been catched while performing a request.
28
+ This error is raised when a :class:`httpx.RequestError` has been caught while performing a request.
29
29
  The original :class:`~httpx.RequestError` is available with :attr:`~BaseException.__cause__`.
30
30
  """
31
31
 
@@ -35,29 +35,32 @@ class RequestNetworkError(SCIMRequestError):
35
35
 
36
36
 
37
37
  class RequestPayloadValidationError(SCIMRequestError):
38
- """Error raised when an invalid request payload has been passed to
39
- SCIMClient.
38
+ """Error raised when an invalid request payload has been passed to SCIMClient.
40
39
 
41
- This error is raised when a :class:`pydantic.ValidationError` has been catched
40
+ This error is raised when a :class:`pydantic.ValidationError` has been caught
42
41
  while validating the client request payload.
43
42
  The original :class:`~pydantic.ValidationError` is available with :attr:`~BaseException.__cause__`.
44
43
 
45
44
  .. code-block:: python
46
45
 
47
46
  try:
48
- scim.create({"schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"], "active": "not-a-bool"})
47
+ scim.create(
48
+ {
49
+ "schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
50
+ "active": "not-a-bool",
51
+ }
52
+ )
49
53
  except RequestPayloadValidationError as exc:
50
54
  print("Original validation error cause", exc.__cause__)
51
55
  """
52
56
 
53
57
  def __init__(self, *args, **kwargs):
54
- message = kwargs.pop("message", "Server response payload validation error")
58
+ message = kwargs.pop("message", "Server request payload validation error")
55
59
  super().__init__(message, *args, **kwargs)
56
60
 
57
61
 
58
62
  class SCIMResponseError(SCIMClientError):
59
- """Base exception for errors happening during response payload
60
- validation."""
63
+ """Base exception for errors happening during response payload validation."""
61
64
 
62
65
 
63
66
  class SCIMResponseErrorObject(SCIMResponseError):
@@ -75,8 +78,7 @@ class SCIMResponseErrorObject(SCIMResponseError):
75
78
 
76
79
 
77
80
  class UnexpectedStatusCode(SCIMResponseError):
78
- """Error raised when a server returned an unexpected status code for a
79
- given :class:`~scim2_models.Context`."""
81
+ """Error raised when a server returned an unexpected status code for a given :class:`~scim2_models.Context`."""
80
82
 
81
83
  def __init__(self, *args, **kwargs):
82
84
  message = kwargs.pop(
@@ -87,8 +89,7 @@ class UnexpectedStatusCode(SCIMResponseError):
87
89
 
88
90
 
89
91
  class UnexpectedContentType(SCIMResponseError):
90
- """Error raised when a server returned an unexpected `Content-Type` header
91
- in a response."""
92
+ """Error raised when a server returned an unexpected `Content-Type` header in a response."""
92
93
 
93
94
  def __init__(self, *args, **kwargs):
94
95
  content_type = kwargs["source"].headers.get("content-type", "")
@@ -105,10 +106,9 @@ class UnexpectedContentFormat(SCIMResponseError):
105
106
 
106
107
 
107
108
  class ResponsePayloadValidationError(SCIMResponseError):
108
- """Error raised when the server returned a payload that cannot be
109
- validated.
109
+ """Error raised when the server returned a payload that cannot be validated.
110
110
 
111
- This error is raised when a :class:`pydantic.ValidationError` has been catched
111
+ This error is raised when a :class:`pydantic.ValidationError` has been caught
112
112
  while validating the server response payload.
113
113
  The original :class:`~pydantic.ValidationError` is available with :attr:`~BaseException.__cause__`.
114
114
 
scim2_client/py.typed ADDED
File without changes
@@ -0,0 +1,290 @@
1
+ Metadata-Version: 2.3
2
+ Name: scim2-client
3
+ Version: 0.2.2
4
+ Summary: Pythonically build SCIM requests and parse SCIM responses
5
+ Project-URL: documentation, https://scim2-client.readthedocs.io
6
+ Project-URL: repository, https://github.com/python-scim/scim2-client
7
+ Project-URL: changelog, https://scim2-client.readthedocs.io/en/latest/changelog.html
8
+ Project-URL: funding, https://github.com/sponsors/python-scim
9
+ Author-email: Yaal Coop <contact@yaal.coop>
10
+ License: Apache License
11
+ Version 2.0, January 2004
12
+ http://www.apache.org/licenses/
13
+
14
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
15
+
16
+ 1. Definitions.
17
+
18
+ "License" shall mean the terms and conditions for use, reproduction,
19
+ and distribution as defined by Sections 1 through 9 of this document.
20
+
21
+ "Licensor" shall mean the copyright owner or entity authorized by
22
+ the copyright owner that is granting the License.
23
+
24
+ "Legal Entity" shall mean the union of the acting entity and all
25
+ other entities that control, are controlled by, or are under common
26
+ control with that entity. For the purposes of this definition,
27
+ "control" means (i) the power, direct or indirect, to cause the
28
+ direction or management of such entity, whether by contract or
29
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
30
+ outstanding shares, or (iii) beneficial ownership of such entity.
31
+
32
+ "You" (or "Your") shall mean an individual or Legal Entity
33
+ exercising permissions granted by this License.
34
+
35
+ "Source" form shall mean the preferred form for making modifications,
36
+ including but not limited to software source code, documentation
37
+ source, and configuration files.
38
+
39
+ "Object" form shall mean any form resulting from mechanical
40
+ transformation or translation of a Source form, including but
41
+ not limited to compiled object code, generated documentation,
42
+ and conversions to other media types.
43
+
44
+ "Work" shall mean the work of authorship, whether in Source or
45
+ Object form, made available under the License, as indicated by a
46
+ copyright notice that is included in or attached to the work
47
+ (an example is provided in the Appendix below).
48
+
49
+ "Derivative Works" shall mean any work, whether in Source or Object
50
+ form, that is based on (or derived from) the Work and for which the
51
+ editorial revisions, annotations, elaborations, or other modifications
52
+ represent, as a whole, an original work of authorship. For the purposes
53
+ of this License, Derivative Works shall not include works that remain
54
+ separable from, or merely link (or bind by name) to the interfaces of,
55
+ the Work and Derivative Works thereof.
56
+
57
+ "Contribution" shall mean any work of authorship, including
58
+ the original version of the Work and any modifications or additions
59
+ to that Work or Derivative Works thereof, that is intentionally
60
+ submitted to Licensor for inclusion in the Work by the copyright owner
61
+ or by an individual or Legal Entity authorized to submit on behalf of
62
+ the copyright owner. For the purposes of this definition, "submitted"
63
+ means any form of electronic, verbal, or written communication sent
64
+ to the Licensor or its representatives, including but not limited to
65
+ communication on electronic mailing lists, source code control systems,
66
+ and issue tracking systems that are managed by, or on behalf of, the
67
+ Licensor for the purpose of discussing and improving the Work, but
68
+ excluding communication that is conspicuously marked or otherwise
69
+ designated in writing by the copyright owner as "Not a Contribution."
70
+
71
+ "Contributor" shall mean Licensor and any individual or Legal Entity
72
+ on behalf of whom a Contribution has been received by Licensor and
73
+ subsequently incorporated within the Work.
74
+
75
+ 2. Grant of Copyright License. Subject to the terms and conditions of
76
+ this License, each Contributor hereby grants to You a perpetual,
77
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
78
+ copyright license to reproduce, prepare Derivative Works of,
79
+ publicly display, publicly perform, sublicense, and distribute the
80
+ Work and such Derivative Works in Source or Object form.
81
+
82
+ 3. Grant of Patent License. Subject to the terms and conditions of
83
+ this License, each Contributor hereby grants to You a perpetual,
84
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
85
+ (except as stated in this section) patent license to make, have made,
86
+ use, offer to sell, sell, import, and otherwise transfer the Work,
87
+ where such license applies only to those patent claims licensable
88
+ by such Contributor that are necessarily infringed by their
89
+ Contribution(s) alone or by combination of their Contribution(s)
90
+ with the Work to which such Contribution(s) was submitted. If You
91
+ institute patent litigation against any entity (including a
92
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
93
+ or a Contribution incorporated within the Work constitutes direct
94
+ or contributory patent infringement, then any patent licenses
95
+ granted to You under this License for that Work shall terminate
96
+ as of the date such litigation is filed.
97
+
98
+ 4. Redistribution. You may reproduce and distribute copies of the
99
+ Work or Derivative Works thereof in any medium, with or without
100
+ modifications, and in Source or Object form, provided that You
101
+ meet the following conditions:
102
+
103
+ (a) You must give any other recipients of the Work or
104
+ Derivative Works a copy of this License; and
105
+
106
+ (b) You must cause any modified files to carry prominent notices
107
+ stating that You changed the files; and
108
+
109
+ (c) You must retain, in the Source form of any Derivative Works
110
+ that You distribute, all copyright, patent, trademark, and
111
+ attribution notices from the Source form of the Work,
112
+ excluding those notices that do not pertain to any part of
113
+ the Derivative Works; and
114
+
115
+ (d) If the Work includes a "NOTICE" text file as part of its
116
+ distribution, then any Derivative Works that You distribute must
117
+ include a readable copy of the attribution notices contained
118
+ within such NOTICE file, excluding those notices that do not
119
+ pertain to any part of the Derivative Works, in at least one
120
+ of the following places: within a NOTICE text file distributed
121
+ as part of the Derivative Works; within the Source form or
122
+ documentation, if provided along with the Derivative Works; or,
123
+ within a display generated by the Derivative Works, if and
124
+ wherever such third-party notices normally appear. The contents
125
+ of the NOTICE file are for informational purposes only and
126
+ do not modify the License. You may add Your own attribution
127
+ notices within Derivative Works that You distribute, alongside
128
+ or as an addendum to the NOTICE text from the Work, provided
129
+ that such additional attribution notices cannot be construed
130
+ as modifying the License.
131
+
132
+ You may add Your own copyright statement to Your modifications and
133
+ may provide additional or different license terms and conditions
134
+ for use, reproduction, or distribution of Your modifications, or
135
+ for any such Derivative Works as a whole, provided Your use,
136
+ reproduction, and distribution of the Work otherwise complies with
137
+ the conditions stated in this License.
138
+
139
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
140
+ any Contribution intentionally submitted for inclusion in the Work
141
+ by You to the Licensor shall be under the terms and conditions of
142
+ this License, without any additional terms or conditions.
143
+ Notwithstanding the above, nothing herein shall supersede or modify
144
+ the terms of any separate license agreement you may have executed
145
+ with Licensor regarding such Contributions.
146
+
147
+ 6. Trademarks. This License does not grant permission to use the trade
148
+ names, trademarks, service marks, or product names of the Licensor,
149
+ except as required for reasonable and customary use in describing the
150
+ origin of the Work and reproducing the content of the NOTICE file.
151
+
152
+ 7. Disclaimer of Warranty. Unless required by applicable law or
153
+ agreed to in writing, Licensor provides the Work (and each
154
+ Contributor provides its Contributions) on an "AS IS" BASIS,
155
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
156
+ implied, including, without limitation, any warranties or conditions
157
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
158
+ PARTICULAR PURPOSE. You are solely responsible for determining the
159
+ appropriateness of using or redistributing the Work and assume any
160
+ risks associated with Your exercise of permissions under this License.
161
+
162
+ 8. Limitation of Liability. In no event and under no legal theory,
163
+ whether in tort (including negligence), contract, or otherwise,
164
+ unless required by applicable law (such as deliberate and grossly
165
+ negligent acts) or agreed to in writing, shall any Contributor be
166
+ liable to You for damages, including any direct, indirect, special,
167
+ incidental, or consequential damages of any character arising as a
168
+ result of this License or out of the use or inability to use the
169
+ Work (including but not limited to damages for loss of goodwill,
170
+ work stoppage, computer failure or malfunction, or any and all
171
+ other commercial damages or losses), even if such Contributor
172
+ has been advised of the possibility of such damages.
173
+
174
+ 9. Accepting Warranty or Additional Liability. While redistributing
175
+ the Work or Derivative Works thereof, You may choose to offer,
176
+ and charge a fee for, acceptance of support, warranty, indemnity,
177
+ or other liability obligations and/or rights consistent with this
178
+ License. However, in accepting such obligations, You may act only
179
+ on Your own behalf and on Your sole responsibility, not on behalf
180
+ of any other Contributor, and only if You agree to indemnify,
181
+ defend, and hold each Contributor harmless for any liability
182
+ incurred by, or claims asserted against, such Contributor by reason
183
+ of your accepting any such warranty or additional liability.
184
+
185
+ END OF TERMS AND CONDITIONS
186
+
187
+ APPENDIX: How to apply the Apache License to your work.
188
+
189
+ To apply the Apache License to your work, attach the following
190
+ boilerplate notice, with the fields enclosed by brackets "[]"
191
+ replaced with your own identifying information. (Don't include
192
+ the brackets!) The text should be enclosed in the appropriate
193
+ comment syntax for the file format. We also recommend that a
194
+ file or class name and description of purpose be included on the
195
+ same "printed page" as the copyright notice for easier
196
+ identification within third-party archives.
197
+
198
+ Copyright [yyyy] [name of copyright owner]
199
+
200
+ Licensed under the Apache License, Version 2.0 (the "License");
201
+ you may not use this file except in compliance with the License.
202
+ You may obtain a copy of the License at
203
+
204
+ http://www.apache.org/licenses/LICENSE-2.0
205
+
206
+ Unless required by applicable law or agreed to in writing, software
207
+ distributed under the License is distributed on an "AS IS" BASIS,
208
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
209
+ See the License for the specific language governing permissions and
210
+ limitations under the License.
211
+ Keywords: api,httpx,provisioning,rfc7643,rfc7644,scim,scim2
212
+ Classifier: Development Status :: 3 - Alpha
213
+ Classifier: Environment :: Web Environment
214
+ Classifier: Intended Audience :: Developers
215
+ Classifier: License :: OSI Approved :: Apache Software License
216
+ Classifier: Operating System :: OS Independent
217
+ Classifier: Programming Language :: Python
218
+ Classifier: Programming Language :: Python :: 3.9
219
+ Classifier: Programming Language :: Python :: 3.10
220
+ Classifier: Programming Language :: Python :: 3.11
221
+ Classifier: Programming Language :: Python :: 3.12
222
+ Classifier: Programming Language :: Python :: 3.13
223
+ Classifier: Programming Language :: Python :: Implementation :: CPython
224
+ Requires-Python: >=3.9
225
+ Requires-Dist: httpx>=0.24.0
226
+ Requires-Dist: scim2-models>=0.2.0
227
+ Description-Content-Type: text/markdown
228
+
229
+ # scim2-client
230
+
231
+ A SCIM client Python library built upon [scim2-models](https://scim2-models.readthedocs.io) and [httpx](https://github.com/encode/httpx),
232
+ that pythonically build requests and parse responses,
233
+ following the [RFC7643](https://datatracker.ietf.org/doc/html/rfc7643.html) and [RFC7644](https://datatracker.ietf.org/doc/html/rfc7644.html) specifications.
234
+
235
+ It aims to be used in SCIM client applications, or in unit tests for SCIM server applications.
236
+
237
+ ## What's SCIM anyway?
238
+
239
+ SCIM stands for System for Cross-domain Identity Management, and it is a provisioning protocol.
240
+ Provisioning is the action of managing a set of resources across different services, usually users and groups.
241
+ SCIM is often used between Identity Providers and applications in completion of standards like OAuth2 and OpenID Connect.
242
+ It allows users and groups creations, modifications and deletions to be synchronized between applications.
243
+
244
+ ## Installation
245
+
246
+ ```shell
247
+ pip install scim2-client
248
+ ```
249
+
250
+ ## Usage
251
+
252
+ Check the [tutorial](https://scim2-client.readthedocs.io/en/latest/tutorial.html) and the [reference](https://scim2-client.readthedocs.io/en/latest/reference.html) for more details.
253
+
254
+ Here is an example of usage:
255
+
256
+ ```python
257
+ import datetime
258
+ from httpx import Client
259
+ from scim2_models import User, EnterpriseUser, Group, Error
260
+ from scim2_client import SCIMClient
261
+
262
+ client = Client(base_url=f"https://auth.example/scim/v2", headers={"Authorization": "Bearer foobar"})
263
+ scim = SCIMClient(client, resource_types=(User[EnterpriseUser], Group))
264
+
265
+ # Query resources
266
+ user = scim.query(User[EnterpriseUser], "2819c223-7f76-453a-919d-413861904646")
267
+ assert user.user_name == "bjensen@example.com"
268
+ assert user.meta.last_updated == datetime.datetime(
269
+ 2024, 4, 13, 12, 0, 0, tzinfo=datetime.timezone.utc
270
+ )
271
+
272
+ # Update resources
273
+ user.display_name = "Babs Jensen"
274
+ user = scim.replace(user)
275
+ assert user.display_name == "Babs Jensen"
276
+ assert user.meta.last_updated == datetime.datetime(
277
+ 2024, 4, 13, 12, 0, 30, tzinfo=datetime.timezone.utc
278
+ )
279
+
280
+ # Create resources
281
+ payload = User(user_name="bjensen@example.com")
282
+ response = scim.create(user)
283
+ assert isinstance(response, Error)
284
+ assert response.detail == "One or more of the attribute values are already in use or are reserved."
285
+ ```
286
+
287
+ scim2-client belongs in a collection of SCIM tools developed by [Yaal Coop](https://yaal.coop),
288
+ with [scim2-models](https://github.com/python-scim/scim2-models),
289
+ [scim2-tester](https://github.com/python-scim/scim2-tester) and
290
+ [scim2-cli](https://github.com/python-scim/scim2-cli)
@@ -0,0 +1,8 @@
1
+ scim2_client/__init__.py,sha256=vgrTJZIqJLZc72XCJwYKrSCGUDkMZTJjCJiZkHERZGs,780
2
+ scim2_client/client.py,sha256=CZutnTgabPAR4nxaztb-oUT8CjclBtyUgP4dAI-1u_Q,27427
3
+ scim2_client/errors.py,sha256=XH5e8zx3a1228GJjxugEgwO-shYAZWQx6LK_yZyX53E,4495
4
+ scim2_client/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ scim2_client-0.2.2.dist-info/METADATA,sha256=cOD8Ybin5JVFxUvIrJSXrSMyTqdsyAYfCe-NJdeIMbI,16742
6
+ scim2_client-0.2.2.dist-info/WHEEL,sha256=3U_NnUcV_1B1kPkYaPzN-irRckL5VW_lytn0ytO_kRY,87
7
+ scim2_client-0.2.2.dist-info/licenses/LICENSE.md,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
8
+ scim2_client-0.2.2.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.9.0
2
+ Generator: hatchling 1.26.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent 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
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -1,88 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: scim2-client
3
- Version: 0.2.0
4
- Summary: Pythonically build SCIM requests and parse SCIM responses
5
- License: MIT
6
- Keywords: scim,scim2,provisioning,httpx,api
7
- Author: Yaal Coop
8
- Author-email: contact@yaal.coop
9
- Requires-Python: >=3.9,<4.0
10
- Classifier: Development Status :: 3 - Alpha
11
- Classifier: Environment :: Web Environment
12
- Classifier: Intended Audience :: Developers
13
- Classifier: License :: OSI Approved :: MIT License
14
- Classifier: Operating System :: OS Independent
15
- Classifier: Programming Language :: Python
16
- Classifier: Programming Language :: Python :: 3
17
- Classifier: Programming Language :: Python :: 3.9
18
- Classifier: Programming Language :: Python :: 3.10
19
- Classifier: Programming Language :: Python :: 3.11
20
- Classifier: Programming Language :: Python :: 3.12
21
- Classifier: Programming Language :: Python :: Implementation :: CPython
22
- Requires-Dist: httpx (>=0.24.0)
23
- Requires-Dist: scim2-models (>=0.2.0,<0.3.0)
24
- Description-Content-Type: text/markdown
25
-
26
- # scim2-client
27
-
28
- A SCIM client Python library built upon [scim2-models](https://scim2-models.readthedocs.io) and [httpx](https://github.com/encode/httpx),
29
- that pythonically build requests and parse responses,
30
- following the [RFC7643](https://datatracker.ietf.org/doc/html/rfc7643.html) and [RFC7644](https://datatracker.ietf.org/doc/html/rfc7644.html) specifications.
31
-
32
- It aims to be used in SCIM client applications, or in unit tests for SCIM server applications.
33
-
34
- ## What's SCIM anyway?
35
-
36
- SCIM stands for System for Cross-domain Identity Management, and it is a provisioning protocol.
37
- Provisioning is the action of managing a set of resources across different services, usually users and groups.
38
- SCIM is often used between Identity Providers and applications in completion of standards like OAuth2 and OpenID Connect.
39
- It allows users and groups creations, modifications and deletions to be synchronized between applications.
40
-
41
- ## Installation
42
-
43
- ```shell
44
- pip install scim2-client
45
- ```
46
-
47
- ## Usage
48
-
49
- Check the [tutorial](https://scim2-client.readthedocs.io/en/latest/tutorial.html) and the [reference](https://scim2-client.readthedocs.io/en/latest/reference.html) for more details.
50
-
51
- Here is an example of usage:
52
-
53
- ```python
54
- import datetime
55
- from httpx import Client
56
- from scim2_models import User, EnterpriseUser, Group, Error
57
- from scim2_client import SCIMClient
58
-
59
- client = Client(base_url=f"https://auth.example/scim/v2", headers={"Authorization": "Bearer foobar"})
60
- scim = SCIMClient(client, resource_types=(User[EnterpriseUser], Group))
61
-
62
- # Query resources
63
- user = scim.query(User[EnterpriseUser], "2819c223-7f76-453a-919d-413861904646")
64
- assert user.user_name == "bjensen@example.com"
65
- assert user.meta.last_updated == datetime.datetime(
66
- 2024, 4, 13, 12, 0, 0, tzinfo=datetime.timezone.utc
67
- )
68
-
69
- # Update resources
70
- user.display_name = "Babs Jensen"
71
- user = scim.replace(user)
72
- assert user.display_name == "Babs Jensen"
73
- assert user.meta.last_updated == datetime.datetime(
74
- 2024, 4, 13, 12, 0, 30, tzinfo=datetime.timezone.utc
75
- )
76
-
77
- # Create resources
78
- payload = User(user_name="bjensen@example.com")
79
- response = scim.create(user)
80
- assert isinstance(response, Error)
81
- assert response.detail == "One or more of the attribute values are already in use or are reserved."
82
- ```
83
-
84
- scim2-client belongs in a collection of SCIM tools developed by [Yaal Coop](https://yaal.coop),
85
- with [scim2-models](https://github.com/yaal-coop/scim2-models),
86
- [scim2-tester](https://github.com/yaal-coop/scim2-tester) and
87
- [scim2-cli](https://github.com/yaal-coop/scim2-cli)
88
-
@@ -1,6 +0,0 @@
1
- scim2_client/__init__.py,sha256=vgrTJZIqJLZc72XCJwYKrSCGUDkMZTJjCJiZkHERZGs,780
2
- scim2_client/client.py,sha256=hFcpUG2jYtNb5e178lsf4-SubXb0opO9JgegR6Q-JZQ,27278
3
- scim2_client/errors.py,sha256=Lu_4lPlbryqWYGLPmH2iWaVmlay8S4PrH6lUPIvcisA,4430
4
- scim2_client-0.2.0.dist-info/METADATA,sha256=b5Q_wytHLRpCPga0hwYTVKgMmX0o9mFXuStQYtzNf50,3497
5
- scim2_client-0.2.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
6
- scim2_client-0.2.0.dist-info/RECORD,,