Skip to main content

Crate faucet_common_sftp

Crate faucet_common_sftp 

Source
Expand description

§faucet-common-sftp

Shared SFTP connection configuration and connect helper for the faucet-source-sftp and faucet-sink-sftp connectors.

The single entry point is connect, which opens an SSH transport (password or private-key auth), verifies the server host key against the configured HostKeyPolicy, opens the sftp subsystem, and hands back a ready SftpSession. Both the source and the sink build their session through this helper so auth, host-key handling, and error mapping stay consistent.

§Host-key verification

Man-in-the-middle protection is on by default. HostKeyPolicy defaults to AcceptNew (trust-on-first-use — record an unknown key, reject a changed one). Strict requires the key to already be present in known_hosts. Insecure disables verification entirely and must be selected explicitly.

§Secrets

SftpAuth has a hand-written Debug impl that never prints the password or key passphrase, so a Debug-formatted SftpConnectionConfig is safe to log.

Structs§

OpenFlags
Opening flags according to the specification
SftpConnectionConfig
Shared SFTP connection configuration.
SftpSession
High-level SFTP implementation for easy interaction with a remote file system. Contains most methods similar to the native filesystem

Enums§

HostKeyPolicy
How the server’s host key is verified during the SSH handshake.
SftpAuth
SFTP authentication method.

Constants§

DEFAULT_PORT
Default SSH port.

Functions§

connect
Open an SSH transport to the configured server, authenticate, verify the host key, and open the sftp subsystem.