⚠⚠⚠ Deprecated: ⚠⚠⚠
This repository is deprecated in favor of libcontainerssh for ContainerSSH 0.5.
This library provides integration between the sshserver library and the auth library
This library can be used to provide an authenticating overlay for ContainerSSH. It stacks well with other libraries. To use it you must first call the authintegration.New() method. This method has three parameters:
authClientis an authentication client from the auth library.backendis another implementation of theHandlerinterface from the sshserver library.behaviorinfluences when the backend is called for authentication purposes.BehaviorNoPassthroughmeans that the backend will not be used for authentication, only for getting further handlers.BehaviorPassthroughOnFailurewill give the backend an additional chance to authenticate the user if the authentication server returns a failure.BehaviorPassthroughOnSuccesspasses the credentials to the backend for additional checks of an already verified successful authentication.BehaviorPassthroughOnUnavailablepasses the authentication to the backend as a fallback if the authentication server failed to return a valid response.
For example:
handler := authintegration.New(
auth.ClientConfig{
URL: "http://localhost:8080"
Password: true,
PubKey: false,
},
otherHandler,
logger,
authintegration.BehaviorNoPassthrough,
)You can then use the handler to launch an SSH server:
server, err := sshserver.New(
cfg,
handler,
logger,
)