You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ebe89e2
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: README.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@
3
3
A SCIM client Python library built upon [scim2-models](https://scim2-models.readthedocs.io) ,
4
4
that pythonically build requests and parse responses,
5
5
following the [RFC7643](https://datatracker.ietf.org/doc/html/rfc7643.html) and [RFC7644](https://datatracker.ietf.org/doc/html/rfc7644.html) specifications.
6
-
You can use whatever request engine you prefer to perform network requests, but scim2-client comes with [httpx](https://github.com/encode/httpx) support.
6
+
You can use whatever request engine you prefer to perform network requests, but scim2-client comes with [httpx2](https://github.com/pydantic/httpx2) support.
7
7
8
8
It aims to be used in SCIM client applications, or in unit tests for SCIM server applications.
9
9
@@ -21,14 +21,14 @@ It allows users and groups creations, modifications and deletions to be synchron
21
21
-**Server Discovery**: Automatic retrieval of `ServiceProviderConfig`, `ResourceTypes` and `Schemas`
22
22
-**Search & Filtering**: Support for SCIM filters, sorting, pagination and attribute selection
23
23
-**Sync & Async**: Both synchronous and asynchronous clients available
24
-
-**Multiple HTTP Engines**: Built-in support for [httpx](https://github.com/encode/httpx) (sync/async) and [werkzeug](https://werkzeug.palletsprojects.com/) (testing). Adaptable to any network engine.
24
+
-**Multiple HTTP Engines**: Built-in support for [httpx2](https://github.com/pydantic/httpx2) (sync/async) and [werkzeug](https://werkzeug.palletsprojects.com/) (testing). Adaptable to any network engine.
25
25
-**Request & Response Validation**: Automatic payload validation against SCIM schemas
26
26
-**Error Handling**: Structured exceptions for network, request and response errors
27
27
28
28
## Installation
29
29
30
30
```shell
31
-
pip install scim2-client[httpx]
31
+
pip install scim2-client[httpx2]
32
32
```
33
33
34
34
## Usage
@@ -40,9 +40,9 @@ Here is an example of usage:
40
40
41
41
```python
42
42
import datetime
43
-
fromhttpximport Client
43
+
fromhttpx2import Client
44
44
from scim2_client import SCIMResponseErrorObject
45
-
from scim2_client.engines.httpximport SyncSCIMClient
45
+
from scim2_client.engines.httpx2import SyncSCIMClient
Copy file name to clipboardExpand all lines: doc/tutorial.rst
+17-10Lines changed: 17 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,11 +4,18 @@ Tutorial
4
4
Initialization
5
5
==============
6
6
7
-
scim2-client depends on request engines such as `httpx<https://github.com/encode/httpx>`_ to perform network requests.
8
-
This tutorial demonstrate how to use scim2-client with httpx, and suppose you have installed the `httpx` extra for example with ``pip install scim2-client[httpx]``.
7
+
scim2-client depends on request engines such as `httpx2<https://github.com/pydantic/httpx2>`_ to perform network requests.
8
+
This tutorial demonstrate how to use scim2-client with httpx2, and suppose you have installed the `httpx2` extra for example with ``pip install scim2-client[httpx2]``.
9
9
10
-
As a start you will need to instantiate a httpx :code:`Client` (or :code:`AsyncClient`) object that you can parameter as your will, and then pass it to a :class:`~scim2_client.SCIMClient` object.
11
-
In addition to your SCIM server root endpoint, you will probably want to provide some authorization headers through the httpx :code:`Client` :code:`headers` parameter:
10
+
.. note::
11
+
12
+
The engines still work with `httpx <https://github.com/encode/httpx>`_, shipped in the deprecated `httpx` extra.
13
+
It is used when httpx2 is not installed, and both its extra and its support will be removed in 0.9.
14
+
Applications that cannot migrate all their dependencies at once can call :code:`httpx2.alias_httpx()`
15
+
at the very top of their entrypoint, so that :code:`import httpx` resolves to httpx2 process-wide.
16
+
17
+
As a start you will need to instantiate a httpx2 :code:`Client` (or :code:`AsyncClient`) object that you can parameter as your will, and then pass it to a :class:`~scim2_client.SCIMClient` object.
18
+
In addition to your SCIM server root endpoint, you will probably want to provide some authorization headers through the httpx2 :code:`Client` :code:`headers` parameter:
12
19
13
20
.. tab-set::
14
21
:class: outline
@@ -18,8 +25,8 @@ In addition to your SCIM server root endpoint, you will probably want to provide
18
25
19
26
.. code-block:: python
20
27
21
-
fromhttpximport Client
22
-
from scim2_client.engines.httpximport SyncSCIMClient
28
+
fromhttpx2import Client
29
+
from scim2_client.engines.httpx2import SyncSCIMClient
23
30
24
31
client = Client(
25
32
base_url="https://auth.example/scim/v2",
@@ -32,8 +39,8 @@ In addition to your SCIM server root endpoint, you will probably want to provide
32
39
33
40
.. code-block:: python
34
41
35
-
fromhttpximport AsyncClient
36
-
from scim2_client.engines.httpximport AsyncSCIMClient
42
+
fromhttpx2import AsyncClient
43
+
from scim2_client.engines.httpx2import AsyncSCIMClient
37
44
38
45
client = AsyncClient(
39
46
base_url="https://auth.example/scim/v2",
@@ -392,8 +399,8 @@ Engines
392
399
scim2-client comes with a light abstraction layers that allows for different requests engines.
393
400
Currently those engines are shipped:
394
401
395
-
- :class:`~scim2_client.engines.httpx.SyncSCIMClient`: A synchronous engine using `httpx<https://github.com/encode/httpx>`_ to perform the HTTP requests.
396
-
- :class:`~scim2_client.engines.httpx.AsyncSCIMClient`: An asynchronous engine using `httpx<https://github.com/encode/httpx>`_ to perform the HTTP requests. It has the very same API than its synchronous version, except it is asynchronous.
402
+
- :class:`~scim2_client.engines.httpx2.SyncSCIMClient`: A synchronous engine using `httpx2<https://github.com/pydantic/httpx2>`_ to perform the HTTP requests.
403
+
- :class:`~scim2_client.engines.httpx2.AsyncSCIMClient`: An asynchronous engine using `httpx2<https://github.com/pydantic/httpx2>`_ to perform the HTTP requests. It has the very same API than its synchronous version, except it is asynchronous.
397
404
- :class:`~scim2_client.engines.werkzeug.TestSCIMClient`: A test engine for development purposes.
398
405
It takes a WSGI app and directly execute the server code instead of performing real HTTP requests.
399
406
This is faster in unit test suites, and helpful to catch the server exceptions.
0 commit comments