ssh

package
v0.5.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2023 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SessionHandler

func SessionHandler(cfg *config.Config) bm.ProgramHandler

SessionHandler is the soft-serve bubbletea ssh session handler.

Types

type SSHServer

type SSHServer struct {
	// contains filtered or unexported fields
}

SSHServer is a SSH server that implements the git protocol.

func NewSSHServer

func NewSSHServer(ctx context.Context) (*SSHServer, error)

NewSSHServer returns a new SSHServer.

func (*SSHServer) Close

func (s *SSHServer) Close() error

Close closes the SSH server.

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

func (s *SSHServer) ListenAndServe() error

ListenAndServe starts the SSH server.

func (*SSHServer) Middleware

func (ss *SSHServer) Middleware(cfg *config.Config) wish.Middleware

Middleware adds Git server functionality to the ssh.Server. Repos are stored in the specified repo directory. The provided Hooks implementation will be checked for access on a per repo basis for a ssh.Session public key. Hooks.Push and Hooks.Fetch will be called on successful completion of their commands.

func (*SSHServer) PublicKeyHandler

func (s *SSHServer) PublicKeyHandler(ctx ssh.Context, pk ssh.PublicKey) (allowed bool)

PublicKeyAuthHandler handles public key authentication.

func (*SSHServer) Serve

func (s *SSHServer) Serve(l net.Listener) error

Serve starts the SSH server on the given net.Listener.

func (*SSHServer) Shutdown

func (s *SSHServer) Shutdown(ctx context.Context) error

Shutdown gracefully shuts down the SSH server.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL