put: report through the view and ask the host-key question through the Prompter

put() loses its MultiProgress parameter: the summary, pre-flight and
connection spinners become view messages, the per-file SFTP transfer
reports determinate progress through view.progress (upload_file takes
a byte-count callback instead of an indicatif bar), and the display is
released through view.suspend on every exit path. The hardcoded
trust-on-first-use prompt in the SSH host-key verification becomes the
Prompter::accept_host_key port (fail-closed by default; the terminal
prompter prints the authenticity banner and confirms), so a remote
frontend can surface its own host-key dialog.
This commit is contained in:
2026-09-18 20:42:17 +02:00
parent bb76e41908
commit 54cb04ba27
6 changed files with 62 additions and 93 deletions
+9
View File
@@ -147,6 +147,15 @@ pub trait Prompter: Send + Sync {
) -> Result<String, Box<dyn Error>> {
Ok(default.to_string())
}
/// Ask whether to accept and store an unverified SSH host key (trust on
/// first use): `host` is the display form (`host` or `[host]:port`),
/// `key_type` the key type name ("ssh-ed25519", ...) and `fingerprint`
/// the human-readable digest. Fail-closed: implementations that cannot
/// ask anyone answer `false`, refusing the connection.
fn accept_host_key(&self, _host: &str, _key_type: &str, _fingerprint: &str) -> bool {
false
}
}
/// Inert view and prompter: drops every event and answers every question