mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
feat: add GPG forwarding to coder ssh (#5482)
This commit is contained in:
+11
-2
@@ -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...)
|
||||
|
||||
Reference in New Issue
Block a user