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

from ibm_verify_community_sdk import IbmVerifyClient

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

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

client.close()

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.1.0.tar.gz (22.6 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.1.0-py3-none-any.whl (36.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ibm_verify_community_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 22.6 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.1.0.tar.gz
Algorithm Hash digest
SHA256 9a7baeca6fa1fd45b01ef77f4005ca17a44bf9a094cbcebc6694119d728faed5
MD5 e0fed6295598e2f87e472e53e73c4c62
BLAKE2b-256 da4bc2ad4e672c2de5c398bd2fed014de5031ecbe1b05afc5ba408ee987a7276

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ibm_verify_community_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 543332d1a45684513742fcc5884e7a4e63e27d2fdd8cb78195047aebc429b463
MD5 4628a55a8c3cd3cada00b1c83e22834a
BLAKE2b-256 1d919f8fd1a0fc8e245bcd8293451652312becc28a501a94d5905fdb3439037b

See more details on using hashes here.

Provenance

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