/usr/share/doc/libnet-z3950-simple2zoom-perl/examples/sru-auth is in libnet-z3950-simple2zoom-perl 1.04-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | #!/usr/bin/perl
#
# $Id: sru-auth,v 1.1 2007-08-21 12:21:56 mike Exp $
# In order to test the authentication feature of Simple2ZOOM, we need
# an authenticator script, accessible via HTTP. The simplest way to
# provide that is as a simple bit of HTML::Mason running under the
# conveniently available IRSpy distribution. Since this is only for
# testing, a hardwired user register is good enough.
use strict;
use warnings;
use CGI;
my %register = (
mike => "fish",
simon => "frog 123",
admin => "Tom&jErry",
);
my $cgi = new CGI();
my $user = $cgi->param('user');
my $pass = $cgi->param('pass');
if (defined $user && defined $pass && $register{$user} eq $pass) {
print $cgi->header();
print "OK\n";
warn "good";
} else {
print $cgi->header(-status => "401 Authorization Required"),
warn "bad";
}
|