Add authorized Unix pipe forwarding

This commit is contained in:
Eric Wendland 2026-05-21 01:15:51 +02:00
commit 3d0da22eae
8 changed files with 491 additions and 16 deletions

View file

@ -313,6 +313,17 @@ pub enum ControlRequest {
target_addr: String,
bearer_secret: Option<String>,
},
PipeUnixForward {
node: String,
listen_path: PathBuf,
target_path: PathBuf,
bearer_secret: Option<String>,
},
PipeUnixStream {
node: String,
target_path: PathBuf,
bearer_secret: Option<String>,
},
PipeSend {
target: String,
data_base64: String,
@ -1050,6 +1061,12 @@ pub enum PipeWireRequest {
nonce: String,
bearer_proof: Option<BearerProof>,
},
UnixConnect {
peer_card: PeerCard,
target_path: PathBuf,
nonce: String,
bearer_proof: Option<BearerProof>,
},
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
@ -2118,6 +2135,29 @@ mod tests {
response
);
let request = PipeWireRequest::UnixConnect {
peer_card: PeerCard {
node_id: "node:caller".into(),
agent_id: "agent:caller".into(),
endpoints: Vec::new(),
issued_at: geth_types::UnixMillis(1),
signature: geth_discovery::SignatureMetadata {
namespace: "geth.peer-card.v1@geth.local".to_owned(),
signer: "agent:caller".to_owned(),
public_key: "key".to_owned(),
signature: "sig".to_owned(),
},
},
target_path: PathBuf::from("/tmp/geth-test.sock"),
nonce: "nonce".to_owned(),
bearer_proof: None,
};
assert_eq!(
decode_pipe_wire_request(&encode_pipe_wire_request(&request).expect("encode"))
.expect("decode"),
request
);
let response = PeerControlResponse::SshProxyConnected {
node_id: "node:peer".to_owned(),
agent_id: "agent:peer".to_owned(),