Skip to main content

No project description provided

Project description

KOAP: Lightweight Konnektor Client Library

Messages Logs

Sample Message Logs can be found here: https://spilikin.dev/koap-python/

Configuration using environment variables

Environment variable Comment
KONNEKTOR_BASE_URL Base URL for Konnektor. The connector.sds must be available at {KONNEKTOR_BASE_URL}/connector.sds
KONNEKTOR_MANDANT_ID Context Mandant ID (Tenant)
KONNEKTOR_CLIENT_SYSTEM_ID Context Client System ID
KONNEKTOR_WORKPLACE_ID Context Workplace ID
KONNEKTOR_USER_ID Context UserID (optional)
Basic Auth
KONNEKTOR_AUTH_METHOD  basic
KONNEKTOR_AUTH_BASIC_USERNAME Username for Basic authentication
KONNEKTOR_AUTH_BASIC_PASSWORD Password for Basic authentication
Mutual TLS Auth
KONNEKTOR_AUTH_METHOD  cert
KONNEKTOR_AUTH_CERT_P12_FILENAME Path to the PKCS#12 file with client credentials
KONNEKTOR_AUTH_CERT_P12_PASSWORD Password for PKCS#12 file
export KONNEKTOR_BASE_URL=https://.../
export KONNEKTOR_MANDANT_ID=m1
export KONNEKTOR_CLIENT_SYSTEM_ID=c1
export KONNEKTOR_WORKPLACE_ID=w1
export KONNEKTOR_USER_ID=user1
export KONNEKTOR_AUTH_BASIC_USERNAME=user1
export KONNEKTOR_AUTH_BASIC_PASSWORD='use strong passwords in production'

Once the environmant variables are set, the koap.config.ConnectorConfigcan be instantiated without parameters. We make use of Pydantic Model Config.

from koap.config import ConnectorConfig
from koap.client import ConnectorClient

config = ConnectorConfig()

client = ConnectorClient(config)

event_service = client.create_service_client('EventService', '7.2.0')

cards = event_service.GetCards(client.context())

print(cards)

Configuration in code

from koap.config import ConnectorConfig
from koap.client import ConnectorClient

config = ConnectorConfig(
    base_url='https://.../',
    mandant_id='m1',
    client_system_id='c1',
    workplace_id='w1',
    user_id='user1',
    # Basic Auth
    auth_method='cert',
    auth_cert_p12_filename='client.p12',
    auth_cert_p12_password='password for p12 file',
)

client = ConnectorClient(config)

event_service = client.create_service_client('EventService', '7.2.0')

cards = event_service.GetCards(client.context())

print(cards)

VSDM Facade

from koap.facade.vsdm.vsdm_facade import VSDMFacade
from koap.facade.model import CardTypeEnum
from koap.client import ConnectorClient, ConnectorConfig

config = ConnectorConfig()
client = ConnectorClient(config)

vsdm = VSDMFacade(client)

egks = vsdm.get_cards([CardTypeEnum.EGK])
egk_1 = egks[0]

print(egk_1)

smcbs = vsdm.get_cards([CardTypeEnum.SMC_B])
smcb_1 = smcbs[0]

print(smcb_1)

vsd = vsdm.read_vsd(
    EhcHandle=egk_1.CardHandle,
    HpcHandle=smcb_1.CardHandle,
    PerformOnlineCheck=False,
    ReadOnlineReceipt=False,
)

print(vsd)

Development

git submodule init
git submodule update
poetry install

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

koap-0.4.0.tar.gz (322.2 kB view details)

Uploaded Source

Built Distribution

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

koap-0.4.0-py3-none-any.whl (593.3 kB view details)

Uploaded Python 3

File details

Details for the file koap-0.4.0.tar.gz.

File metadata

  • Download URL: koap-0.4.0.tar.gz
  • Upload date:
  • Size: 322.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.13.7 Darwin/24.6.0

File hashes

Hashes for koap-0.4.0.tar.gz
Algorithm Hash digest
SHA256 46ea92337824076fdac7f3909732ac2fb364d60da0e680f26a08cbf57a6ec87b
MD5 527fee513e1ebdff94738b583dbef73b
BLAKE2b-256 a9b2b04650e415dffdb3c5be84cccffb6c2a86fbb642a7fb219aa9d469461b32

See more details on using hashes here.

File details

Details for the file koap-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: koap-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 593.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.13.7 Darwin/24.6.0

File hashes

Hashes for koap-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 277e70ca8f9e18ceccd4963897f00fce564a40b55d00b8f41d38713843a2c147
MD5 0c222c733f5337182bf48a8efb9819ae
BLAKE2b-256 32e3b6a8afd0b1826417920b4dadbc7547a0771f30369cf21bdb1ce2e172a602

See more details on using hashes here.

Supported by

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