scim2-client


Namescim2-client JSON
Version 0.1.6 PyPI version JSON
download
home_pageNone
SummaryPythonically build SCIM requests and parse SCIM responses
upload_time2024-06-05 14:40:15
maintainerNone
docs_urlNone
authorYaal Coop
requires_python<4.0,>=3.9
licenseMIT
keywords scim scim2 provisioning httpx api
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # scim2-client

A SCIM client Python library built upon [scim2-models](https://scim2-models.readthedocs.io) and [httpx](https://github.com/encode/httpx),
that pythonically build requests and parse responses,
following the [RFC7643](https://datatracker.ietf.org/doc/html/rfc7643.html) and [RFC7644](https://datatracker.ietf.org/doc/html/rfc7644.html) specifications.

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.

## Installation

```shell
pip install scim2-client
```

## Usage

Check the [tutorial](https://scim2-client.readthedocs.io/en/latest/tutorial.html) and the [reference](https://scim2-client.readthedocs.io/en/latest/reference.html) for more details.

Here is an example of usage:

```python
import datetime
from httpx import Client
from scim2_models import User, EnterpriseUserUser, Group, Error
from scim2_client import SCIMClient

client = Client(base_url=f"https://auth.example/scim/v2", headers={"Authorization": "Bearer foobar"})
scim = SCIMClient(client, resource_types=(User[EnterpriseUser], Group))

# 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 = "Babes Jensen"
user = scim.replace(user)
assert user.display_name == "Babes 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](https://yaal.coop),
with [scim2-models](https://github.com/yaal-coop/scim2-models),
[scim2-tester](https://github.com/yaal-coop/scim2-tester) and
[scim2-cli](https://github.com/yaal-coop/scim2-cli)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "scim2-client",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": "scim, scim2, provisioning, httpx, api",
    "author": "Yaal Coop",
    "author_email": "contact@yaal.coop",
    "download_url": "https://files.pythonhosted.org/packages/54/76/563827aa8d708de3585beb2f8011c663f941ec4526252b225116ff273c96/scim2_client-0.1.6.tar.gz",
    "platform": null,
    "description": "# scim2-client\n\nA SCIM client Python library built upon [scim2-models](https://scim2-models.readthedocs.io) and [httpx](https://github.com/encode/httpx),\nthat pythonically build requests and parse responses,\nfollowing the [RFC7643](https://datatracker.ietf.org/doc/html/rfc7643.html) and [RFC7644](https://datatracker.ietf.org/doc/html/rfc7644.html) specifications.\n\nIt aims to be used in SCIM client applications, or in unit tests for SCIM server applications.\n\n## What's SCIM anyway?\n\nSCIM stands for System for Cross-domain Identity Management, and it is a provisioning protocol.\nProvisioning is the action of managing a set of resources across different services, usually users and groups.\nSCIM is often used between Identity Providers and applications in completion of standards like OAuth2 and OpenID Connect.\nIt allows users and groups creations, modifications and deletions to be synchronized between applications.\n\n## Installation\n\n```shell\npip install scim2-client\n```\n\n## Usage\n\nCheck the [tutorial](https://scim2-client.readthedocs.io/en/latest/tutorial.html) and the [reference](https://scim2-client.readthedocs.io/en/latest/reference.html) for more details.\n\nHere is an example of usage:\n\n```python\nimport datetime\nfrom httpx import Client\nfrom scim2_models import User, EnterpriseUserUser, Group, Error\nfrom scim2_client import SCIMClient\n\nclient = Client(base_url=f\"https://auth.example/scim/v2\", headers={\"Authorization\": \"Bearer foobar\"})\nscim = SCIMClient(client, resource_types=(User[EnterpriseUser], Group))\n\n# Query resources\nuser = scim.query(User, \"2819c223-7f76-453a-919d-413861904646\")\nassert user.user_name == \"bjensen@example.com\"\nassert user.meta.last_updated == datetime.datetime(\n    2024, 4, 13, 12, 0, 0, tzinfo=datetime.timezone.utc\n)\n\n# Update resources\nuser.display_name = \"Babes Jensen\"\nuser = scim.replace(user)\nassert user.display_name == \"Babes Jensen\"\nassert user.meta.last_updated == datetime.datetime(\n    2024, 4, 13, 12, 0, 30, tzinfo=datetime.timezone.utc\n)\n\n# Create resources\npayload = User(user_name=\"bjensen@example.com\")\nresponse = scim.create(user)\nassert isinstance(response, Error)\nassert response.detail == \"One or more of the attribute values are already in use or are reserved.\"\n```\n\nscim2-client belongs in a collection of SCIM tools developed by [Yaal Coop](https://yaal.coop),\nwith [scim2-models](https://github.com/yaal-coop/scim2-models),\n[scim2-tester](https://github.com/yaal-coop/scim2-tester) and\n[scim2-cli](https://github.com/yaal-coop/scim2-cli)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Pythonically build SCIM requests and parse SCIM responses",
    "version": "0.1.6",
    "project_urls": null,
    "split_keywords": [
        "scim",
        " scim2",
        " provisioning",
        " httpx",
        " api"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1c1f6431290e3c7d1b82184173699712b16e2f0aaff1677c3369772e26c7e18d",
                "md5": "3f313caedb2428dce6d52bec109dac1e",
                "sha256": "53959e2a9283e7d78acd6d80b437db9233520ec9cbb21022cfbe25772cf92552"
            },
            "downloads": -1,
            "filename": "scim2_client-0.1.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3f313caedb2428dce6d52bec109dac1e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 8169,
            "upload_time": "2024-06-05T14:40:13",
            "upload_time_iso_8601": "2024-06-05T14:40:13.605560Z",
            "url": "https://files.pythonhosted.org/packages/1c/1f/6431290e3c7d1b82184173699712b16e2f0aaff1677c3369772e26c7e18d/scim2_client-0.1.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5476563827aa8d708de3585beb2f8011c663f941ec4526252b225116ff273c96",
                "md5": "41bc00a9c93a1b2407e3364afb6332b1",
                "sha256": "c7d22f2ae6fac935deba62acd29979250344e3becfe8440ed8e849b37f7a4e0f"
            },
            "downloads": -1,
            "filename": "scim2_client-0.1.6.tar.gz",
            "has_sig": false,
            "md5_digest": "41bc00a9c93a1b2407e3364afb6332b1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 8657,
            "upload_time": "2024-06-05T14:40:15",
            "upload_time_iso_8601": "2024-06-05T14:40:15.605661Z",
            "url": "https://files.pythonhosted.org/packages/54/76/563827aa8d708de3585beb2f8011c663f941ec4526252b225116ff273c96/scim2_client-0.1.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-05 14:40:15",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "scim2-client"
}
        
Elapsed time: 0.32739s