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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a641283e82c7ff2da1f8f0ab3d83d8a9fe682f2a610a1c30067864bf600d8a3
|
|
| MD5 |
5e1bce32665932530223b752e9ecd4ca
|
|
| BLAKE2b-256 |
24fbaf7f73c594ab3bbc608433a6cad8b2736d1dbca66ef4af1b7639ad9c2ff6
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ibm_verify_community_sdk-0.3.0.tar.gz -
Subject digest:
3a641283e82c7ff2da1f8f0ab3d83d8a9fe682f2a610a1c30067864bf600d8a3 - Sigstore transparency entry: 1792582240
- Sigstore integration time:
-
Permalink:
cds-snc/ibm-verify-community-sdk@1d6bb624761d39e94fc39e2f2f1b9511c4200cc0 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/cds-snc
-
Access:
internal
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1d6bb624761d39e94fc39e2f2f1b9511c4200cc0 -
Trigger Event:
release
-
Statement type:
File details
Details for the file ibm_verify_community_sdk-0.3.0-py3-none-any.whl.
File metadata
- Download URL: ibm_verify_community_sdk-0.3.0-py3-none-any.whl
- Upload date:
- Size: 38.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c24e99dfffece2a3461d6dbcd6700a4d55cd2ad0f6072133c1fc203e5604c57
|
|
| MD5 |
e7ed47fbfef2fe85b42701159a740576
|
|
| BLAKE2b-256 |
5fba0dfac932b05f10a30c2cb8ff19e217ca32abea77ef1b9c8c77ac5284c406
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ibm_verify_community_sdk-0.3.0-py3-none-any.whl -
Subject digest:
4c24e99dfffece2a3461d6dbcd6700a4d55cd2ad0f6072133c1fc203e5604c57 - Sigstore transparency entry: 1792582347
- Sigstore integration time:
-
Permalink:
cds-snc/ibm-verify-community-sdk@1d6bb624761d39e94fc39e2f2f1b9511c4200cc0 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/cds-snc
-
Access:
internal
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1d6bb624761d39e94fc39e2f2f1b9511c4200cc0 -
Trigger Event:
release
-
Statement type: