Skip to main content

Pure-Python client SDK for the CAI-AUTH server (CBOR/HTTP).

Project description

cai-auth-sdk (Python)

Pure-Python client SDK for the CAI-AUTH server using HTTP/CBOR. Zero native dependencies — pip installs cleanly on any platform that has Python 3.11+.

Install

# From the monorepo (editable)
pip install -e cai-auth-python-sdk

# Or build a wheel
cd cai-auth-python-sdk && python -m build

Quick start

from cai_auth_sdk import CaiAuthClient

async with CaiAuthClient(base_url="https://cai-auth.example.com") as c:
    ok = await c.health()
    assert ok.status == "ok"

Running tests (Docker only, per project rule)

docker run --rm --name caiauth_python_sdk_test \
  -u $(id -u):$(id -g) \
  -v $(pwd)/..:/work \
  -w /work/cai-auth-python-sdk \
  caiauth/python-sdk-test:latest \
  pytest -v

Scope

Covers all 11 CAI-AUTH protocol endpoints in the 0.2.0 spec:

# Endpoint SDK method
1 GET /health health()
2 GET /metrics metrics()
3 POST /v1/enroll/begin enroll_begin()
4 POST /v1/enroll/complete enroll_complete()
5 POST /v1/challenge/create challenge_create()
6 POST /v1/challenge/verify challenge_verify()
7 POST /v1/recovery/begin recovery_begin()
8 POST /v1/recovery/submit-shard recovery_submit_shard()
9 POST /v1/recovery/complete recovery_complete()
10 POST /v1/revoke revoke()
11 GET /v1/audit audit()

Limitations

  • No certificate pinning (add in Phase 5.1 alongside public deployment).
  • No automatic session token refresh — follow server semantics in §5.
  • Sync API only for now; async is the primary surface.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

cai_auth_sdk-0.7.8-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file cai_auth_sdk-0.7.8-py3-none-any.whl.

File metadata

  • Download URL: cai_auth_sdk-0.7.8-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for cai_auth_sdk-0.7.8-py3-none-any.whl
Algorithm Hash digest
SHA256 f216c9663626c8cc1a23885ec18f8838ac6146f6bc4bffc7f1b89d7980588ff2
MD5 613984e0086b690bf353442819e490c1
BLAKE2b-256 117bc015b8e6ecc47f4831846f380ede39691f76686c9d505183d3704c1b14a9

See more details on using hashes here.

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