⚠⚠⚠ Deprecated: ⚠⚠⚠
This repository is deprecated in favor of libcontainerssh for ContainerSSH 0.5.
This library handles SSH requests and routes them to a container or other backends.
This library can be used in conjunction with the sshserver to route SSH connections to containers.
You can create a new backend handler like this:
handler, err := backend.New(
config,
logger,
loggerFactory,
authBehavior,
)
This method accepts the following parameters:
config
: The AppConfig
struct from the configuration library. This is needed because this library performs a call to the config server if configured to fetch a connection-specific information.
logger
: This variable is a logger from the log library.
loggerFactory
: This is a logger factory used by the backend to create a logger for the instantiated backends after fetching the connection-specific configuration.
authBehavior
: This variable can contain one of sshserver.AuthResponseSuccess
, sshserver.AuthResponseFailure
, or sshserver.AuthResponseUnavailable
to indicate how the backend should react to authenticatio requests. Normally, this can be set to sshserver.AuthResponseUnavailable
since the auth integration library will take care of the authentication.
The handler can be passed to the sshserver or to another overlay as a backend, for example auth integration.