Address response bodies by response id instead of a filesystem path

The body commands took a path from the client, so a token holder could
read any file the process could. They now take a response id and resolve
the location themselves, and the UI never sees a path at all: the desktop
host asks the backend where the file is, and the bridge fetches
/responses/:id/body.

Ephemeral responses (GraphQL introspection) never reach the database, so
resolution falls back to the path send writes them to.
This commit is contained in:
Gregory Schier
2026-08-14 17:02:05 -07:00
parent 99a318224f
commit 448d349af8
18 changed files with 366 additions and 110 deletions
+2 -1
View File
@@ -1,4 +1,5 @@
use crate::render::render_http_request;
use crate::responses::response_body_path;
use async_trait::async_trait;
use log::warn;
use std::path::{Path, PathBuf};
@@ -660,7 +661,7 @@ pub async fn send_http_request<T: TemplateCallback>(
source,
}
})?;
let body_path = params.response_dir.join(&response.id);
let body_path = response_body_path(params.response_dir, &response.id);
let response_body_path = body_path.to_string_lossy().to_string();
let connected_response = HttpResponse {
state: HttpResponseState::Connected,