use std::{borrow::Cow, path::Path};
use crate::AuthMethod;
#[derive(Clone, Debug, PartialEq)]
pub struct JumpHostAuthParams<'auth> {
pub user_name: Cow<'auth, str>,
pub auth_method: AuthMethod<'auth>,
}
impl<'auth> JumpHostAuthParams<'auth> {
pub fn key_pair(
user_name: Cow<'auth, str>,
private_key: Cow<'auth, Path>,
passphrase: Option<Cow<'auth, str>>,
) -> Self {
Self {
user_name,
auth_method: AuthMethod::KeyPair {
private_key,
passphrase,
},
}
}
pub fn password(user_name: Cow<'auth, str>, password: Cow<'auth, str>) -> Self {
Self {
user_name,
auth_method: AuthMethod::Password { password },
}
}
}