Skip to main content

key-verify-client

Shared central API-key verification client used by ingress services such as agent-platform and asr-service when central API-key verification is enabled.

Package naming

The three names intentionally differ by responsibility:

  • Git repository: key-verify-client
  • PyPI project / distribution: keyverify
  • Python import package: keyverify

Do not change [project].name in pyproject.toml to key-verify-client or key_verify_client. The existing PyPI project is keyverify, and Trusted Publishing authorizes that project name.

Install from PyPI:

pip install keyverify

Import from Python:

from keyverify import KeyVerifyClient, VerificationResult

Behavior

  • Calls POST /internal/verify-key over HTTP(S) with a per-deployment service token.
  • Enforces CLIENT_SCOPE locally against the authoritative client returned by admin-platform.
  • Caches successful verification results for KEY_CACHE_TTL / AUTH_CACHE_TTL seconds.
  • cache_ttl=0 disables caching so revocation is immediately visible.
  • fail_open=false rejects when the central service is unreachable and there is no live cache entry.
  • Plaintext client keys are never used as cache dictionary keys; only SHA-256 digests are retained.

Local development

python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
pytest -q

Build and verify release artifacts

Always clean old artifacts first:

rm -rf dist build *.egg-info src/*.egg-info
python -m build
python -m twine check dist/*
python scripts/verify_dist_metadata.py dist

For version 2.0.0, the artifact names must be:

keyverify-2.0.0-py3-none-any.whl
keyverify-2.0.0.tar.gz

The metadata verification command must report:

Name=keyverify Version=2.0.0

Only after those checks pass should CI upload dist/* to PyPI.

Release files for keyverify 2.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for keyverify 2.0.2
File Size Uploaded
keyverify-2.0.2.tar.gz 116.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for keyverify 2.0.2
File Interpreter ABI Platform
keyverify-2.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 120.4 kB

Release files / keyverify-2.0.2.tar.gz

Download URL keyverify-2.0.2.tar.gz
Size 116.0 kB
Tags Source
SHA-256 checksum
How to use checksums
8226c9b37ab752bf52f8cebed3906d53e3807b56c1b2ebea6222b7b982b29ab4
BLAKE2b-256 checksum
How to use checksums
5cce9e01690fc6a19b896f9bd08172c72393cdb780409d0f6abe4889a9756ad2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 24, 2026.

Transparency log

Release files / keyverify-2.0.2-py3-none-any.whl

Download URL keyverify-2.0.2-py3-none-any.whl
Size 4.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8ce9b7f02ec4826034f21a184aa89bbabf51143dd09d18bc413215f9a79dfa56
BLAKE2b-256 checksum
How to use checksums
57b2cc22223f04546681296406af36261dee2c232876611eaca242ad25dcc77a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 24, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.0.2 This release

2 release files

2.0.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page