Skip to content
This repository has been archived by the owner on Oct 2, 2022. It is now read-only.
/ backend Public archive
generated from ContainerSSH/library-template

Container backend abstraction library for ContainerSSH

License

Notifications You must be signed in to change notification settings

ContainerSSH/backend

ContainerSSH - Launch Containers on Demand

ContainerSSH Backend Library

⚠⚠⚠ 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.

Using this library

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.