Files
kca/server/tests/helpers/api.py
T
woggioni 4f3a632f4b Implement KCA: web reimplementation of XCA PKI workflows
- kaya backend with OIDC sessions, API tokens, Postgres/Tortoise models
- AES-256-GCM private key storage and full certificate/CSR/CRL domain logic
- Sycamore/WASM SPA for vaults, keys, requests, certificates, CRLs and templates
- imports/exports, XCA .xdb migration, Docker Compose stack and tests
2026-10-23 02:06:55 +00:00

18 lines
494 B
Python

"""In-process HTTP client for the app."""
from __future__ import annotations
import contextlib
from typing import AsyncIterator
from httpx import ASGITransport, AsyncClient
from kca.app import app, tortoise_mixin
@contextlib.asynccontextmanager
async def api_client() -> AsyncIterator[AsyncClient]:
await tortoise_mixin.ensure_context()
transport = ASGITransport(app=app)
async with AsyncClient(transport=transport, base_url="http://127.0.0.1") as client:
yield client