feat(bsr/ssh): Add open failure details to ChannelSummary (#3297)

pull/3298/head
Timothy Messier 3 years ago committed by GitHub
parent eaaaae5cce
commit fe7c87dc82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -5,6 +5,7 @@ package ssh
import (
"github.com/hashicorp/boundary/internal/bsr"
"golang.org/x/crypto/ssh"
)
// SessionProgram identifies the program running on this channel
@ -69,16 +70,25 @@ const (
FileTransferDownload FileTransferDirection = "download"
)
// OpenChannelError provides details if a channel was rejected.
// This will contain details from the SSH_MSG_CHANNEL_OPEN_FAILURE request
// that rejected the channel.
// See: https://www.rfc-editor.org/rfc/rfc4254#section-5.1
type OpenChannelError ssh.OpenChannelError
// ChannelSummary encapsulates data for a channel
// SessionProgram can only be one of the following: exec, shell, or subsystem
// SubsystemName is only populated if SessionProgram is subsystem
// ExecApplicationProgram is only populated if Channel Program is subsystem, and can be one of the following:
//
// scp, rsync, or unknown
//
// OpenFailure will be nil if the Channel was successfully opened.
type ChannelSummary struct {
ChannelSummary *bsr.ChannelSummary
SessionProgram SessionProgram
SubsystemName string
ExecProgram ExecApplicationProgram
FileTransferDirection FileTransferDirection
OpenFailure *OpenChannelError `json:",omitempty"`
}

Loading…
Cancel
Save