scim2-client 0.2.1__py3-none-any.whl → 0.3.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_client/errors.py CHANGED
@@ -35,7 +35,7 @@ class RequestNetworkError(SCIMRequestError):
35
35
 
36
36
 
37
37
  class RequestPayloadValidationError(SCIMRequestError):
38
- """Error raised when an invalid request payload has been passed to SCIMClient.
38
+ """Error raised when an invalid request payload has been passed to BaseSCIMClient.
39
39
 
40
40
  This error is raised when a :class:`pydantic.ValidationError` has been caught
41
41
  while validating the client request payload.
@@ -72,7 +72,9 @@ class SCIMResponseErrorObject(SCIMResponseError):
72
72
  def __init__(self, *args, **kwargs):
73
73
  message = kwargs.pop(
74
74
  "message",
75
- f"The server returned a SCIM Error object: {kwargs['source'].detail}",
75
+ f"The server returned a SCIM Error object: {kwargs['source'].detail}"
76
+ if kwargs.get("source")
77
+ else "The server returned a SCIM Error object",
76
78
  )
77
79
  super().__init__(message, *args, **kwargs)
78
80
 
@@ -83,7 +85,9 @@ class UnexpectedStatusCode(SCIMResponseError):
83
85
  def __init__(self, *args, **kwargs):
84
86
  message = kwargs.pop(
85
87
  "message",
86
- f"Unexpected response status code: {kwargs['source'].status_code}",
88
+ f"Unexpected response status code: {kwargs['source'].status_code}"
89
+ if kwargs.get("source")
90
+ else "Unexpected response status code",
87
91
  )
88
92
  super().__init__(message, *args, **kwargs)
89
93
 
@@ -91,8 +95,7 @@ class UnexpectedStatusCode(SCIMResponseError):
91
95
  class UnexpectedContentType(SCIMResponseError):
92
96
  """Error raised when a server returned an unexpected `Content-Type` header in a response."""
93
97
 
94
- def __init__(self, *args, **kwargs):
95
- content_type = kwargs["source"].headers.get("content-type", "")
98
+ def __init__(self, content_type, *args, **kwargs):
96
99
  message = kwargs.pop("message", f"Unexpected content type: {content_type}")
97
100
  super().__init__(message, *args, **kwargs)
98
101
 
scim2_client/py.typed ADDED
File without changes
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: scim2-client
3
- Version: 0.2.1
3
+ Version: 0.3.0
4
4
  Summary: Pythonically build SCIM requests and parse SCIM responses
5
5
  Project-URL: documentation, https://scim2-client.readthedocs.io
6
6
  Project-URL: repository, https://github.com/python-scim/scim2-client
@@ -208,7 +208,6 @@ License: Apache License
208
208
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
209
209
  See the License for the specific language governing permissions and
210
210
  limitations under the License.
211
- License-File: LICENSE.md
212
211
  Keywords: api,httpx,provisioning,rfc7643,rfc7644,scim,scim2
213
212
  Classifier: Development Status :: 3 - Alpha
214
213
  Classifier: Environment :: Web Environment
@@ -223,15 +222,19 @@ Classifier: Programming Language :: Python :: 3.12
223
222
  Classifier: Programming Language :: Python :: 3.13
224
223
  Classifier: Programming Language :: Python :: Implementation :: CPython
225
224
  Requires-Python: >=3.9
226
- Requires-Dist: httpx>=0.24.0
227
225
  Requires-Dist: scim2-models>=0.2.0
226
+ Provides-Extra: httpx
227
+ Requires-Dist: httpx>=0.28.0; extra == 'httpx'
228
+ Provides-Extra: werkzeug
229
+ Requires-Dist: werkzeug>=3.1.3; extra == 'werkzeug'
228
230
  Description-Content-Type: text/markdown
229
231
 
230
232
  # scim2-client
231
233
 
