- Add V1 API endpoints: assets, ledger, user-info - Implement Fernet-based credential payload encryption (req-010) - Extend health response schema with runtime info (req-004) - Add service token runtime ID issuance (req-005) - Implement database schema migration for V1 API (req-009) - Add comprehensive test coverage for V1 endpoints - Update SRS with 10 new requirements (REQ-004 through REQ-011) - Create batch planning, design, and verification for BAT-001 - Integrate review-discovery StagePilot skill - Update documentation indices and baseline specs
33 lines
708 B
Python
33 lines
708 B
Python
"""Health and readiness endpoints."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from datetime import datetime, timezone, timedelta
|
|
|
|
from fastapi import APIRouter
|
|
from pydantic import BaseModel
|
|
|
|
from app.core.config import get_settings
|
|
|
|
router = APIRouter(tags=["health"])
|
|
|
|
_KST = timezone(timedelta(hours=9))
|
|
|
|
|
|
class HealthResponse(BaseModel):
|
|
status: str
|
|
service: str
|
|
version: str
|
|
checked_at: str
|
|
|
|
|
|
@router.get("/health", response_model=HealthResponse)
|
|
def healthcheck() -> HealthResponse:
|
|
settings = get_settings()
|
|
return HealthResponse(
|
|
status="ok",
|
|
service="portfolio-hub",
|
|
version=settings.app_version,
|
|
checked_at=datetime.now(_KST).isoformat(),
|
|
)
|