(bytes: &[u8])
| 599 | } |
| 600 | |
| 601 | pub fn parse(bytes: &[u8]) -> Result<Self, String> { |
| 602 | if bytes.len() > MAX_BYTES { |
| 603 | return Err("Review decision exceeds the explicit 256 MiB artifact byte budget; no findings were truncated".into()); |
| 604 | } |
| 605 | let value = crate::jcs::admit_document(bytes).map_err(|error| error.to_string())?; |
| 606 | let decision: Self = serde_json::from_value(value).map_err(|error| error.to_string())?; |
| 607 | decision.validate()?; |
| 608 | Ok(decision) |
| 609 | } |
| 610 | } |
| 611 | |
| 612 | #[cfg(test)] |
nothing calls this directly
no test coverage detected