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.1.tar.gz (31.4 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.1-py3-none-any.whl (35.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ondewo_sip_client-5.4.1.tar.gz
  • Upload date:
  • Size: 31.4 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.1.tar.gz
Algorithm Hash digest
SHA256 4292ce1d13c1a3eec74686a9684bbd88e68246788d05c37b369b3bae4ae8986e
MD5 f432a511d4b9ef3cf6c7bb45157d2b89
BLAKE2b-256 b91056d9cfec80f816bc63b5a3753341e15c639bd4ba93a6f987a8327aafba2d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ondewo_sip_client-5.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0a4e6f75e73b4d6ab1b425cbfe7d4c2e29be0a3a719f5231d498be68f7f7d405
MD5 6917970249af1d0ae99157aa8a6d8ee1
BLAKE2b-256 885550ce25b23e447898bfc852b0f2f7db3e760e81c9915548d289b2f43ad24f

See more details on using hashes here.

Release history Release notifications | RSS feed

5.4.2

2 files

This release

5.4.1 This release

2 files

5.4.0

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