Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions cmd/ssh/native_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ import "strings"
//
// Allowed: client-side presentation flags that do not require server-side
// handling: -v/-vv/-vvv (verbosity), -t (force PTY), -T (no PTY), -q (quiet),
// -C (compression), -e <char> (escape character). Remote commands are passed
// through unchanged because the native server supports exec requests.
// -C (compression), -e <char> (escape character), -i <file> (identity file;
// added alongside the JIT-signed key since buildExecSSHArgs sets
// IdentitiesOnly=yes, which only restricts auth to explicitly configured
// identities, not to a single one). Remote commands are passed through
// unchanged because the native server supports exec requests.
func FilterForNativeMode(pt SSHPassthrough) (SSHPassthrough, []string) {
var allowed []string
var stripped []string
Expand Down Expand Up @@ -189,6 +192,8 @@ func nativeAllowedOption(tok string) (allowed bool, consumesNext bool) {
return true, false
case "-e": // escape character — value is consumed
return true, true
case "-i": // identity file — value is consumed
return true, true
}

return false, false
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/charmbracelet/lipgloss v1.1.0
github.com/creack/pty v1.1.24
github.com/fosrl/newt v1.15.0
github.com/fosrl/olm v1.8.0
github.com/fosrl/olm v1.8.2
github.com/mattn/go-isatty v0.0.20
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c
github.com/spf13/cobra v1.10.2
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f h1:Y/CXytFA4m6
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f/go.mod h1:vw97MGsxSvLiUE2X8qFplwetxpGLQrlU1Q9AUEIzCaM=
github.com/fosrl/newt v1.15.0 h1:WpL0whZM1FMjUe2Vy5jSH1bgbxm1O9k1qCyF/mqZT+s=
github.com/fosrl/newt v1.15.0/go.mod h1:l6kWoZPSaXT+ZRUjiyPgwflRqZWYaXpUj9oQ0sOPh4o=
github.com/fosrl/olm v1.8.0 h1:9X+3GRLZzVYXrdvJmL3czRuDK/RD7Y2BLbzonm7SpVM=
github.com/fosrl/olm v1.8.0/go.mod h1:r4GTKfN0sf5L6AQgStwx9lyURsNcog+faX/dn94JOLM=
github.com/fosrl/olm v1.8.2 h1:ipBqNsOKrbA1hMQwZS+VgPlTTs/he59MGdSFzHGe1P8=
github.com/fosrl/olm v1.8.2/go.mod h1:r4GTKfN0sf5L6AQgStwx9lyURsNcog+faX/dn94JOLM=
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=
Expand Down
Loading