1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//! The SFTP plugin enables secure file sharing with SFTP.
use serde::{Deserialize, Serialize};
#[cfg(not(feature = "std"))]
use alloc::{string::String, vec::Vec};
/// This packet contains SFTP login information.
///
/// <https://invent.kde.org/network/kdeconnect-meta/blob/master/protocol.md#kdeconnectsftp>
#[derive(Serialize, Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
pub struct SftpPacket {
/// An error message.
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(default)]
pub error_message: Option<String>,
/// The host address.
pub ip: String,
/// The host port.
pub port: u16,
/// The user. Currently always kdeconnect.
pub user: String,
/// The one-time password. :warning: Deprecated: use private key authentication via the TLS certificate.
pub password: String,
/// The base path of the remote server. This should generally only be used as a fallback if the multiPaths field is missing.
pub path: String,
/// An ordered list of paths for the remote server. Usually contains at least a 'root' directory and a path the the camera folder, but may contain additional paths to external storage devices.
pub multi_paths: Vec<String>,
/// An ordered list of names associated with the paths in multiPaths, in the same order.
pub path_names: Vec<String>,
}
/// This packet is a request to start SFTP.
///
/// <https://invent.kde.org/network/kdeconnect-meta/blob/master/protocol.md#kdeconnectsftprequest>
#[derive(Serialize, Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
pub struct SftpRequestPacket {
/// A request for the remote device to prepare for SFTP and respond with a kdeconnect.sftp packet.
start_browsing: bool,
}