This example demonstrates how to integrate Auths verification into a Python web service using FastAPI. It includes commit and artifact verification endpoints, agent identity workflows, and a pytest test suite.
# 1. Install dependencies
pip install -e ".[dev]"
# 2. Run the verification service
uvicorn app.main:app --reload
# 3. Test a verification request
curl -X POST http://localhost:8000/api/v1/verify-commit \
-H "Content-Type: application/json" \
-d '{"repo_path": ".", "commit_range": "HEAD~1..HEAD"}'| Path | Purpose |
|---|---|
app/main.py |
FastAPI application with versioned API |
app/routes/verify.py |
POST /api/v1/verify-commit and POST /api/v1/verify-artifact |
app/routes/health.py |
GET /health with SDK version info |
app/services/commit_verifier.py |
Wrapper around auths.git.verify_commit_range() |
app/services/artifact_verifier.py |
Wrapper around Auths artifact verification |
app/models.py |
Pydantic request/response models |
agent/deploy_agent.py |
CI agent: sign artifacts during deployment |
agent/audit_agent.py |
Audit agent: verify all commits in repo history |
tests/ |
pytest suite with mock fixtures |
graph LR
A[Client] -->|POST /api/v1/verify-commit| B[FastAPI App]
A -->|POST /api/v1/verify-artifact| B
B --> C[CommitVerifier]
B --> D[ArtifactVerifier]
C -->|auths.git.verify_commit_range| E[Auths SDK]
D -->|auths.Auths.verify| E
E --> F[allowed_signers / identity bundles]
- Python 3.11+
- Auths CLI (
brew install auths-dev/auths-cli/auths) - Docker (optional, for containerized deployment)
Start the server and visit http://localhost:8000/docs for interactive Swagger documentation.
| Method | Path | Description |
|---|---|---|
POST |
/api/v1/verify-commit |
Verify commit signatures in a git repository |
POST |
/api/v1/verify-artifact |
Verify an artifact signature |
GET |
/health |
Service health check |
pytest -vdocker compose up --build
# Service available at http://localhost:8000The agent/ directory demonstrates how to use Auths agent identities in CI/CD pipelines:
deploy_agent.py— Sign artifacts during deployment using an agent identityaudit_agent.py— Batch-verify all commits in a repository
See the Auths Agent Documentation for more details.