fix: harden streaming transport and ownership checks

This commit is contained in:
a.tolmachev
2026-04-11 01:29:01 +03:00
parent 1a4f0ea6f3
commit 2770c5935f
3 changed files with 348 additions and 7 deletions
+12 -4
View File
@@ -2246,10 +2246,18 @@ impl AdminService {
let created_at = now_string().map_err(|error| RuntimeError::SecretCrypto {
details: error.to_string(),
})?;
let expires_at =
add_millis(&created_at, 300_000).map_err(|error| RuntimeError::SecretCrypto {
details: error.to_string(),
})?;
let streaming = runtime.execution_config.streaming.as_ref().ok_or_else(|| {
RuntimeError::MissingStreamingConfig {
operation_id: runtime.operation_id.as_str().to_owned(),
}
})?;
let expires_at = add_millis(
&created_at,
streaming.max_session_lifetime_ms.unwrap_or(300_000),
)
.map_err(|error| RuntimeError::SecretCrypto {
details: error.to_string(),
})?;
let job = AsyncJobHandle {
id: crank_core::AsyncJobId::new(new_prefixed_id("job")),
workspace_id: workspace_id.clone(),