diff --git a/src/filetransfer/params/aws_s3.rs b/src/filetransfer/params/aws_s3.rs index d053703..0c0ac97 100644 --- a/src/filetransfer/params/aws_s3.rs +++ b/src/filetransfer/params/aws_s3.rs @@ -1,14 +1,28 @@ +//! ## AWS S3 Parameters +//! +//! Defines the runtime connection parameters used to build AWS S3 and +//! S3-compatible remote filesystem clients. + /// Connection parameters for AWS S3 protocol #[derive(Debug, Clone)] pub struct AwsS3Params { + /// Target bucket name. pub bucket_name: String, + /// Target region. pub region: Option, + /// Optional custom endpoint URL. pub endpoint: Option, + /// Optional shared credentials profile. pub profile: Option, + /// Optional static access key. pub access_key: Option, + /// Optional static secret access key. pub secret_access_key: Option, + /// Optional security token for temporary credentials. pub security_token: Option, + /// Optional session token for temporary credentials. pub session_token: Option, + /// Whether to force path-style bucket addressing. pub new_path_style: bool, } diff --git a/src/filetransfer/params/kube.rs b/src/filetransfer/params/kube.rs index c9ac991..19a4e3c 100644 --- a/src/filetransfer/params/kube.rs +++ b/src/filetransfer/params/kube.rs @@ -1,22 +1,35 @@ +//! ## Kubernetes Parameters +//! +//! Defines the runtime parameters used to construct Kubernetes-backed file +//! transfer clients. + use remotefs_kube::Config; -/// Protocol params used by WebDAV +/// Protocol params used by Kubernetes connections. #[derive(Debug, Clone)] pub struct KubeProtocolParams { + /// Optional namespace for the default pod context. pub namespace: Option, + /// Optional Kubernetes API URL. pub cluster_url: Option, + /// Optional username override. pub username: Option, + /// Optional client certificate path. pub client_cert: Option, + /// Optional client key path. pub client_key: Option, } impl KubeProtocolParams { + /// Kubernetes connections do not use the shared password secret flow. pub fn set_default_secret(&mut self, _secret: String) {} + /// Kubernetes params never require the generic password prompt. pub fn password_missing(&self) -> bool { false } + /// Converts bookmark/runtime parameters into a `remotefs_kube` config. pub fn config(self) -> Option { if let Some(cluster_url) = self.cluster_url { let mut config = Config::new(cluster_url.parse().unwrap_or_default()); diff --git a/src/filetransfer/params/smb.rs b/src/filetransfer/params/smb.rs index 411eb3a..234ae21 100644 --- a/src/filetransfer/params/smb.rs +++ b/src/filetransfer/params/smb.rs @@ -1,13 +1,24 @@ +//! ## SMB Parameters +//! +//! Defines the runtime connection parameters used to build SMB remote +//! filesystem clients. + /// Connection parameters for SMB protocol #[derive(Debug, Clone)] pub struct SmbParams { + /// Hostname or address of the SMB server. pub address: String, #[cfg(posix)] + /// SMB service port used on POSIX platforms. pub port: u16, + /// Share name to mount. pub share: String, + /// Optional username. pub username: Option, + /// Optional password. pub password: Option, #[cfg(posix)] + /// Optional workgroup used on POSIX platforms. pub workgroup: Option, } diff --git a/src/filetransfer/params/webdav.rs b/src/filetransfer/params/webdav.rs index 9c8bec1..78b787d 100644 --- a/src/filetransfer/params/webdav.rs +++ b/src/filetransfer/params/webdav.rs @@ -1,16 +1,25 @@ +//! ## WebDAV Parameters +//! +//! Defines the runtime connection parameters used to build WebDAV clients. + /// Protocol params used by WebDAV #[derive(Debug, Clone)] pub struct WebDAVProtocolParams { + /// Base WebDAV endpoint URI. pub uri: String, + /// Username used for authentication. pub username: String, + /// Password used for authentication. pub password: String, } impl WebDAVProtocolParams { + /// Stores the shared secret as the active WebDAV password. pub fn set_default_secret(&mut self, secret: String) { self.password = secret; } + /// Returns whether the WebDAV password is currently missing. pub fn password_missing(&self) -> bool { self.password.is_empty() } diff --git a/src/utils/parser/credentials.rs b/src/utils/parser/credentials.rs index 4f382a1..b40394a 100644 --- a/src/utils/parser/credentials.rs +++ b/src/utils/parser/credentials.rs @@ -1,3 +1,8 @@ +//! ## Parser Credential Helpers +//! +//! Shared capture-group helpers used by parser submodules when extracting +//! credentials and required fields from regex matches. + pub(super) fn optional_capture(groups: ®ex::Captures<'_>, index: usize) -> Option { groups.get(index).map(|group| group.as_str().to_string()) } diff --git a/src/utils/parser/remote.rs b/src/utils/parser/remote.rs index 3e3fd22..f2e1724 100644 --- a/src/utils/parser/remote.rs +++ b/src/utils/parser/remote.rs @@ -1,3 +1,8 @@ +//! ## Parser Remote Helpers +//! +//! Implements protocol-specific parsing for remote connection strings while +//! keeping the public parser API stable. + use std::path::PathBuf; #[cfg(smb)]