- 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
18 lines
494 B
Python
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
|