Organize device inventory by customer and restrict token access to its audience
This commit is contained in:
@@ -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"}),
|
||||
))
|
||||
|
||||
Reference in New Issue
Block a user