MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / args_match_ssh_forward

Function args_match_ssh_forward

crates/openshell-core/src/forward.rs:212–227  ·  view source on GitHub ↗

Match an `OpenShell` SSH forward by proxy ownership and outer SSH args.

(args: &[&str], port: u16, sandbox_id: Option<&str>)

Source from the content-addressed store, hash-verified

210
211/// Match an `OpenShell` SSH forward by proxy ownership and outer SSH args.
212fn args_match_ssh_forward(args: &[&str], port: u16, sandbox_id: Option<&str>) -> bool {
213 if args.first().and_then(|arg| arg.rsplit('/').next()) != Some("ssh") {
214 return false;
215 }
216 let Some(proxy) = find_proxy_command_match(args, sandbox_id) else {
217 return false;
218 };
219 if sandbox_id.is_some() && !proxy.sandbox_id_requirement_met {
220 return false;
221 }
222 outer_ssh_forward_matches(
223 &args[proxy.outer_ssh_args_start..],
224 port,
225 proxy.prefix_has_no_command,
226 )
227}
228
229/// Test-only wrapper for flat command lines.
230#[cfg(test)]

Callers 2

Calls 3

find_proxy_command_matchFunction · 0.85
nextMethod · 0.45

Tested by

no test coverage detected