latest changes
authorChris Sharp <csharp@georgialibraries.org>
Fri, 3 Feb 2023 18:45:09 +0000 (13:45 -0500)
committerChris Sharp <csharp@georgialibraries.org>
Mon, 6 Feb 2023 13:43:28 +0000 (08:43 -0500)
Open-ILS/src/perlmods/lib/OpenILS/Utils/RemoteAccount.pm

index 0b3e0cd..50a7700 100644 (file)
@@ -6,6 +6,7 @@ use OpenSRF::Utils::Logger qw/:logger/;
 use Data::Dumper;
 use IO::Pty;
 use Net::FTP;
+use Net::OpenSSH;
 use Net::SFTP::Foreign;
 use File::Temp;
 use File::Basename;
@@ -53,7 +54,7 @@ OpenILS::Utils::RemoteAccount - Encapsulate FTP, SFTP and SSH file transactions
 =head1 DESCRIPTION
 
 The Remote Account module attempts to transfer a file to/from a remote server.
-Either Net::FTP or Net::SSH2 is used.
+Net::FTP, Net::OpenSSH or Net::SFTP::Foreign is used.
 
 =head1 PARAMETERS
 
@@ -365,6 +366,13 @@ sub glob_parse {
 
 # Internal Mechanics
 
+sub _sftp {
+
+}
+
+sub _openssh {
+
+}
 
 #sub _ssh2 {
 #    my $self = shift;
@@ -425,20 +433,20 @@ sub glob_parse {
 #    }
 #    return;
 #}
-#
-#sub auth_ssh2_args {
-#    my $self = shift;
-#    my %auth_args = (
-#        privatekey => shift,
-#        publickey  => shift,
-#        rank => [qw/ publickey hostbased password /],
-#    );
-#    $self->remote_user     and $auth_args{username} = $self->remote_user    ;
-#    $self->remote_password and $auth_args{password} = $self->remote_password;
-#    $self->remote_host     and $auth_args{hostname} = $self->remote_host    ;
-#    return %auth_args;
-#}
-#
+
+sub auth_openssh_args {
+    my $self = shift;
+    my %auth_args = (
+        privatekey => shift,
+        publickey  => shift,
+        rank => [qw/ publickey hostbased password /],
+    );
+    $self->remote_user     and $auth_args{username} = $self->remote_user    ;
+    $self->remote_password and $auth_args{password} = $self->remote_password;
+    $self->remote_host     and $auth_args{hostname} = $self->remote_host    ;
+    return %auth_args;
+}
+
 #sub put_ssh2 {
 #    my $self = shift;
 #    my $keys = shift;    # could have many keypairs here