Skip to main content

Pythonically build SCIM requests and parse SCIM responses

Project description

scim2-client

A SCIM client Python library built upon scim2-models and httpx, that pythonically build requests and parse responses, following the RFC7643 and RFC7644 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

pip install scim2-client

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 User, EnterpriseUser, 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[EnterpriseUser], "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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scim2_client-0.2.1.tar.gz (69.8 kB view details)

Uploaded Source

Built Distribution

scim2_client-0.2.1-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

Details for the file scim2_client-0.2.1.tar.gz.

File metadata

  • Download URL: scim2_client-0.2.1.tar.gz
  • Upload date:
  • Size: 69.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for scim2_client-0.2.1.tar.gz
Algorithm Hash digest
SHA256 c250ecf43096251c5a4c20d35e20e2632107b015a27bf91567f7b1e9eb1d5998
MD5 260eb69bb682ada13979b2c8ccfeec4b
BLAKE2b-256 a534d7339b1ae25fc7da9eeacaee2323748aad2dfa90e04b3f860b493d292e10

See more details on using hashes here.

Provenance

The following attestation bundles were made for scim2_client-0.2.1.tar.gz:

Publisher: release.yml on python-scim/scim2-client

Attestations:

File details

Details for the file scim2_client-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: scim2_client-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 16.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for scim2_client-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 83e3db10c2362a2fa831af607aed90fad21dcf2c212b37cd399292d179dd122d
MD5 9247bbf48d612a0d7122eab4155aa621
BLAKE2b-256 0851b9b642c5aabed591aa8fe1f9928c1960df99265c0d5fed39e579d4a44a98

See more details on using hashes here.

Provenance

The following attestation bundles were made for scim2_client-0.2.1-py3-none-any.whl:

Publisher: release.yml on python-scim/scim2-client

Attestations:

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page