Remove pretend password support for SFTP
This commit is contained in:
parent
ecda1e5359
commit
1c2d7957ee
@ -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,
|
||||
})
|
||||
}
|
||||
|
@ -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(
|
||||
} => Ok(BoxedWormFileProvider::new(
|
||||
SftpWormFilesystem::new(user_at_host, directory)
|
||||
.await
|
||||
.context("Failed SFTP connection")?,
|
||||
))
|
||||
}
|
||||
)),
|
||||
PileConnectionScheme::S3 { .. } => {
|
||||
//S3WormFilesystem::new()
|
||||
todo!()
|
||||
|
Loading…
Reference in New Issue
Block a user