aboutsummaryrefslogtreecommitdiff
path: root/examples/dbload
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2020-02-26 15:48:20 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2020-02-27 17:40:57 +0200
commit3b2d57c14f1ed207c79362b7136e3da4054ad817 (patch)
tree8f97331e65e3d6cc0d483fc0c3d11a2e668e33be /examples/dbload
parenta9a6567bac8ab7729c243b555e7fb3c4bb2c6e51 (diff)
downloadping903-3b2d57c14f1ed207c79362b7136e3da4054ad817.tar.gz
ping903-3b2d57c14f1ed207c79362b7136e3da4054ad817.tar.bz2
Implememt client-side basic auth
* lib/Makefile.am: Add base64.c * lib/base64.c: New file. * lib/basicauth.c: Move base64 support to a separate source. * lib/basicauth.h (base64_encode,base64_decode): New protos. * src/strsplit.c: New file. * src/Makefile.am (libping903_a_SOURCES): Add strsplit.c * src/defs.h (CRED_FILE_NAME): New macro. (ecalloc,strsplit,argcv_free): New proto. * src/mem.c (ecalloc): New function. * src/ping903.c (strsplit): Remove. (cf_auth): Use modified strsplit. * src/ping903q.c (http_query): Attempt to authenticate if basic auth is required. * examples/lib/LWP/Ping903.pm: New file. * examples/dbload: Use LWP::Ping903 * examples/inspect: Likewise. * examples/ipadd: Likewise. * examples/ipdel: Likewise.
Diffstat (limited to 'examples/dbload')
-rwxr-xr-xexamples/dbload4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/dbload b/examples/dbload
index 6b776e4..f3e9ec2 100755
--- a/examples/dbload
+++ b/examples/dbload
@@ -164,7 +164,7 @@ L<DBI>.
use strict;
use warnings;
use JSON;
-use LWP::UserAgent;
+use LWP::Ping903;
use DBI;
use Getopt::Long qw(:config gnu_getopt no_ignore_case);
use File::Spec;
@@ -238,7 +238,7 @@ my $json_text = JSON->new->encode({
'ip-list' => [ map { $_->[0] } @$res ]
});
-my $ua = new LWP::UserAgent;
+my $ua = new LWP::Ping903;
my $response = $ua->post("$baseurl/config/ip-list",
'Content-Type' => 'application/json',

Return to:

Send suggestions and report system problems to the System administrator.