feat: [WIP] implement scp by bgo
This commit is contained in:
@@ -340,12 +340,16 @@ func (a *App) runSaveRemotePipeline(pngBytes []byte) error {
|
||||
"auth_method", cfg.SSH.AuthMethod, "png_size", len(pngBytes))
|
||||
|
||||
// Select the uploader by auth method: Kerberos delegates to the system
|
||||
// ssh/scp binaries (reusing the kinit credential cache), while builtin
|
||||
// uses the in-process Go SSH client.
|
||||
// ssh/scp binaries (reusing the kinit credential cache), bgo delegates to
|
||||
// the internal `bgo scp` client (under a PTY), while builtin uses the
|
||||
// in-process Go SSH client.
|
||||
var uploader application.SSHUploader
|
||||
if cfg.SSH.IsKerberos() {
|
||||
switch {
|
||||
case cfg.SSH.IsKerberos():
|
||||
uploader = sshpkg.NewKerberosUploader(cfg.SSH)
|
||||
} else {
|
||||
case cfg.SSH.IsBgo():
|
||||
uploader = sshpkg.NewBgoUploader(cfg.SSH)
|
||||
default:
|
||||
uploader = sshpkg.NewUploader(cfg.SSH)
|
||||
}
|
||||
|
||||
@@ -467,6 +471,15 @@ func (a *App) TestSSHConnection(cfg domain.SSHConfig) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
// bgo manages its own auth; we can only confirm the binary is installed
|
||||
// and resolvable (a real transfer would need a live remote + PTY).
|
||||
if cfg.IsBgo() {
|
||||
if err := sshpkg.TestBgoConnection(a.ctx, cfg); err != nil {
|
||||
slog.Error("RPC TestSSHConnection (bgo) failed", "err", err)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
if err := sshpkg.TestConnection(a.ctx, cfg); err != nil {
|
||||
slog.Error("RPC TestSSHConnection failed", "err", err)
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user