Documentation ¶
Index ¶
- Variables
- func AuthenticationMiddleware(sh ssh.Handler) ssh.Handler
- func CommandMiddleware(sh ssh.Handler) ssh.Handler
- func ContextMiddleware(cfg *config.Config, dbx *db.DB, datastore store.Store, be *backend.Backend, ...) func(ssh.Handler) ssh.Handler
- func LoggingMiddleware(sh ssh.Handler) ssh.Handler
- func SessionHandler(s ssh.Session) *tea.Program
- type SSHServer
- func (s *SSHServer) Close() error
- func (s *SSHServer) KeyboardInteractiveHandler(ctx ssh.Context, _ gossh.KeyboardInteractiveChallenge) bool
- func (s *SSHServer) ListenAndServe() error
- func (s *SSHServer) PublicKeyHandler(ctx ssh.Context, pk ssh.PublicKey) (allowed bool)
- func (s *SSHServer) Serve(l net.Listener) error
- func (s *SSHServer) Shutdown(ctx context.Context) error
- type UI
Constants ¶
This section is empty.
Variables ¶
var ErrPermissionDenied = fmt.Errorf("permission denied")
ErrPermissionDenied is returned when a user is not allowed connect.
Functions ¶
func AuthenticationMiddleware ¶
AuthenticationMiddleware handles authentication.
func CommandMiddleware ¶
CommandMiddleware handles git commands and CLI commands. This middleware must be run after the ContextMiddleware.
func ContextMiddleware ¶
func ContextMiddleware(cfg *config.Config, dbx *db.DB, datastore store.Store, be *backend.Backend, logger *log.Logger) func(ssh.Handler) ssh.Handler
ContextMiddleware adds the config, backend, and logger to the session context.
func LoggingMiddleware ¶
LoggingMiddleware logs the ssh connection and command.
Types ¶
type SSHServer ¶
type SSHServer struct {
// contains filtered or unexported fields
}
SSHServer is a SSH server that implements the git protocol.
func NewSSHServer ¶
NewSSHServer returns a new SSHServer.
func (*SSHServer) KeyboardInteractiveHandler ¶
func (s *SSHServer) KeyboardInteractiveHandler(ctx ssh.Context, _ gossh.KeyboardInteractiveChallenge) bool
KeyboardInteractiveHandler handles keyboard interactive authentication. This is used after all public key authentication has failed.
func (*SSHServer) ListenAndServe ¶
ListenAndServe starts the SSH server.
func (*SSHServer) PublicKeyHandler ¶
PublicKeyAuthHandler handles public key authentication.