Documentation
¶
Index ¶
Constants ¶
const ( CauseExited = "exited" // the command ended on its own; the status is its own CauseStopped = "stopped" // upterm session stop CauseSignaled = "signaled" // the daemon received a signal and shut down, or the command was killed by one on its own CauseCanceled = "canceled" // the daemon's run was cancelled CauseJoinTimeout = "join_timeout" // no guest joined within the join timeout; status 0 )
const ( // host HostSSHClientVersion = "SSH-2.0-upterm-host-client" HostSSHServerVersion = "SSH-2.0-upterm-host-server" HostAdminSocketEnvVar = "UPTERM_ADMIN_SOCKET" HostSessionNameEnvVar = "UPTERM_SESSION_NAME" // client ClientSSHClientVersion = "SSH-2.0-upterm-client-client" AttachSSHClientVersion = "SSH-2.0-upterm-attach" AttachInteractiveEnvVar = "UPTERM_ATTACH_INTERACTIVE" // server ServerSSHServerVersion = "SSH-2.0-uptermd" ServerServerInfoRequestType = "upterm-server-info@upterm.dev" ServerCreateSessionRequestType = "upterm-create-session@upterm.dev" // header HeaderUptermClientVersion = "Upterm-Client-Version" // misc OpenSSHKeepAliveRequestType = "keepalive@openssh.com" SSHCertExtension = "upterm-auth-request" EventClientJoined = "client-joined" EventClientLeft = "client-left" // Forwarding presence is visible, but does not qualify as a first guest join. EventForwardingClientJoined = "forwarding-client-joined" )
const ( // BannerNoHostFormat is sent, with the session ID, when no host is // connected for the session. join matches it by BannerNoHostPrefix. BannerNoHostFormat = "upterm: no host is connected for session %s right now. " + "If it's reconnecting, try again once it's back; on some relays the host then has a new command to share. " + "Otherwise it may have ended, or the ID may be wrong.\n" BannerNoHostPrefix = "upterm: no host is connected for session " // BannerLookupFailed is sent when the relay's session store failed. BannerLookupFailed = "upterm: the relay can't look up sessions right now. Try again shortly.\n" // The messages of a rejected session channel, when the relay completed a // guest's handshake and then failed upstream (server/sshstock.go, // upstreamFailureReason). UpstreamAuthFailed = "ssh: unable to authenticate with the upstream" UpstreamHostKeyMismatch = "ssh: host key mismatch" // The next hop's verdict, kept: the relay node that receives the session // node's banner turns it into one of these. A node that predates these // verdicts reports UpstreamAuthFailed instead, which therefore stays // ambiguous: "refused, or no session". Nodes nearer the guest forward a // converted verdict unchanged, older ones included. UpstreamNoHost = "upstream has no session" UpstreamLookupFailed = "upstream can't look up sessions" UpstreamKeyRefused = "upstream refused the key" // HopBannerKeyRefused is what the node holding a session sends another // relay node, never a guest, when it refuses the key that node presents. // It is read only by relays; no person sees it. HopBannerKeyRefused = "upterm-hop: key refused\n" // JoinSSHClientVersion is upterm join's SSH version string. The relay // treats anything but the exact HostSSHClientVersion as a guest. JoinSSHClientVersion = "SSH-2.0-upterm-join" )
The relay's guest-facing texts. upterm join matches them, so each is a wire contract: change one only together with join's classifier, and the golden test in relay_test.go.
const SessionEndReplyBound = time.Second
SessionEndReplyBound is how long the daemon waits for the reply.
const SessionEndRequestType = "session-end@upterm.dev"
SessionEndRequestType is a global request the daemon sends a host-door client (the host's own terminal, upterm attach) when a session ends, just before that client's exit-status, with want-reply true. The daemon waits for the reply (bounded by SessionEndReplyBound) before sending the status, so a client that answers has the cause before the status arrives, whatever the status (0 included). A client from before this request replies false at once -- x/crypto's ssh.Client answers every global request it is sent that way (handleGlobalRequests) -- and sees only the status, as today. Guests are never sent it.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SessionEnd ¶ added in v0.39.0
type SessionEnd struct {
Cause string // one of the Cause* values
// For CauseSignaled, the signal's SSH name without "SIG" ("TERM"), or,
// for a signal with no name, its number in decimal ("40"); else "".
Signal string
}
The payload, as ssh.Marshal encodes it. Fields are only ever appended to it, never reordered or removed, and a reader ignores whatever follows the fields it knows: x/crypto's Unmarshal refuses trailing data, so a reader decodes into its own struct with these fields first and a final `ssh:"rest"` field, not into this one.