Documentation
¶
Overview ¶
Package remote connects to headless servers through SSH or WebSocket. SSH authentication, config, agent and known_hosts belong to OpenSSH.
Index ¶
- Constants
- func ConnectWebSocket(ctx context.Context, target WebSocketTarget, progress func(string)) (io.ReadWriteCloser, error)
- func RunAskpass() (bool, error)
- func ValidateToken(token string) error
- func WithPrompt(ctx context.Context, prompt Prompt) context.Context
- type AuthenticationPrompt
- type Connector
- type Platform
- type Prompt
- type Target
- type WebSocketTarget
Constants ¶
const OutputChannelName = "Remote Development"
Variables ¶
This section is empty.
Functions ¶
func ConnectWebSocket ¶
func ConnectWebSocket(ctx context.Context, target WebSocketTarget, progress func(string)) (io.ReadWriteCloser, error)
func RunAskpass ¶
RunAskpass handles OpenSSH's helper invocation before the GUI starts. Only this short-lived helper writes the answer to stdout, which SSH owns.
func ValidateToken ¶
ValidateToken restricts tokens to visible ASCII so they travel unchanged in the Authorization header. Tokens are never included in URLs or diagnostics.
Types ¶
type AuthenticationPrompt ¶
AuthenticationPrompt distinguishes secrets from explicit yes/no decisions.
type Connector ¶
type Connector struct {
Output io.Writer
HTTP *http.Client // Nil uses http.DefaultClient with the connection context.
Executable string // Empty selects ssh from PATH.
Version string // Empty selects the current build version.
ReleaseURL string // Empty selects GitHub release downloads.
ServerDirectory string // resources/servers/<os>-<arch>/pencode-server.
LocalServer string // Adjacent native standalone binary.
}
func (Connector) Connect ¶
func (c Connector) Connect(ctx context.Context, target Target, progress func(string)) (conn io.ReadWriteCloser, err error)
Connect authenticates once and returns the same encrypted stdio stream after bootstrap. Passwords are requested through askpass and never retained here.
type Prompt ¶
type Prompt func(ctx context.Context, prompt AuthenticationPrompt) (string, error)
Prompt runs outside the UI thread and must return when ctx is canceled.
type Target ¶
type Target struct {
Host string `json:"host"`
IdentityFile string `json:"identityFile,omitempty"`
ConfigFile string `json:"configFile,omitempty"`
ServerBinary string `json:"serverBinary,omitempty"` // Explicit local transfer source.
ServerRoot string `json:"serverRoot,omitempty"` // Absolute POSIX path on the remote host.
Port uint16 `json:"port,omitempty"`
}
type WebSocketTarget ¶
func (WebSocketTarget) Validate ¶
func (t WebSocketTarget) Validate() error