(&self, input: &serde_json::Value)
| 209 | } |
| 210 | |
| 211 | async fn read_file(&self, input: &serde_json::Value) -> AppResult<String> { |
| 212 | let path_str = input["path"] |
| 213 | .as_str() |
| 214 | .ok_or_else(|| AppError::Validation("Missing 'path' field".to_string()))?; |
| 215 | let safe_path = self.validate_path(path_str)?; |
| 216 | tokio::fs::read_to_string(safe_path) |
| 217 | .await |
| 218 | .map_err(AppError::from) |
| 219 | } |
| 220 | |
| 221 | async fn write_file(&self, input: &serde_json::Value) -> AppResult<String> { |
| 222 | let path_str = input["path"] |