Documentation
¶
Overview ¶
Package sshpool dials an instance's SSH endpoint with its stored credentials and reports how the presented host key relates to the pinned one. Nothing here writes to the database: pinning is the caller's decision, taken on the report this package returns.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrConnect = errors.New("could not connect to the SSH host")
ErrConnect marks a failure to reach the host or complete the handshake, as opposed to a fault in what qui stored: the caller answers the two differently, and only the first earns an unreadable pin its precedence.
Functions ¶
This section is empty.
Types ¶
type Capabilities ¶
type Capabilities struct {
SFTP bool
Statvfs bool
Hardlink bool
Limits bool
Exec bool
GNUUserland bool
}
Capabilities is what the server lets us do, probed read-only.
type Dialer ¶
type Dialer struct {
// contains filtered or unexported fields
}
Dialer opens one-shot SSH connections. There is no pool yet: every call dials, does its work and closes.
type MismatchError ¶
MismatchError reports that the host presented a key other than the expected one. Error prints fingerprints only, so the message is safe to log; the fields carry the keys for callers that need them.
func (*MismatchError) Error ¶
func (e *MismatchError) Error() string
type Report ¶
type Report struct {
Status Status
HostKey ssh.PublicKey
PinnedKey ssh.PublicKey // mismatch only
Capabilities *Capabilities // nil on mismatch and pin_unreadable: no session is opened
}
Report is the outcome of Test. A mismatch is a result, not a failure: the user has to see both keys to decide whether the host was re-keyed or replaced.
type Status ¶
type Status string
Status is how the host key the server presented relates to the stored pin.
const ( StatusUnpinned Status = "unpinned" StatusPinned Status = "pinned" StatusMismatch Status = "mismatch" // StatusPinUnreadable: the stored pin does not decrypt. The presented key // is reported so the user can replace the pin through the same heavy // confirmation a mismatch gets; nothing is trusted and nothing is probed. StatusPinUnreadable Status = "pin_unreadable" )