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
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
"""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
|
||||
Reference in New Issue
Block a user