sshserver

package
v0.0.0-...-dc6993b Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const AuthorizedKeyAnnotation = "ssh.barpilot.io/publickey"
View Source
const CommandAnnotation = "ssh.barpilot.io/command"
View Source
const PrefixCommandAnnotation = "ssh.barpilot.io/prefix-command"

Variables

View Source
var ErrDestination = errors.New("can't find destination")

Functions

This section is empty.

Types

type RateLimiter

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

func NewRateLimiter

func NewRateLimiter() *RateLimiter

func (*RateLimiter) ConnCallback

func (r *RateLimiter) ConnCallback() ssh.ConnCallback

func (*RateLimiter) ConnectionFailedCallback

func (r *RateLimiter) ConnectionFailedCallback() ssh.ConnectionFailedCallback

type Server

type Server struct {
	Server *gssh.Server

	Scheme *runtime.Scheme
	Client client.Client
	Config *rest.Config

	Logger *slog.Logger
}

func New

func New(addr string, config *rest.Config, l *slog.Logger, hostKey any) (*Server, error)

func (Server) PasswordHandler

func (s Server) PasswordHandler() ssh.PasswordHandler

func (Server) PublicKeyHandler

func (s Server) PublicKeyHandler() ssh.PublicKeyHandler

func (Server) RemotecommandExec

func (s Server) RemotecommandExec(config *rest.Config, pod, namespace string, cmd []string, pty bool) (remotecommand.Executor, error)

func (Server) SftpHandler

func (s Server) SftpHandler() ssh.SubsystemHandler

func (Server) SshHandler

func (s Server) SshHandler() ssh.Handler

type User

type User struct {
	PublicKey ssh.PublicKey
	User      string
	Pod       string
	Namespace string
}

Jump to

Keyboard shortcuts

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