feat: add health check endpoint for agent authentication status

This commit is contained in:
Abhimanyu Saharan
2026-02-16 00:42:15 +05:30
parent cd68446c42
commit 1d63bd0148
4 changed files with 133 additions and 0 deletions

View File

@@ -2,6 +2,8 @@
from __future__ import annotations
from uuid import UUID
from pydantic import Field
from sqlmodel import SQLModel
@@ -13,3 +15,29 @@ class HealthStatusResponse(SQLModel):
description="Indicates whether the probe check succeeded.",
examples=[True],
)
class AgentHealthStatusResponse(HealthStatusResponse):
"""Agent-authenticated liveness payload for agent route probes."""
agent_id: UUID = Field(
description="Authenticated agent id derived from `X-Agent-Token`.",
examples=["aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"],
)
board_id: UUID | None = Field(
default=None,
description="Board scope for the authenticated agent, when applicable.",
examples=["bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb"],
)
gateway_id: UUID = Field(
description="Gateway owning the authenticated agent.",
examples=["cccccccc-cccc-cccc-cccc-cccccccccccc"],
)
status: str = Field(
description="Current persisted lifecycle status for the authenticated agent.",
examples=["online", "healthy", "updating"],
)
is_board_lead: bool = Field(
description="Whether the authenticated agent is the board lead.",
examples=[False],
)