BeryJu / pyscim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pyscim

Janssen SCIM 2.0 server API. Developers can think of SCIM as a REST API with endpoints exposing CRUD functionality (create, update, retrieve and delete) for identity management resources such as users, groups, and fido devices.

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: 5.0.0
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen

Requirements.

Python >=3.6

Installation & Usage

pip install

If the python package is hosted on a repository, you can install directly using:

pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git)

Then import the package:

import pyscim

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import pyscim

Getting Started

Please follow the installation procedure and then run the following:

import time
import pyscim
from pprint import pprint
from pyscim.api import default_api
from pyscim.model.bulk_data import BulkData
from pyscim.model.bulk_request import BulkRequest
from pyscim.model.error_response import ErrorResponse
# Defining the host is optional and defaults to https://jenkins-ldap.jans.io/jans-scim/restv1/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = pyscim.Configuration(
    host = "https://jenkins-ldap.jans.io/jans-scim/restv1/v2"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure OAuth2 access token for authorization: scim_oauth
configuration = pyscim.Configuration(
    host = "https://jenkins-ldap.jans.io/jans-scim/restv1/v2"
)
configuration.access_token = 'YOUR_ACCESS_TOKEN'


# Enter a context with an instance of the API client
with pyscim.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = default_api.DefaultApi(api_client)
    request = BulkRequest(None) # BulkRequest | Payload describing the operations to perform

    try:
        api_response = api_instance.bulk_post(request)
        pprint(api_response)
    except pyscim.ApiException as e:
        print("Exception when calling DefaultApi->bulk_post: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://jenkins-ldap.jans.io/jans-scim/restv1/v2

Class Method HTTP request Description
DefaultApi bulk_post POST /Bulk
DiscoveryApi get_resource_type_by_id GET /ResourceTypes/{resource}
DiscoveryApi get_resource_types GET /ResourceTypes
DiscoveryApi get_schema_by_uri GET /Schemas/{uri}
DiscoveryApi get_schemas GET /Schemas
DiscoveryApi get_service_provider_config GET /ServiceProviderConfig
Fido2DevicesApi delete_fido2_device_by_id DELETE /Fido2Devices/{id}
Fido2DevicesApi get_fido2_device_by_id GET /Fido2Devices/{id}
Fido2DevicesApi get_fido2_devices GET /Fido2Devices
Fido2DevicesApi search_fido2_device POST /Fido2Devices/.search
Fido2DevicesApi update_fido2_device_by_id PUT /Fido2Devices/{id}
FidoDevicesApi delete_fido_device_by_id DELETE /FidoDevices/{id}
FidoDevicesApi get_fido_device_by_id GET /FidoDevices/{id}
FidoDevicesApi get_fido_devices GET /FidoDevices
FidoDevicesApi search_fido_device POST /FidoDevices/.search
FidoDevicesApi update_fido_device_by_id PUT /FidoDevices/{id}
GlobalSearchApi search_resources POST /.search
GroupApi create_group POST /Groups
GroupApi delete_group_by_id DELETE /Groups/{id}
GroupApi get_group_by_id GET /Groups/{id}
GroupApi get_groups GET /Groups
GroupApi patch_group_by_id PATCH /Groups/{id}
GroupApi search_group POST /Groups/.search
GroupApi update_group_by_id PUT /Groups/{id}
UserApi create_user POST /Users
UserApi delete_user_by_id DELETE /Users/{id}
UserApi get_user_by_id GET /Users/{id}
UserApi get_users GET /Users
UserApi patch_user_by_id PATCH /Users/{id}
UserApi search_user POST /Users/.search
UserApi update_user_by_id PUT /Users/{id}

Documentation For Models

Documentation For Authorization

scim_oauth

Author

Notes for Large OpenAPI documents

If the OpenAPI document is large, imports in pyscim.apis and pyscim.models may fail with a RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions:

Solution 1: Use specific imports for apis and models like:

  • from pyscim.api.default_api import DefaultApi
  • from pyscim.model.pet import Pet

Solution 2: Before importing the package, adjust the maximum recursion limit as shown below:

import sys
sys.setrecursionlimit(1500)
import pyscim
from pyscim.apis import *
from pyscim.models import *

About


Languages

Language:Python 99.8%Language:Shell 0.2%Language:Makefile 0.0%