Get an AgentIdentity by agent_id.
(
agent_id: str,
db: Annotated[AsyncSession, Depends(get_db)],
)
| 166 | description="Retrieve an AgentIdentity by agent_id.", |
| 167 | ) |
| 168 | async def get_identity( |
| 169 | agent_id: str, |
| 170 | db: Annotated[AsyncSession, Depends(get_db)], |
| 171 | ) -> AgentIdentityOut: |
| 172 | """Get an AgentIdentity by agent_id.""" |
| 173 | svc = AgentIdentityService(db) |
| 174 | identity = await svc.get_by_id(agent_id) |
| 175 | if identity is None: |
| 176 | raise HTTPException(status_code=404, detail=f"AgentIdentity not found: {agent_id}") |
| 177 | return AgentIdentityOut( |
| 178 | agent_id=identity.agent_id, |
| 179 | agent_name=identity.agent_name, |
| 180 | org_id=identity.org_id, |
| 181 | issued_by=identity.issued_by, |
| 182 | public_key=identity.public_key, |
| 183 | org_ca_fingerprint=identity.org_ca_fingerprint, |
| 184 | issued_at=identity.issued_at, |
| 185 | valid_until=identity.valid_until, |
| 186 | status=identity.status, |
| 187 | is_active=identity.is_active, |
| 188 | revoked_at=identity.revoked_at, |
| 189 | revoked_by=identity.revoked_by, |
| 190 | revocation_reason=identity.revocation_reason, |
| 191 | metadata=identity.metadata, |
| 192 | ) |
| 193 | |
| 194 | |
| 195 | @_identity.get( |
nothing calls this directly
no test coverage detected