(
verifier: &State<Arc<CvmVerifier>>,
request: Json<VerificationRequest>,
)
| 41 | |
| 42 | #[post("/verify", data = "<request>")] |
| 43 | async fn verify_cvm( |
| 44 | verifier: &State<Arc<CvmVerifier>>, |
| 45 | request: Json<VerificationRequest>, |
| 46 | ) -> Json<VerificationResponse> { |
| 47 | match verifier.verify(request.into_inner()).await { |
| 48 | Ok(response) => Json(response), |
| 49 | Err(e) => { |
| 50 | error!("Verification failed: {:?}", e); |
| 51 | Json(VerificationResponse { |
| 52 | is_valid: false, |
| 53 | details: VerificationDetails { |
| 54 | quote_verified: false, |
| 55 | event_log_verified: false, |
| 56 | os_image_hash_verified: false, |
| 57 | report_data: None, |
| 58 | tcb_status: None, |
| 59 | advisory_ids: vec![], |
| 60 | app_info: None, |
| 61 | acpi_tables: None, |
| 62 | rtmr_debug: None, |
| 63 | }, |
| 64 | reason: Some(format!("Internal error: {}", e)), |
| 65 | }) |
| 66 | } |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | #[get("/health")] |
| 71 | fn health() -> Json<serde_json::Value> { |
nothing calls this directly
no test coverage detected