AIS-client
    
    
  
  
  
view release on metacpan or search on metacpan
use 5.006;
$VERSION = 0.07;
use Carp;
use DirDB 0.09; # or any other concurrent-access-safe
                # persistence abstraction
	        # that can store and retreive hash references
	        # and has a working DELETE method
	        #
	        # but if you change it, you'll also need to change
	        # the lines that refer to DirDB subsequently,
	        # including the tieing of %{"caller().'::AIS_STASH'}
sub miniget($$$$){
	my($HostName, $PortNumber, $Desired, $agent)  = @_;
	eval <<'ENDMINIGET';
	use Socket qw(:DEFAULT :crlf);
	$PortNumber ||= 80;
	$agent ||= "$ENV{SERVER_NAME}$ENV{SCRIPT_NAME}";
	my $iaddr	= inet_aton($HostName)	|| die "Cannot find host named $HostName";
It is expected that a subscription-based or otherwise access-controlled
AIS service might issue expiring capability keys which would have to be
listed as part of the agent string.
=item prefix
By default, C<AIS>, which means that AIS::client will store session
data (incliding identity, which is also available as
C<$AIS_STASH{identity}>) in subdirectories under a directory
called C<AIS_sessions> under the current directory
your script runs in.  This can be changed with the C<prefix> parameter:
  use AIS::client prefix => '.AIS'; # hide session directory
The prefix is also used as the prefix for the session cookie name,
which defaults to C<AIS_session>.
=item freq
By default, AIS::client will examine the session directory for stale
sessions approximately once every 2000 invocations.  Adjust this
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl test.pl'
#########################
# change 'tests => 1' to 'tests => last_test_to_print';
use Test;
BEGIN { plan tests => 2 };
BEGIN {print <<EOF };
AIS::client redirects and exits, only achieving it's
aim of authenticating a user against a central AIS server
after at least three state-altering calls to itself.
If you can figure out a way to write a test harness for
it I'll gladly accept the patch.
( run in 0.609 second using v1.01-cache-2.11-cpan-c333fce770f )