From a0cb0dd1ec2a71a922072f381ee9ed82564ad498 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 10 Jan 2013 19:12:31 +0000 Subject: [PATCH] rename the module --- CGI/Auth/Flexible.pm | 1 + CGI/Auth/Hybrid.pm | 1 - TODO | 2 -- cgi-auth-hybrid.pm => cgi-auth-flexible.pm | 26 +++++++++++----------- test.cgi | 5 ++--- 5 files changed, 16 insertions(+), 19 deletions(-) create mode 120000 CGI/Auth/Flexible.pm delete mode 120000 CGI/Auth/Hybrid.pm rename cgi-auth-hybrid.pm => cgi-auth-flexible.pm (97%) diff --git a/CGI/Auth/Flexible.pm b/CGI/Auth/Flexible.pm new file mode 120000 index 0000000..e763e87 --- /dev/null +++ b/CGI/Auth/Flexible.pm @@ -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 index a8427d3..0000000 --- a/CGI/Auth/Hybrid.pm +++ /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 --- 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 diff --git a/cgi-auth-hybrid.pm b/cgi-auth-flexible.pm similarity index 97% rename from cgi-auth-hybrid.pm rename to cgi-auth-flexible.pm index 4c34bc7..1a2da28 100644 --- a/cgi-auth-hybrid.pm +++ b/cgi-auth-flexible.pm @@ -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 diff --git a/test.cgi b/test.cgi index 815fa52..fb67d4c 100755 --- 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, -- 2.30.2