Documentation
¶
Overview ¶
Package remote connects to headless servers through SSH or WebSocket. SSH authentication, config, agent and known_hosts belong to OpenSSH.
Index ¶
- 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 ¶
This section is empty.
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 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