MCP: classify inbound responses through SDK with fresh authorization
CI / UI Checks (pull_request) Successful in 10s
CI / Rust Checks (pull_request) Successful in 37m3s
CI / Rust Feature Validation (pull_request) Skipped
CI / Frontend E2E (pull_request) Skipped
CI / Community Image Smoke (pull_request) Skipped
CI / Required Checks (pull_request) Successful in 1s
CI / Deploy (pull_request) Skipped

This commit is contained in:
bsodfather committed 2026-11-13 00:41:28 +00:00
1 parent 66bb135398
commit 65144fd8c6
7 files changed
+628 -47

No files matched your search

@@ -278,6 +278,17 @@ async fn mcp_post_response(
Err(_status) => return ambiguous_session_carrier_response(headers, message),
};
// Responses ACK before era/session resolution, but must not bypass fresh credentials.
// Method-bearing messages retain their existing scoped authorization path below.
if message
.as_object()
.is_some_and(|object| !object.contains_key("method"))
&& let Err(error) =
require_traced_machine_access(&state, path, headers, PlatformApiKeyScope::Read).await
{
return error.into_response();
}
// Single JSON-RPC envelope guard: only a well-formed message reaches era resolution, dispatch,
// approval or any outbound request. Syntactically valid JSON is not the same as a valid envelope.
let envelope = match crate::protocol::validate_jsonrpc_envelope(message) {