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.3.0.tar.gz (23.5 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.3.0-py3-none-any.whl (38.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ibm_verify_community_sdk-0.3.0.tar.gz
  • Upload date:
  • Size: 23.5 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.3.0.tar.gz
Algorithm Hash digest
SHA256 3a641283e82c7ff2da1f8f0ab3d83d8a9fe682f2a610a1c30067864bf600d8a3
MD5 5e1bce32665932530223b752e9ecd4ca
BLAKE2b-256 24fbaf7f73c594ab3bbc608433a6cad8b2736d1dbca66ef4af1b7639ad9c2ff6

See more details on using hashes here.

Provenance

The following attestation bundles were made for ibm_verify_community_sdk-0.3.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.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ibm_verify_community_sdk-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4c24e99dfffece2a3461d6dbcd6700a4d55cd2ad0f6072133c1fc203e5604c57
MD5 e7ed47fbfef2fe85b42701159a740576
BLAKE2b-256 5fba0dfac932b05f10a30c2cb8ff19e217ca32abea77ef1b9c8c77ac5284c406

See more details on using hashes here.

Provenance

The following attestation bundles were made for ibm_verify_community_sdk-0.3.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