chiark / gitweb /
rename the module
authorIan Jackson <ian.jackson@eu.citrix.com>
Thu, 10 Jan 2013 19:12:31 +0000 (19:12 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Thu, 10 Jan 2013 19:12:31 +0000 (19:12 +0000)
CGI/Auth/Flexible.pm [new symlink]
CGI/Auth/Hybrid.pm [deleted symlink]
TODO
cgi-auth-flexible.pm [moved from cgi-auth-hybrid.pm with 97% similarity]
test.cgi

diff --git a/CGI/Auth/Flexible.pm b/CGI/Auth/Flexible.pm
new file mode 120000 (symlink)
index 0000000..e763e87
--- /dev/null
@@ -0,0 +1 @@
+../../cgi-auth-flexible.pm
\ No newline at end of file
diff --git a/CGI/Auth/Hybrid.pm b/CGI/Auth/Hybrid.pm
deleted file mode 120000 (symlink)
index a8427d3..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../../cgi-auth-hybrid.pm
\ No newline at end of file
diff --git a/TODO b/TODO
index 8326756..b39dff5 100644 (file)
--- a/TODO
+++ b/TODO
@@ -8,5 +8,3 @@ missing hidden parameter
 form entry has wrong action url
 
 update last in db when we return undef from check_divert
-
-rename to cgi::auth::flexible
similarity index 97%
rename from cgi-auth-hybrid.pm
rename to cgi-auth-flexible.pm
index 4c34bc7..1a2da28 100644 (file)
@@ -1,6 +1,6 @@
 # -*- perl -*-
 
-# This is part of CGI::Auth::Hybrid, a perl CGI authentication module.
+# This is part of CGI::Auth::Flexible, a perl CGI authentication module.
 # Copyright (C) 2012 Ian Jackson.
 # Copyright (C) 2012 Citrix.
 # 
@@ -20,7 +20,7 @@
 use strict;
 use warnings;
 
-package CGI::Auth::Hybrid;
+package CGI::Auth::Flexible;
 require Exporter;
 
 BEGIN {
@@ -151,26 +151,26 @@ sub new_verifier {
     my $verifier = {
        S => {
             dir => undef,
-           assocdb_path => 'cah-assocs.db',
-           keys_path => 'cah-keys',
+           assocdb_path => 'caf-assocs.db',
+           keys_path => 'caf-keys',
            assocdb_dsn => undef,
            assocdb_user => '',
            assocdb_password => '',
-           assocdb_table => 'assocs',
+           assocdb_table => 'caf_assocs',
            random_source => '/dev/urandom',
            secretbits => 128, # bits
            hash_algorithm => "SHA-256",
            login_timeout => 86400, # seconds
            login_form_timeout => 3600, # seconds
            key_rollover => 86400, # seconds
-           assoc_param_name => 'cah_assochash',
-           cookie_name => "cah_assocsecret",
+           assoc_param_name => 'caf_assochash',
+           cookie_name => "caf_assocsecret",
            password_param_name => 'password',
            username_param_names => [qw(username)],
            form_entry_size => 60,
-           logout_param_names => [qw(cah_logout)],
-           login_submit_name => [qw(cah_login)],
-           loggedout_param_names => [qw(cah_loggedout)],
+           logout_param_names => [qw(caf_logout)],
+           login_submit_name => [qw(caf_login)],
+           loggedout_param_names => [qw(caf_loggedout)],
            promise_check_mutate => 0,
            get_param => sub { $_[0]->param($_[2]) },
            get_params => sub { $_[1]->get_params() },
@@ -922,14 +922,14 @@ __END__
 
 =head1 NAME
 
-CGI::Auth::Hybrid - web authentication optionally using cookies
+CGI::Auth::Flexible - web authentication optionally using cookies
 
 =head1 SYNOPSYS
 
- my $verifier = CGI::Auth::Hybrid->new_verifier(setting => value,...);
+ my $verifier = CGI::Auth::Flexible->new_verifier(setting => value,...);
  my $authreq = $verifier->new_request($cgi_request_object);
 
- my $authreq = CGI::Auth::Hybrid->new_request($cgi_request_object,
+ my $authreq = CGI::Auth::Flexible->new_request($cgi_request_object,
                                               setting => value,...);
 
 =head1 USAGE PATTERN FOR SIMPLE APPLICATIONS
index 815fa52..fb67d4c 100755 (executable)
--- a/test.cgi
+++ b/test.cgi
@@ -3,13 +3,12 @@
 use strict;
 use warnings;
 use CGI;
-use CGI::Auth::Hybrid;
+use CGI::Auth::Flexible;
 use URI;
 
 my $dump = "$ENV{'CAHTEST_HOME'}/dump";
 
-my $verifier = CGI::Auth::Hybrid->new_verifier(
-    assocdb_path => "$dump/assoc.db",
+my $verifier = CGI::Auth::Flexible->new_verifier(
     username_password_ok => sub { my ($c,$r,$u,$p)=@_; return $p eq 'sesame'; },
     encrypted_only => 0,
     dir => $dump,