SoTest: read credentials from file
[?]
Apr 22, 2020, 10:05 AM
4VVBCVPDQCKMBD5O5QRYXVV7JL5ULRMXIG23JNTDVSLB2YCH4EPACDependencies
- [2]
FW4PJE5KAdd SoTest plugin
Change contents
- replacement in src/lib/Hydra/Plugin/SoTest.pm at line 33
username = Aladdinpassword = OpenSesameauthfile = /var/lib/hydra/sotest.auth # file containing «username»:«password» - replacement in src/lib/Hydra/Plugin/SoTest.pm at line 61
die 'SoTest username and password must be specified'unless ( defined $sotest->{username} and defined $sotest->{password} );die 'SoTest authfile is not specified'unless ( defined $sotest->{authfile} );open( my $authfile, "<", $sotest->{authfile} )or die "Cannot open Sotest authfile \${\$sotest->{authfile}}";close($authfile); - edit in src/lib/Hydra/Plugin/SoTest.pm at line 97
my $sotest_username;my $sotest_password; - replacement in src/lib/Hydra/Plugin/SoTest.pm at line 100
_logIfDebug 'post job for ', $sotest_name;my $authfile;open( $authfile, "<", $sotest->{authfile} )or die "Cannot open Sotest authfile \${\$sotest->{authfile}}";while (<$authfile>) {if ( $_ =~ /(.+):(.+)/m ) {$sotest_username = $1;$sotest_password = $2;}}close($authfile);die "failed to parse username and password from ${\$sotest->{authfile}}"unless ( defined $sotest_username and defined $sotest_password );_logIfDebug "post job for $sotest_name"; - replacement in src/lib/Hydra/Plugin/SoTest.pm at line 119
$ua->default_headers->authorization_basic( $sotest->{username},$sotest->{password} );$ua->default_headers->authorization_basic( $sotest_username,$sotest_password );