Match an `OpenShell` SSH forward by proxy ownership and outer SSH args.
(args: &[&str], port: u16, sandbox_id: Option<&str>)
| 210 | |
| 211 | /// Match an `OpenShell` SSH forward by proxy ownership and outer SSH args. |
| 212 | fn 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)] |
no test coverage detected