bssh/ssh/client/config.rs
1// Copyright 2025 Lablup Inc. and Jeongkyu Shin
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15use crate::ssh::known_hosts::StrictHostKeyChecking;
16use crate::ssh::tokio_client::SshConnectionConfig;
17use std::path::Path;
18
19/// Configuration for SSH connection and command execution
20#[derive(Clone)]
21pub struct ConnectionConfig<'a> {
22 pub key_path: Option<&'a Path>,
23 pub strict_mode: Option<StrictHostKeyChecking>,
24 pub use_agent: bool,
25 pub use_password: bool,
26 #[cfg(target_os = "macos")]
27 pub use_keychain: bool,
28 pub timeout_seconds: Option<u64>,
29 pub connect_timeout_seconds: Option<u64>,
30 pub jump_hosts_spec: Option<&'a str>,
31 /// SSH keepalive / inactivity settings. `None` falls back to defaults.
32 pub ssh_connection_config: Option<&'a SshConnectionConfig>,
33}