diff --git a/yama/src/bin/yama.rs b/yama/src/bin/yama.rs index faa217f..ddb644c 100644 --- a/yama/src/bin/yama.rs +++ b/yama/src/bin/yama.rs @@ -1025,16 +1025,8 @@ async fn set_up_connection( let remote_path = line.trim().to_owned(); line.clear(); - println!( - "Enter password, or blank if not required (due to use of key authentication):" - ); - stdin_br.read_line(&mut line).await?; - let password = line.trim().to_owned(); - line.clear(); - Ok(PileConnectionScheme::Sftp { user_at_host, - password, directory: remote_path, }) } diff --git a/yama/src/pile_connector.rs b/yama/src/pile_connector.rs index a229bfd..747a093 100644 --- a/yama/src/pile_connector.rs +++ b/yama/src/pile_connector.rs @@ -5,7 +5,7 @@ use yama_wormfile::boxed::BoxedWormFileProvider; use yama_wormfile_fs::LocalWormFilesystem; use yama_wormfile_sftp::SftpWormFilesystem; -#[derive(Clone, Serialize, Deserialize, Hash)] +#[derive(Clone, Serialize, Deserialize, Debug, Hash)] #[serde(tag = "scheme")] pub enum PileConnectionScheme { #[serde(rename = "local")] @@ -13,8 +13,6 @@ pub enum PileConnectionScheme { #[serde(rename = "sftp")] Sftp { user_at_host: String, - // TODO Should probably not serialise the password - password: String, directory: String, }, #[serde(rename = "s3")] @@ -40,18 +38,12 @@ impl PileConnectionScheme { } PileConnectionScheme::Sftp { user_at_host, - password, directory, - } => { - if !password.is_empty() { - bail!("SFTP passwords not supported at the moment."); - } - Ok(BoxedWormFileProvider::new( - SftpWormFilesystem::new(user_at_host, directory) - .await - .context("Failed SFTP connection")?, - )) - } + } => Ok(BoxedWormFileProvider::new( + SftpWormFilesystem::new(user_at_host, directory) + .await + .context("Failed SFTP connection")?, + )), PileConnectionScheme::S3 { .. } => { //S3WormFilesystem::new() todo!()