Package: custos-sdk
Apache Custos Python SDKThe Apache Custos Python SDK for  third party clients to  integrate with Custos middlewareFolder StructurecustosIncludes gRPC stubs generated by a protoc compiler. Mainly contains data model and functions. You may
need to import data model packages to integrate with clients.clientsIncludes integration clients, which you want to import and integrate with your code to access Custos middleware.samplesIncludes set of sample implementation of  integration clients to demo the integration with  Custos middlewaretransportIncludes connection handling classesBefore  IntegrationCreate a virtual environmentpython3 -m venv venvActivate the virtual environmentsource venv/bin/activateInstall dependenciespip install -r requirements.txtCreate a INI file containing server configuration details. For more information refer to default settings filesettings.iniGenerating Distribution Archives (Optional)You can generate *.tar.gz or .whl distribution and install to any external project.Create a virtual environmentpython3 -m venv venvActivate the virtual environmentsource venv/bin/activateMake sure you have the latest versions of setuptools and wheel installedpip install  wheelNow run this command from the same directory where setup.py is locatedpython3 setup.py sdist bdist_wheelThis command should output a lot of text and once completed should generate two files in the dist directorydist/
    custos_python_sdk-1.0.0-py3-none-any.whl
    custos-python-sdk-1.0.0.tar.gzYou should be able to install those packages into your project.Integrate With Your ClientsThere are three types of tokens used for access custos APIs.Client Token (Base64 encoded Custos_Client_Id +":"+ Custos_Client_Sec)Admin Token (Access Token of Admin User)User Token (Access Token of Generic User)tenant_management_clientcreate_admin_tenant (client_name, requester_email, admin_frist_name,
admin_last_name, admin_email, admin_username, admin_password,
contacts, redirect_uris, client_uri, scope, domain, logo_uri, comment)create_tenant (client_token, client_name, requester_email, admin_frist_name,
admin_last_name, admin_email, admin_username, admin_password,
contacts, redirect_uris, client_uri, scope, domain, logo_uri, comment)get_credentials (client_token)get_tenant (client_token, client_id)update_tenant (client_token, client_id, client_name, requester_email, admin_frist_name,
admin_last_name, admin_email, admin_username, admin_password,
contacts, redirect_uris, client_uri, scope, domain, logo_uri, comment)delete_tenant (client_token, client_id)add_tenant_roles (client_token, roles, is_client_level)add_protocol_mapper (client_token, roles, is_client_level)get_child_tenants (client_token, offset, limit, status)get_all_tenants (client_token, email)Sample implementations can be found attenant_management_samplesidentity_management_clientauthenticate(client_token, username, password)is_authenticated(client_token, user_access_token, username)get_service_account_access_token(client_token)authorize(client_id, redirect_uri, response_type, scope, state)token(client_token, redirect_uri, code)get_credentials(client_token, client_id)get_oidc_configuration(client_token, client_id)Sample implementations can be found atidentity_management_sampleuser_management_clientregister_user(client_token, username, first_name, last_name, password, email, is_temp_password)register_and_enable_users(admin_token, users)add_user_attributes(user_token, attributes, users)delete_user_attributes(user_token, attributes, users)enable_user(client_token, username)add_roles_to_users(admin_token, usernames, roles, is_client_level)is_user_enabled(client_token, username)is_username_available(client_token, username)get_user(client_token, username)find_users(client_token, offset, limit, username=None, firstname=None, lastname=None, email=None)reset_password(client_token, username, password)delete_user(admin_token, username)delete_user_roles(admin_token, username, client_roles, realm_roles)update_user_profile(user_token, username, email, first_name, last_name)Sample implementations can be found atuser_management_samplessuper_tenant_management_clientget_all_tenants(super_admin_token, offset, limit, status)update_tenant_status(super_admin_token, client_id, status)