Documentation
¶
Overview ¶
Package testsshd is an in-process sshd so worker venues are testable without a network, a credential or a second machine; only OpenSSH's own config surface is missing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateKey ¶
GenerateKey returns one fresh ed25519 key in each form a test needs.
Types ¶
type Server ¶
type Server struct {
URL string
Root string
HostKey ssh.PublicKey
Identity string
KnownHosts string
Execs atomic.Int64
// Must stay zero: OpenSSH ignores env requests without AcceptEnv, so a venue relying on them would pass here and fail in production.
EnvRequests atomic.Int64
StreamLocals atomic.Int64
// contains filtered or unexported fields
}
Server is a real sshd in every way a venue can observe: key auth, exec through a shell, exit-status, streamlocal.
func New ¶
New accepts only the generated client key, and its URL names that key and the known_hosts holding this server's.
func NewWithConfig ¶
NewWithConfig serves config, whose auth and host key the caller chose; hostKey is the public half it added.
func (*Server) Dial ¶
Dial is an ssh client authenticated as New's generated key, closed with the test.
func (*Server) URLWithHostKeyPin ¶
URLWithHostKeyPin pins this server's actual key, which must be accepted.