corvix.web.health

Health endpoints and their supporting helpers.

Serves GET /api/v1/health (the versioned health check) and GET /api/health (an unversioned, always-public alias kept so container health checks — docker-compose, e2e, Lighthouse — need not track the API version).

Attributes

Functions

_health_error(→ dict[str, object])

_health_check_staleness(→ dict[str, object])

_read_health_poller_status(...)

Resolve the poller status for the health check, or a failure payload.

_health_impl(→ litestar.Response[dict[str, object]])

Compute and return the health check response.

health(→ litestar.Response[dict[str, object]])

Health endpoint for container checks.

health_container(→ litestar.Response[dict[str, object]])

Unversioned health alias for container healthchecks; see /api/v1/health.

Module Contents

corvix.web.health.logger[source][source]
corvix.web.health._health_error(poller_status: corvix.domain.PollerStatus) dict[str, object][source][source]
corvix.web.health._health_check_staleness(last_poll_str: str) dict[str, object][source][source]
corvix.web.health._read_health_poller_status() corvix.domain.PollerStatus | dict[str, object][source][source]

Resolve the poller status for the health check, or a failure payload.

corvix.web.health._health_impl() litestar.Response[dict[str, object]][source][source]

Compute and return the health check response.

Both health endpoints are always public (issue #131), even when CORVIX_SECRET_TOKEN is set, so the response body is trimmed to a bare {"status": ...} — no reason, detail, or other internals that could leak service state to an unauthenticated caller. The full detail (poller_status.last_error, per-account errors, …) remains available to authenticated clients via /api/v1/snapshot.

corvix.web.health.health() litestar.Response[dict[str, object]][source][source]

Health endpoint for container checks.

Returns 200 with {“status”: “ok”} when config and storage are readable, the poller is running, and the poller’s last poll time is not stale. Returns 503 with {“status”: “unhealthy”} otherwise.

This endpoint is always public, so the response carries no further detail; see the authenticated /api/v1/snapshot endpoint for poller error detail.

corvix.web.health.health_container() litestar.Response[dict[str, object]][source][source]

Unversioned health alias for container healthchecks; see /api/v1/health.