232
- A SCIM client Python library built upon [scim2-models](https://scim2-models.readthedocs.io) and [httpx](https://github.com/encode/httpx),
234
+ A SCIM client Python library built upon [scim2-models](https://scim2-models.readthedocs.io) ,
233
235
  that pythonically build requests and parse responses,
234
236
  following the [RFC7643](https://datatracker.ietf.org/doc/html/rfc7643.html) and [RFC7644](https://datatracker.ietf.org/doc/html/rfc7644.html) specifications.
237
+ You can use whatever request engine you prefer to perform network requests, but scim2-models comes with [httpx](https://github.com/encode/httpx) support.
235
238
 
236
239
  It aims to be used in SCIM client applications, or in unit tests for SCIM server applications.
237
240
 
@@ -245,7 +248,7 @@ It allows users and groups creations, modifications and deletions to be synchron
245
248
  ## Installation
246
249
 
247
250
  ```shell
248
- pip install scim2-client
251
+ pip install scim2-client[httpx]
249
252
  ```
250
253
 
251
254
  ## Usage
@@ -258,10 +261,10 @@ Here is an example of usage:
258
261
  import datetime
259
262
  from httpx import Client
260
263
  from scim2_models import User, EnterpriseUser, Group, Error
261
- from scim2_client import SCIMClient
264
+ from scim2_client.engines.httpx import SyncSCIMClient
262
265
 
263
- client = Client(base_url=f"https://auth.example/scim/v2", headers={"Authorization": "Bearer foobar"})
264
- scim = SCIMClient(client, resource_types=(User[EnterpriseUser], Group))
266
+ client = Client(base_url="https://auth.example/scim/v2", headers={"Authorization": "Bearer foobar"})
267
+ scim = SyncSCIMClient(client, resource_types=(User[EnterpriseUser], Group))
265
268
 
266
269
  # Query resources
267
270
  user = scim.query(User[EnterpriseUser], "2819c223-7f76-453a-919d-413861904646")
@@ -0,0 +1,11 @@
1
+ scim2_client/__init__.py,sha256=KpNDJW9e2WseqSsQ6FltkQzemHM52NACfpJTd3eSIuY,853
2
+ scim2_client/client.py,sha256=CPXPqnmYNcXgn5ViPFpapI-oEg0oX8kXnwdWWmjm4eI,40130
3
+ scim2_client/errors.py,sha256=VDomHej2WH07up6a2wr7q0BVdj6RG4MyrM2t9UHx0Iw,4623
4
+ scim2_client/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ scim2_client/engines/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ scim2_client/engines/httpx.py,sha256=uqONJhFUdFf8W-GndL-mB_Z33FRuwgXAb2PczTB7wLg,16268
7
+ scim2_client/engines/werkzeug.py,sha256=9KcViIJVzSda6cpeiM-_dFjp5HFDBFkfiGRaUx4utrk,9107
8
+ scim2_client-0.3.0.dist-info/METADATA,sha256=1aFhLfcE_1TXEI7iMjJUc8G99dmaViqJoN01BM8-_Rk,16997
9
+ scim2_client-0.3.0.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
10
+ scim2_client-0.3.0.dist-info/licenses/LICENSE.md,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
11
+ scim2_client-0.3.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.25.0
2
+ Generator: hatchling 1.26.3
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,7 +0,0 @@
1
- scim2_client/__init__.py,sha256=vgrTJZIqJLZc72XCJwYKrSCGUDkMZTJjCJiZkHERZGs,780
2
- scim2_client/client.py,sha256=I3_CjI9njNbzOux6abwWkMYfT1q40SvnkQuYlifMdJQ,27107
3
- scim2_client/errors.py,sha256=XH5e8zx3a1228GJjxugEgwO-shYAZWQx6LK_yZyX53E,4495
4
- scim2_client-0.2.1.dist-info/METADATA,sha256=pGhr3ZzcA_O85rQsMfJ97vBdK9_FZehK5m2qZfceMhA,16767
5
- scim2_client-0.2.1.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
6
- scim2_client-0.2.1.dist-info/licenses/LICENSE.md,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
7
- scim2_client-0.2.1.dist-info/RECORD,,