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-keyover HTTP(S) with a per-deployment service token. - Enforces
CLIENT_SCOPElocally against the authoritativeclientreturned by admin-platform. - Caches successful verification results for
KEY_CACHE_TTL/AUTH_CACHE_TTLseconds. cache_ttl=0disables caching so revocation is immediately visible.fail_open=falserejects 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.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| keyverify-2.0.0.tar.gz | 116.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| keyverify-2.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 120.4 kB
Release files / keyverify-2.0.0.tar.gz
| Download URL | keyverify-2.0.0.tar.gz |
|---|---|
| Size | 116.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ab736817c5731251291978dea81a593a974db513f6344391a7a6615eeacd2fee
|
|
BLAKE2b-256 checksum How to use checksums |
69376babc69a393916e291960ced9b108c7df5eaca645e8cbea7c9efec4bfced
|
| 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 logRelease files / keyverify-2.0.0-py3-none-any.whl
| Download URL | keyverify-2.0.0-py3-none-any.whl |
|---|---|
| Size | 4.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8fa8c97eb8f634d7dd185d5f32dd00a16b816c776d8520e642e268e3adb4534d
|
|
BLAKE2b-256 checksum How to use checksums |
4b7d12302d59a934345e022aaee95791b013ff30b202a03e3b7e12aea2300508
|
| 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