Skip to main content

Reusable Webex Bring Your Own Data Source management utilities

Project description

Webex BYODS Python SDK

Reusable Python utilities for managing Webex Bring Your Own Data Source (BYODS) data sources. The SDK supports registration, retrieval, updates, schema discovery, JWT claim inspection, service-app authentication, and data source token extension.

The SDK does not read credentials from files, environment variables, or cloud secret managers. The host application owns secret retrieval and provides an explicit token provider to the SDK.

Install

Until publication, install from a local checkout:

python3 -m pip install -e .

Quick start with a service-app token

  1. Create and authorize a Webex Service App.
  2. Select spark-admin:datasource_read to list data sources and spark-admin:datasource_write to register, update, or extend them. See the Data Sources API reference for the required permissions.
  3. Retrieve the authorized service app's access token and pass it directly to the SDK from your application's secret source. Do not commit it or embed it in source code.
from webex_byods import StaticAccessTokenProvider, WebexDataSourceClient

client = WebexDataSourceClient(
    token_provider=StaticAccessTokenProvider(service_app_access_token)
)
data_sources = client.list_all_data_sources()

Refresh service-app tokens

For automatic service-app token acquisition, the host application supplies credentials and a personal-token provider. It can obtain those values from its own configuration, AWS Secrets Manager, or another secret system.

from webex_byods import (
    ServiceAppCredentials,
    StaticAccessTokenProvider,
    WebexDataSourceClient,
    WebexServiceAppTokenProvider,
)

credentials = ServiceAppCredentials(
    app_id="service-app-id",
    client_id="service-app-client-id",
    client_secret="service-app-client-secret",
    target_org_id="target-org-id",
)
service_token_provider = WebexServiceAppTokenProvider(
    credentials,
    StaticAccessTokenProvider("personal-access-token"),
)
client = WebexDataSourceClient(token_provider=service_token_provider)

OAuthRefreshTokenProvider is available when the host application manages an OAuth refresh token. Providers use InMemoryTokenStore by default; applications that need persistence can supply their own TokenStore implementation.

Use the client

data_sources = client.list_all_data_sources()
schemas = client.get_data_source_schemas()

result = client.extend_data_source_token(
    data_source_id="data-source-id",
    token_lifetime_minutes=1440,
)

BYODS API operations return dictionaries containing success, data or error, and status_code. A 401 response causes one retry with token_provider.get_access_token(force_refresh=True).

WebexDataSourceManager remains an alias for WebexDataSourceClient during the transition. TokenManager is deprecated; use WebexServiceAppTokenProvider instead.

Development

python3 -m pip install -e ".[dev]"
python3 -m pytest -q
ruff check .

License

Cisco Sample Code License

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

webex_byods_sdk-0.2.0.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

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

webex_byods_sdk-0.2.0-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file webex_byods_sdk-0.2.0.tar.gz.

File metadata

  • Download URL: webex_byods_sdk-0.2.0.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for webex_byods_sdk-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d22d3b85732a83844f01a8edcbee8c30da5517514616328bee8a657f4086b6f3
MD5 57e99ffb8d65de9daff62c33fc0827ef
BLAKE2b-256 fd2139339aa5858be855b66af5a57e66c1160d66b9b9f080a7524d8476c6acf1

See more details on using hashes here.

Provenance

The following attestation bundles were made for webex_byods_sdk-0.2.0.tar.gz:

Publisher: publish-pypi.yml on WebexCommunity/webex-python-byods-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file webex_byods_sdk-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: webex_byods_sdk-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for webex_byods_sdk-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c27d2dfad367dbd84ec73dbb85c87b1a4d3eae24aa2825a6bde1762ba3fe0ab0
MD5 a457f129c39776dc6c4632212720c1a3
BLAKE2b-256 16662add83dadb8a30147264fe17fcefbc57f7710bf4d78ebc574abce1cdd81a

See more details on using hashes here.

Provenance

The following attestation bundles were made for webex_byods_sdk-0.2.0-py3-none-any.whl:

Publisher: publish-pypi.yml on WebexCommunity/webex-python-byods-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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