feat(call): wire from_call forwarded_for and peer-keyed collision (call/from-call-forwarded-for)

This commit is contained in:
2026-06-28 22:19:23 +00:00
parent 95b06fc07f
commit f5fede2758
3 changed files with 391 additions and 26 deletions

View File

@@ -83,11 +83,19 @@ impl CallConnection {
}
pub async fn call(&self, operation_id: &str, input: Value) -> ResponseEnvelope {
let request_id = generate_request_id();
let payload = serde_json::json!({
"operationId": operation_id,
"input": input,
});
self.call_with_payload(payload).await
}
/// Invoke a remote op with a caller-constructed `call.requested` payload.
/// The payload MUST include `operationId` and `input`; the caller may add
/// `forwarded_for` (ADR-032) and `auth_token` (ADR-017 §7) for the hub
/// forwarding path used by `from_call`.
pub async fn call_with_payload(&self, payload: Value) -> ResponseEnvelope {
let request_id = generate_request_id();
let (send, recv) = match self.connection.open_bi().await {
Ok(pair) => pair,