SCIM2 models serialization and validation with pydantic
Project description
scim2-models
Pydantic models for SCIM schemas defined in RFC7643 and RFC7644.
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.
Features
- SCIM Resources: Native Python classes for
User,Group,EnterpriseUser,ServiceProviderConfig,ResourceTypeandSchema - Pydantic Integration: Full Pydantic v2 support with validation, serialization and IDE autocompletion
- RFC Compliance: Implements RFC7643 (schema) and RFC7644 (protocol) specifications
- Attribute Metadata: Support for
Mutability,Returned,UniquenessandRequiredfield annotations - Context-Aware Validation: Automatic field inclusion/exclusion based on HTTP context (creation, query, replacement, etc.)
- Schema Extensions: Dynamic schema extensions and custom resource types, dynamic conversion between schemas and Python models.
- SCIM Messages:
ListResponse,SearchRequest,PatchOp, andErrormessages - Error Handling: SCIM-compliant exceptions with automatic conversion to
Errorresponses
Installation
pip install scim2-models
Usage
Check the tutorial and the reference for more details.
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, with scim2-client, 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_models-0.6.3.tar.gz.
File metadata
- Download URL: scim2_models-0.6.3.tar.gz
- Upload date:
- Size: 45.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
527f6f54b35bb5ded120229b4160845b7a5e1ca6ae8bc4b97537543c79343057
|
|
| MD5 |
3831e8624237f585b4d49db864bfbf08
|
|
| BLAKE2b-256 |
6686ebcf14dd5f69f80c787849869f45364587fedcce0a382308167914b26876
|
Provenance
The following attestation bundles were made for scim2_models-0.6.3.tar.gz:
Publisher:
release.yml on python-scim/scim2-models
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scim2_models-0.6.3.tar.gz -
Subject digest:
527f6f54b35bb5ded120229b4160845b7a5e1ca6ae8bc4b97537543c79343057 - Sigstore transparency entry: 870932357
- Sigstore integration time:
-
Permalink:
python-scim/scim2-models@2da6d56ef694e7fccbae9cf3eb93c2573857d43b -
Branch / Tag:
refs/tags/0.6.3 - Owner: https://github.com/python-scim
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2da6d56ef694e7fccbae9cf3eb93c2573857d43b -
Trigger Event:
push
-
Statement type:
File details
Details for the file scim2_models-0.6.3-py3-none-any.whl.
File metadata
- Download URL: scim2_models-0.6.3-py3-none-any.whl
- Upload date:
- Size: 57.1 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 |
bc8656ad3d7caccc70ec9407ce3a2711ef9862161922267c24c36ea5de9f8566
|
|
| MD5 |
efc11f7e076979835dbe1a99d97e31c4
|
|
| BLAKE2b-256 |
a87bddb6179bf6daad3b927c09762aa11fbfa39a128d0ac63be923b9fb0a3b1e
|
Provenance
The following attestation bundles were made for scim2_models-0.6.3-py3-none-any.whl:
Publisher:
release.yml on python-scim/scim2-models
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scim2_models-0.6.3-py3-none-any.whl -
Subject digest:
bc8656ad3d7caccc70ec9407ce3a2711ef9862161922267c24c36ea5de9f8566 - Sigstore transparency entry: 870932364
- Sigstore integration time:
-
Permalink:
python-scim/scim2-models@2da6d56ef694e7fccbae9cf3eb93c2573857d43b -
Branch / Tag:
refs/tags/0.6.3 - Owner: https://github.com/python-scim
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2da6d56ef694e7fccbae9cf3eb93c2573857d43b -
Trigger Event:
push
-
Statement type: