Store SCIM resources in the tables of an application, with the SQLAlchemy ORM.
A mapping declares which column holds each SCIM attribute. A storage then reads, writes, filters, sorts and pages the resources for scim2-server, which serves the SCIM protocol of RFC 7643 and RFC 7644.
from scim2_models import User
from scim2_sqlalchemy import Many, ResourceMapping, SqlAlchemyStorage
users = ResourceMapping(
User,
Account,
{
"id": Account.id,
"userName": Account.login,
"name.givenName": Account.first_name,
"emails": Many(Account.emails, {"value": EmailAddress.address}),
"meta.created": Account.created_at,
"meta.lastModified": Account.updated_at,
},
version=Account.revision,
)
storage = SqlAlchemyStorage({"User": users}, lambda: session)$ pip install scim2-sqlalchemyThe asynchronous storage needs the asyncio extra:
$ pip install "scim2-sqlalchemy[asyncio]"The documentation builds a SCIM server over existing tables, and describes the mappings, the transactions and the public API.
- Source code: github.com/python-scim/scim2-sqlalchemy
- Bugtracker: github.com/python-scim/scim2-sqlalchemy/issues
Read the contributing guide.
scim2-sqlalchemy is published under the terms of the Apache 2.0 license.