Pythonically build SCIM requests and parse SCIM responses
Project description
scim2-client
A SCIM client Python library built upon scim2-models , that pythonically build requests and parse responses, following the RFC7643 and RFC7644 specifications. You can use whatever request engine you prefer to perform network requests, but scim2-client comes with httpx support.
It aims to be used in SCIM client applications, or in unit tests for SCIM server applications.
What's SCIM anyway?
SCIM stands for System for Cross-domain Identity Management, and it is a provisioning protocol. Provisioning is the action of managing a set of resources across different services, usually users and groups. SCIM is often used between Identity Providers and applications in completion of standards like OAuth2 and OpenID Connect. It allows users and groups creations, modifications and deletions to be synchronized between applications.
Features
- CRUD Operations:
create,query,replace,deletemethods for SCIM resources - PATCH Support: Partial resource modifications with
add,removeandreplaceoperations - Server Discovery: Automatic retrieval of
ServiceProviderConfig,ResourceTypesandSchemas - Search & Filtering: Support for SCIM filters, sorting, pagination and attribute selection
- Sync & Async: Both synchronous and asynchronous clients available
- Multiple HTTP Engines: Built-in support for httpx (sync/async) and werkzeug (testing). Adaptable to any network engine.
- Request & Response Validation: Automatic payload validation against SCIM schemas
- Error Handling: Structured exceptions for network, request and response errors
Installation
pip install scim2-client[httpx]
Usage
Check the tutorial and the reference for more details.
Here is an example of usage:
import datetime
from httpx import Client
from scim2_models import Error
from scim2_client.engines.httpx import SyncSCIMClient
client = Client(base_url="https://auth.example/scim/v2", headers={"Authorization": "Bearer foobar"})
scim = SyncSCIMClient(client)
scim.discover()
User = scim.get_resource_model("User")
# Query resources
user = scim.query(User, "2819c223-7f76-453a-919d-413861904646")
assert user.user_name == "bjensen@example.com"
assert user.meta.last_updated == datetime.datetime(
2024, 4, 13, 12, 0, 0, tzinfo=datetime.timezone.utc
)
# Update resources
user.display_name = "Babs Jensen"
user = scim.replace(user)
assert user.display_name == "Babs Jensen"
assert user.meta.last_updated == datetime.datetime(
2024, 4, 13, 12, 0, 30, tzinfo=datetime.timezone.utc
)
# Create resources
payload = User(user_name="bjensen@example.com")
response = scim.create(user)
assert isinstance(response, Error)
assert response.detail == "One or more of the attribute values are already in use or are reserved."
scim2-client belongs in a collection of SCIM tools developed by Yaal Coop, with scim2-models, scim2-tester and scim2-cli
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file scim2_client-0.7.3.tar.gz.
File metadata
- Download URL: scim2_client-0.7.3.tar.gz
- Upload date:
- Size: 18.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c74b8f84124ed7bccb7251cc4f8848882bf14d90f1f6a4213b749d6a01fec10
|
|
| MD5 |
6406b234a5441c938b76f0bce929a4f7
|
|
| BLAKE2b-256 |
d018d096d3fe21041f8f695edaca35cfb0f1ae839c15b9b02e9b2fa8164f72a2
|
Provenance
The following attestation bundles were made for scim2_client-0.7.3.tar.gz:
Publisher:
release.yml on python-scim/scim2-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scim2_client-0.7.3.tar.gz -
Subject digest:
3c74b8f84124ed7bccb7251cc4f8848882bf14d90f1f6a4213b749d6a01fec10 - Sigstore transparency entry: 910809986
- Sigstore integration time:
-
Permalink:
python-scim/scim2-client@9f21ed4998e6a5c1afe6b6226839cd0b1945b1d9 -
Branch / Tag:
refs/tags/0.7.3 - Owner: https://github.com/python-scim
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9f21ed4998e6a5c1afe6b6226839cd0b1945b1d9 -
Trigger Event:
push
-
Statement type:
File details
Details for the file scim2_client-0.7.3-py3-none-any.whl.
File metadata
- Download URL: scim2_client-0.7.3-py3-none-any.whl
- Upload date:
- Size: 19.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52f59bbe046b364a329da427904d884faaf5f73a6190a69017f9822c3aadb834
|
|
| MD5 |
4b5977ccd7c3c1551585119d2c1dd725
|
|
| BLAKE2b-256 |
98daad45ba3225c2a9bead54ac43291bb98e6c4cbec768e354ec33e227cba809
|
Provenance
The following attestation bundles were made for scim2_client-0.7.3-py3-none-any.whl:
Publisher:
release.yml on python-scim/scim2-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scim2_client-0.7.3-py3-none-any.whl -
Subject digest:
52f59bbe046b364a329da427904d884faaf5f73a6190a69017f9822c3aadb834 - Sigstore transparency entry: 910809988
- Sigstore integration time:
-
Permalink:
python-scim/scim2-client@9f21ed4998e6a5c1afe6b6226839cd0b1945b1d9 -
Branch / Tag:
refs/tags/0.7.3 - Owner: https://github.com/python-scim
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9f21ed4998e6a5c1afe6b6226839cd0b1945b1d9 -
Trigger Event:
push
-
Statement type: