Skip to main content

Ondewo SIP Client Python Library

This library facilitates the interaction between a user and a CAI server. It achieves this by providing a higher-level interface mediator.

This higher-level interface mediator is structured around a series of python files generated from protobuf files. These protobuf files specify the details of the interface, and can be used to generate code in 10+ high-level languages. They are found in the ONDEWO SIP API along with the older Google protobufs from Dialogueflow that were used at the start. The ONDEWO PROTO-COMPILER will generate the needed files directly in this library.

Python Installation

You can install the library by installing it directly from the PyPi:

pip install ondewo-sip-client

Or, you could clone it and install the requirements:

git clone git@github.com:ondewo/ondewo-sip-client-python.git
cd ondewo-sip-client-python
make setup_developer_environment_locally

Repository Structure

.
├── examples
│   ├── __init__.py
│   └── register_account_example.py
├── ondewo
│   ├── sip
│   │   ├── client
│   │   │   ├── services
│   │   │   │   ├── __init__.py
│   │   │   │   ├── async_sip.py
│   │   │   │   └── sip.py
│   │   │   ├── __init__.py
│   │   │   ├── async_client.py
│   │   │   ├── async_services_container.py
│   │   │   ├── async_services_interface.py
│   │   │   ├── client.py
│   │   │   ├── client_config.py
│   │   │   ├── services_container.py
│   │   │   └── services_interface.py
│   │   ├── utils
│   │   │   ├── __init__.py
│   │   │   └── keycloak.py           <----- D18 Keycloak headless offline-token provider
│   │   ├── __init__.py
│   │   ├── sip_pb2_grpc.py
│   │   ├── sip_pb2.py
│   │   └── sip_pb2.pyi
│   └── __init__.py
├── ondewo-proto-compiler
├── ondewo-sip-api
├── CONTRIBUTING.md
├── Dockerfile.utils
├── LICENSE
├── Makefile
├── MANIFEST.in
├── mypy.ini
├── README.md
├── RELEASE.md
├── requirements-dev.txt
├── requirements.txt
├── setup.cfg
├── setup.py
└── sip_config.json

Build

The make build command is dependent on 2 repositories and their speciefied version:

It will generate a _pb2.py, _pb2.pyi and _pb2_grpc.py file for every .proto in the api submodule.

:warning: All Files in the ondewo folder that dont have pb2 in their name are handwritten, and therefor need to be manually adjusted to any changes in the proto-code.

Examples

The /examples folder provides a possible implementation of this library. To run an example, simple execute it like any other python file. To specify the server and credentials, you need to provide an environment file with the following variables:

  • host // The hostname of the Server - e.g. 127.0.0.1
  • port // Port of the Server - e.g. 6600
  • user_name // Username - same as you would use in AIM
  • password // Password of the user
  • grpc_cert // gRPC Certificate of the server

Authentication

The client authenticates via the Keycloak headless offline-token flow (D18). Set the Keycloak fields on the ClientConfig alongside user_name/password:

  • keycloak_url // Base URL of the Keycloak server - e.g. https://my-host/auth
  • realm // Keycloak realm - e.g. ondewo-ccai-platform
  • client_id // Public SDK client id - e.g. ondewo-sip-cai-sdk-public (no client secret)

On first use the SDK performs a one-time ROPC offline_access login and then auto-refreshes the short-lived access token in the background. Every RPC carries the resulting Authorization: Bearer <jwt> header, injected via the service wrapper's self.metadata.

Leaving the three Keycloak fields empty attaches no auth token (for use against a plaintext server or an Envoy ingress that injects auth).

Automatic Release Process

The entire process is automated to make development easier. The actual steps are simple:

TODO after Pull Request was merged in:

  • Checkout master:

    git checkout master
    
  • Pull the new stuff:

    git pull
    
  • (If not already, run the setup_developer_environment_locally command):

    make setup_developer_environment_locally
    
  • Update the ONDEWO_SIP_VERSION in the Makefile

  • Add the new Release Notes in RELEASE.md in the format:

    ## Release ONDEWO SIP Python Client X.X.X       <---- Beginning of Notes
    
       ...<NOTES>...
    
    *****************                      <---- End of Notes
    
  • Release:

    make ondewo_release
    

The release process can be divided into 6 Steps:

  1. build specified version of the ondewo-sip-api
  2. commit and push all changes in code resulting from the build
  3. Create and push the release branch e.g. release/1.3.20
  4. Create and push the release tag e.g. 1.3.20
  5. Create a new Release on GitHub
  6. Publish the built dist folder to pypi.org

:warning: The Release Automation checks if the build has created all the proto-code files, but it does not check the code-integrity. Please build and test the generated code prior to starting the release process.

Download files

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

Source Distribution

ondewo_sip_client-5.4.0.tar.gz (30.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ondewo_sip_client-5.4.0-py3-none-any.whl (35.0 kB view details)

Uploaded Python 3

File details

Details for the file ondewo_sip_client-5.4.0.tar.gz.

File metadata

  • Download URL: ondewo_sip_client-5.4.0.tar.gz
  • Upload date:
  • Size: 30.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.11

File hashes

Hashes for ondewo_sip_client-5.4.0.tar.gz
Algorithm Hash digest
SHA256 fd4305930d4fdc6cb5bb3bc6ae3c716800b481fb064d17f7dcbf5a59b5f37276
MD5 aebc9867c66e8cf9cd9ee385813fb9fc
BLAKE2b-256 1d07b93e75ad952113ed10b5d14b29eed52af1ca22e45d7ce46db07d4d391582

See more details on using hashes here.

File details

Details for the file ondewo_sip_client-5.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ondewo_sip_client-5.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6834ea4591b11921bb03e846c1fae44411128137684d9ed8e324802b2b58894b
MD5 4234466f4a2f8728b7c205ffde28adb2
BLAKE2b-256 c350a5c1612fc2856f73404eb588a09fc19013b5089d9475160cb7e856c7f4cb

See more details on using hashes here.

Release history Release notifications | RSS feed

5.4.2

2 files

5.4.1

2 files

This release

5.4.0 This release

2 files

5.3.0

2 files

5.2.0

2 files

5.1.1

2 files

5.1.0

2 files

5.0.0

2 files

4.0.1

2 files

4.0.0

2 files

3.7.0

2 files

3.6.1

2 files

3.6.0

2 files

3.5.0

2 files

3.4.0

2 files

3.3.0

2 files

3.2.0

2 files

2.2.1

2 files

2.2.0

2 files

2.1.0

2 files

2.0.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page