Skip to main content

A community Python SDK for the IBM Verify API, providing modules for users, factors, applications, authentication methods, password policies, and self-service credentials.

Project description

ibm-verify-community-sdk

A Python API client library for IBM Verify.

Documentation

Requirements

  • Python 3.9+
  • pip

Installation

make venv
source .venv/bin/activate   # Windows: .venv\Scripts\activate

This creates a virtual environment, installs the package in editable mode, and installs pytest and python-dotenv.

Quick start

import asyncio

from ibm_verify_community_sdk import IbmVerifyClient

async def main() -> None:
    client = IbmVerifyClient(
        tenant_url="https://your-tenant.verify.ibm.com",
        access_token="your-access-token",
        versions={"users": "v2.0"},
    )

    response = await client.users.get_account_details()
    print(response.data.userName)

    await client.close()

asyncio.run(main())

Available modules

Module Access Version
users client.users v1.0, v2.0
factors client.factors v1.0, v2.0
applications client.applications v1.0
groups client.groups v2.0
oidc client.oidc v2.0
reports client.reports v1.0
authnmethods client.authnmethods v1.0
passwordpolicies client.passwordpolicies v3.0
usc client.usc v1.0

To use a specific version of a module, pass a versions dict when creating the client:

client = IbmVerifyClient(
    tenant_url="https://your-tenant.verify.ibm.com",
    access_token="your-access-token",
    versions={
        "users": "v2.0",
        "factors": "v2.0",
    },
)

Running the example script

python examples/client_examples.py

Running the functional tests

Functional tests make real API calls and require credentials to be set in a .env file.

First-time setup:

make init_env

This copies .env.example to .env. Open .env and fill in your values:

# Required for all tests
IBM_VERIFY_TENANT_URL=https://your-tenant.verify.ibm.com

# Admin token (required for most tests)
IBM_VERIFY_ACCESS_TOKEN_ADMIN=your-admin-access-token-here

# User token (required for user-scoped tests e.g. get_applications)
IBM_VERIFY_ACCESS_TOKEN_USER=your-user-access-token-here

# Username and password (required for authnmethods tests)
IBM_VERIFY_USERNAME=your-username-here
IBM_VERIFY_PASSWORD=your-password-here

# User ID for user-specific tests
IBM_VERIFY_USER_ID=your-user-id-here

# Contact details for OTP tests
IBM_VERIFY_EMAIL_ADDRESS=user@example.com
IBM_VERIFY_PHONE_NUMBER=+15551234567

# Group ID for groups tests
IBM_VERIFY_GROUP_ID=your-group-id-here

# Application ID for application tests (get, entitlements)
IBM_VERIFY_APPLICATION_ID=your-application-id-here

# Bookmark template ID for create/update/delete application tests
IBM_VERIFY_APP_TEMPLATE_ID=your-bookmark-template-id-here

# OIDC relying party client ID for OIDC tests
IBM_VERIFY_OIDC_CLIENT_ID=your-oidc-client-id-here

# Application ID for report tests
IBM_VERIFY_REPORT_APPID=your-report-app-id-here

Tests that require variables not set in .env are skipped automatically.

Run the tests:

make test

Or run a specific test file:

python -m pytest tests/function_tests/test_users.py -v

If the environment variables are not set, all tests will be skipped automatically.

Releasing to PyPI

1. Bump the version in pyproject.toml:

version = "x.y.z"

Follow Semantic Versioning: major.minor.patch.

2. Commit and push:

git add pyproject.toml
git commit -m "chore: bump version to x.y.z"
git push origin main

3. Create a GitHub release:

gh release create vx.y.z --generate-notes --title "vx.y.z"

This creates a tag, generates release notes from merged PRs/commits, and publishes the release on GitHub. The CI pipeline will then automatically build and publish the package to PyPI.

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

ibm_verify_community_sdk-0.2.0.tar.gz (22.9 kB view details)

Uploaded Source

Built Distribution

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

ibm_verify_community_sdk-0.2.0-py3-none-any.whl (37.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ibm_verify_community_sdk-0.2.0.tar.gz
Algorithm Hash digest
SHA256 bbbce8cfe0519489b370f14f8a336f0e70f38a3643a9e0cbdb80731894338e43
MD5 ea5f1adef94e90bc6e3076d0ceb5bed2
BLAKE2b-256 f1a970513aee053940d15d051169c134d7bc9ce012f9eca81240ff58de4bdb78

See more details on using hashes here.

Provenance

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

Publisher: release.yml on cds-snc/ibm-verify-community-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 ibm_verify_community_sdk-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ibm_verify_community_sdk-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 62c59947f631266e7448ba343e024b87a2481c9a827448b98ca21b102df974fb
MD5 6ca8b862d7d3cb9644a3620485fc9454
BLAKE2b-256 2b31e4aa30ece01ed245d7137e4940f6333ac1698c2afc408900465a671794a8

See more details on using hashes here.

Provenance

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

Publisher: release.yml on cds-snc/ibm-verify-community-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