Organize device inventory by customer and restrict token access to its audience

This commit is contained in:
2026-11-17 21:55:24 +01:00
parent aeb9adc649
commit 0afaca1d64
39 changed files with 1950 additions and 225 deletions
+8 -1
View File
@@ -13,7 +13,14 @@ pub async fn health(
h: HeaderMap,
Path(t): Path<Uuid>,
) -> Result<Json<Value>, StatusCode> {
let Json(devices) = crate::api::devices(State(s), h, Path(t)).await?;
let Json(devices) = crate::devices::page(
State(s),
h,
Path(t),
axum::extract::Query(Default::default()),
)
.await
.map_err(|e| e.0)?;
Ok(Json(
json!({"items":devices["items"],"next_cursor":null,"completeness":devices["completeness"],"truncated":devices["truncated"],"as_of":Utc::now(),"health":"unknown","source_id":"stored_agent_observations"}),
))