https://github.com/python-scim/scim2-models
SCIM resources serialization and validation with Pydantic
https://github.com/python-scim/scim2-models
provisioning pydantic pydantic-models rfc7643 rfc7644 scim scim2
Last synced: 3 days ago
JSON representation
SCIM resources serialization and validation with Pydantic
- Host: GitHub
- URL: https://github.com/python-scim/scim2-models
- Owner: python-scim
- License: apache-2.0
- Created: 2024-05-23T18:16:43.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-11-07T13:05:46.000Z (about 1 month ago)
- Last Synced: 2025-11-07T15:09:59.377Z (about 1 month ago)
- Topics: provisioning, pydantic, pydantic-models, rfc7643, rfc7644, scim, scim2
- Language: Python
- Homepage: https://scim2-models.readthedocs.io
- Size: 1.48 MB
- Stars: 19
- Watchers: 6
- Forks: 7
- Open Issues: 23
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# scim2-models
[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).
This library provides utilities to parse and produce SCIM2 payloads, and handle them with native Python objects.
It aims to be used as a basis to build SCIM2 servers and clients.
## 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.
## Installation
```shell
pip install scim2-models
```
## Usage
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.
```python
from scim2_models import User
import datetime
payload = {
"schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
"id": "2819c223-7f76-453a-919d-413861904646",
"userName": "bjensen@example.com",
"meta": {
"resourceType": "User",
"created": "2010-01-23T04:56:22Z",
"lastModified": "2011-05-13T04:42:34Z",
"version": 'W\\/"3694e05e9dff590"',
"location": "https://example.com/v2/Users/2819c223-7f76-453a-919d-413861904646",
},
}
user = User.model_validate(payload)
assert user.user_name == "bjensen@example.com"
assert user.meta.created == datetime.datetime(
2010, 1, 23, 4, 56, 22, tzinfo=datetime.timezone.utc
)
```
scim2-models belongs in a collection of SCIM tools developed by [Yaal Coop](https://yaal.coop),
with [scim2-client](https://github.com/python-scim/scim2-client),
[scim2-tester](https://github.com/python-scim/scim2-tester) and
[scim2-cli](https://github.com/python-scim/scim2-cli)