feat: add GPG forwarding to coder ssh (#5482)

This commit is contained in:
Dean Sheather
2023-01-06 01:52:19 -06:00
committed by GitHub
parent 59e919ab4a
commit f1fe2b5c06
12 changed files with 1051 additions and 22 deletions
+11 -2
View File
@@ -61,8 +61,9 @@ type WithFlags interface {
type Option func(*ptyOptions)
type ptyOptions struct {
logger *log.Logger
sshReq *ssh.Pty
logger *log.Logger
sshReq *ssh.Pty
setGPGTTY bool
}
// WithSSHRequest applies the ssh.Pty request to the PTY.
@@ -81,6 +82,14 @@ func WithLogger(logger *log.Logger) Option {
}
}
// WithGPGTTY sets the GPG_TTY environment variable to the PTY name. This only
// applies to non-Windows platforms.
func WithGPGTTY() Option {
return func(opts *ptyOptions) {
opts.setGPGTTY = true
}
}
// New constructs a new Pty.
func New(opts ...Option) (PTY, error) {
return newPty(opts...)