Documentation
¶
Overview ¶
Package sftpserver is an in-process SSH+SFTP server for hermetic tests (no Docker). It serves a temp directory with password auth and an ephemeral host key.
Note: pkg/sftp's Server is not a chroot. WithServerWorkingDirectory scopes *relative* paths to the temp root; absolute paths are still honored (tests use the absolute temp path). This is test-only code.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
Addr string // host:port, e.g. 127.0.0.1:54321
Root string // absolute temp dir served
User string // accepted username
Pass string // accepted password
HostKey ssh.PublicKey // for building a known_hosts entry
}
Server is a running test SFTP server. Shutdown is registered with t.Cleanup: it closes the listener and waits for in-flight connections.
Click to show internal directories.
Click to hide internal directories.