ssh

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: MIT Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrPermissionDenied = fmt.Errorf("permission denied")

ErrPermissionDenied is returned when a user is not allowed connect.

Functions

func AuthenticationMiddleware

func AuthenticationMiddleware(sh ssh.Handler) ssh.Handler

AuthenticationMiddleware handles authentication.

func CommandMiddleware

func CommandMiddleware(sh ssh.Handler) ssh.Handler

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

func LoggingMiddleware(sh ssh.Handler) ssh.Handler

LoggingMiddleware logs the ssh connection and command.

func SessionHandler

func SessionHandler(s ssh.Session) *tea.Program

SessionHandler is the soft-serve bubbletea ssh session handler. This middleware must be run after the ContextMiddleware.

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

type UI

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

UI is the main UI model.

func NewUI

func NewUI(c common.Common, initialRepo string) *UI

NewUI returns a new UI model.

func (*UI) FullHelp

func (ui *UI) FullHelp() [][]key.Binding

FullHelp implements help.KeyMap.

func (*UI) Init

func (ui *UI) Init() tea.Cmd

Init implements tea.Model.

func (*UI) IsFiltering

func (ui *UI) IsFiltering() bool

IsFiltering returns true if the selection page is filtering.

func (*UI) SetSize

func (ui *UI) SetSize(width, height int)

SetSize implements common.Component.

func (*UI) ShortHelp

func (ui *UI) ShortHelp() []key.Binding

ShortHelp implements help.KeyMap.

func (*UI) Update

func (ui *UI) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update implements tea.Model.

func (*UI) View

func (ui *UI) View() string

View implements tea.Model.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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