Documentation ¶
Overview ¶
Package connector defines methods for authentication and sessions handles to SSH when it is running in connector mode.
Connector mode means that the SSH's server runs in the host machine, but redirect the IO to a specific docker container, maning its authentication through the container's "/etc/passwd", "/etc/shadow" and etc.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrUserNotFound = errors.New("user not found on context")
Functions ¶
This section is empty.
Types ¶
type Authenticator ¶
type Authenticator struct {
// contains filtered or unexported fields
}
Authenticator implements the Authenticator interface when the server is running in connector mode.
func NewAuthenticator ¶
func NewAuthenticator(api client.Client, docker dockerclient.APIClient, authData *models.DeviceAuthResponse, container *string) *Authenticator
NewAuthenticator creates a new instance of Authenticator for the connector mode.
type Mode ¶ added in v0.14.0
type Mode struct { Authenticator Sessioner }
type Sessioner ¶
type Sessioner struct {
// contains filtered or unexported fields
}
Sessioner implements the Sessioner interface when the server is running in connector mode.
func NewSessioner ¶
func NewSessioner(container *string, docker dockerclient.APIClient) *Sessioner
NewSessioner creates a new instance of Sessioner for the connector mode. The container is a pointer to a string because when the server is created, we don't know the device name yet, that is set later.
func (*Sessioner) Exec ¶
Exec handles the SSH's server exec session when server is running in connector mode.
func (*Sessioner) Heredoc ¶
Heredoc handles the server's SSH heredoc session when server is running in connector mode.
heredoc is special block of code that contains multi-line strings that will be redirected to a stdin of a shell. It request a shell, but doesn't allocate a pty.