sshclient

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package sshclient owns the fixed system OpenSSH process, terminal proxy, and push-only local clipboard upload lifecycle for pips ssh.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalid means public or hidden bridge input violated the fixed contract.
	ErrInvalid = errors.New("coding ssh client: invalid input")
	// ErrUnavailable means a trusted fixed OpenSSH executable or bridge is unavailable.
	ErrUnavailable = errors.New("coding ssh client: unavailable")
	// ErrTerminal means the local PTY or terminal lifecycle failed.
	ErrTerminal = errors.New("coding ssh client: terminal failure")
)

Functions

func DecodeVersion

func DecodeVersion(value string) (string, error)

DecodeVersion validates a canonical base64url build-version token.

func DecodeWorkspace

func DecodeWorkspace(value string) (string, error)

DecodeWorkspace validates a canonical base64url remote Workspace token.

func EncodeVersion

func EncodeVersion(value string) (string, error)

EncodeVersion returns the canonical base64url token used in remote argv.

func EncodeWorkspace

func EncodeWorkspace(value string) (string, error)

EncodeWorkspace returns the canonical base64url token used in remote argv.

func Run

Run reports that the SSH terminal bridge is unavailable on this platform.

func ValidateDestination

func ValidateDestination(value string) error

ValidateDestination accepts a bounded ASCII SSH destination/config alias but no option-shaped or shell-bearing text.

func ValidateRequest

func ValidateRequest(request Request) error

ValidateRequest checks all values before any filesystem or process access.

func ValidateWorkspace

func ValidateWorkspace(value string) error

ValidateWorkspace accepts only a canonical dot or absolute POSIX remote path.

Types

type ExitError

type ExitError struct {
	Code int
}

ExitError preserves the OpenSSH/remote command exit status for the CLI.

func (*ExitError) Error

func (e *ExitError) Error() string

func (*ExitError) ExitCode

func (e *ExitError) ExitCode() int

ExitCode returns the process status reported by OpenSSH.

type ImageClipboard

type ImageClipboard interface {
	ReadImage(context.Context) ([]byte, error)
}

ImageClipboard is the local, push-only clipboard capability used by Ctrl+V.

type InputFilter

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

InputFilter forwards terminal bytes while converting Ctrl+V outside a bracketed paste into local upload requests.

func (*InputFilter) Flush

func (f *InputFilter) Flush() ([]byte, int)

Flush releases any partial escape sequence at end of input.

func (*InputFilter) Push

func (f *InputFilter) Push(input []byte) ([]byte, int)

Push consumes one arbitrary input chunk and returns forwarded bytes plus the number of explicit local image-paste requests it contained.

type Options

type Options struct {
	Request     Request
	Input       io.Reader
	Output      io.Writer
	ErrorOutput io.Writer
	Environment []string
	Clipboard   ImageClipboard
}

Options are the bounded process resources for one interactive SSH session.

type Request

type Request struct {
	Destination string
	Workspace   string
	Version     string
	Nonce       string
}

Request is one validated remote Pips invocation.

Jump to

Keyboard shortcuts

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