Versions in this module Expand all Collapse all v0 v0.1.0 May 30, 2022 Changes in this version + type Auth struct + func NewAuth(fileManager FileReader, privateKeyManager PrivateKeyParser, ...) *Auth + func (a *Auth) BuildHostKeySigner() (ssh.Signer, error) + func (a *Auth) CheckPublicKeyValidity(username string, passedKey ssh.PublicKey) (bool, error) + type AuthorizedKeyManager struct + func NewAuthorizedKeyManager() AuthorizedKeyManager + func (AuthorizedKeyManager) CheckPublicKeyEqualsAuthorizedKey(publicKey ssh.PublicKey, authorizedKey ssh.PublicKey) bool + func (AuthorizedKeyManager) ParseAuthorizedKeys(authorizedKeysBytes []byte) ([]ssh.PublicKey, error) + type AuthorizedKeyParserChecker interface + CheckPublicKeyEqualsAuthorizedKey func(publicKey, authorizedKey ssh.PublicKey) bool + ParseAuthorizedKeys func(authorizedKeysBytes []byte) ([]ssh.PublicKey, error) + type AuthorizedUser struct + AuthorizedKeysFilePath string + UserName string + type FileReader interface + ReadFile func(filePath string) ([]byte, error) + type PTYManager struct + func NewPTYManager() PTYManager + func (PTYManager) SetWindowSize(f *os.File, width, height int) + type PTYWindowSizer interface + SetWindowSize func(f *os.File, width, height int) + type PrivateKeyManager struct + func NewPrivateKeyManager() PrivateKeyManager + func (PrivateKeyManager) ParsePrivateKey(privateKeyBytes []byte) (ssh.Signer, error) + type PrivateKeyParser interface + ParsePrivateKey func(privateKeyBytes []byte) (ssh.Signer, error) + type ServerAuther interface + BuildHostKeySigner func() (ssh.Signer, error) + CheckPublicKeyValidity func(username string, passedKey ssh.PublicKey) (bool, error) + type ServerBuilder struct + func NewServerBuilder(auth ServerAuther, listenAddr string) ServerBuilder + func (s ServerBuilder) Build() (*ssh.Server, error) + type Session struct + func NewSession(manager SessionExecShellManager) Session + func (s Session) Start(sshSession ssh.Session) + type SessionExecShellManager interface + ManageExec func(sshSession ssh.Session) error + ManageExecInDevEnv func(sshSession ssh.Session) error + ManageShell func(sshSession ssh.Session) error + ManageShellInDevEnv func(sshSession ssh.Session) error + ManageShellPTY func(sshSession ssh.Session) error + ManageShellPTYInDevEnv func(sshSession ssh.Session) error + type SessionManager struct + func NewSessionManager(userCommandBuilder UserCommandBuilder, ptyManager PTYWindowSizer) SessionManager + func (s SessionManager) ManageExec(sshSession ssh.Session) error + func (s SessionManager) ManageExecInDevEnv(sshSession ssh.Session) error + func (s SessionManager) ManageShell(sshSession ssh.Session) error + func (s SessionManager) ManageShellInDevEnv(sshSession ssh.Session) error + func (s SessionManager) ManageShellPTY(sshSession ssh.Session) error + func (s SessionManager) ManageShellPTYInDevEnv(sshSession ssh.Session) error + type UserCommandBuilder interface + Build func(args ...string) *exec.Cmd + BuildShell func() *exec.Cmd + BuildShellPTY func() *exec.Cmd + type UserCommandManager struct + func NewUserCommandManager(user *user.User) UserCommandManager + func (u UserCommandManager) Build(args ...string) *exec.Cmd + func (u UserCommandManager) BuildShell() *exec.Cmd + func (u UserCommandManager) BuildShellPTY() *exec.Cmd