[Catalyst-commits] r8482 - / Catalyst-Helper-AuthDBIC/trunk
Catalyst-Helper-AuthDBIC/trunk/lib/Catalyst/Helper
Catalyst-Helper-AuthDBIC/trunk/script
Catalyst-Helper-AuthDBIC/trunk/t
zarquon at dev.catalyst.perl.org
zarquon at dev.catalyst.perl.org
Wed Oct 1 10:14:59 BST 2008
Author: zarquon
Date: 2008-10-01 10:14:59 +0100 (Wed, 01 Oct 2008)
New Revision: 8482
Removed:
Catalyst-Helper-AuthDBIC/trunk/MANIFEST
Modified:
/
Catalyst-Helper-AuthDBIC/trunk/lib/Catalyst/Helper/AuthDBIC.pm
Catalyst-Helper-AuthDBIC/trunk/script/auth_bootstrap.pl
Catalyst-Helper-AuthDBIC/trunk/t/02-usage.t
Log:
r14052 at zaphod: kd | 2008-09-25 12:00:31 +1000
version 0.6
Property changes on:
___________________________________________________________________
Name: svk:merge
- 1b129c88-ebf4-0310-add9-f09427935aba:/local/catalyst:4278
1c72fc7c-9ce4-42af-bf25-3bfe470ff1e8:/local/Catalyst:14051
3b9770f9-e80c-0410-a7de-cd203d167417:/local/catalyst:3514
dd8ad9ea-0304-0410-a433-df5f223e7bc0:/local/Catalyst:6909
+ 1b129c88-ebf4-0310-add9-f09427935aba:/local/catalyst:4278
1c72fc7c-9ce4-42af-bf25-3bfe470ff1e8:/local/Catalyst:14052
3b9770f9-e80c-0410-a7de-cd203d167417:/local/catalyst:3514
dd8ad9ea-0304-0410-a433-df5f223e7bc0:/local/Catalyst:6909
Deleted: Catalyst-Helper-AuthDBIC/trunk/MANIFEST
===================================================================
--- Catalyst-Helper-AuthDBIC/trunk/MANIFEST 2008-10-01 09:14:31 UTC (rev 8481)
+++ Catalyst-Helper-AuthDBIC/trunk/MANIFEST 2008-10-01 09:14:59 UTC (rev 8482)
@@ -1,8 +0,0 @@
-Changes
-MANIFEST
-Makefile.PL
-README
-lib/Catalyst/Helper/AuthDBIC.pm
-t/00-load.t
-t/pod-coverage.t
-t/pod.t
Modified: Catalyst-Helper-AuthDBIC/trunk/lib/Catalyst/Helper/AuthDBIC.pm
===================================================================
--- Catalyst-Helper-AuthDBIC/trunk/lib/Catalyst/Helper/AuthDBIC.pm 2008-10-01 09:14:31 UTC (rev 8481)
+++ Catalyst-Helper-AuthDBIC/trunk/lib/Catalyst/Helper/AuthDBIC.pm 2008-10-01 09:14:59 UTC (rev 8482)
@@ -435,7 +435,7 @@
'credential' => {
'password_type' => 'hashed',
'password_field' => 'password',
- 'password_hash_type' => 'Eksblowfish::Bcrypt',
+ 'password_hash_type' => 'SHA-1',
'class' => 'HTTP',
'type' => 'basic',
}
@@ -457,7 +457,7 @@
'credential' => {
'password_type' => 'hashed',
'password_field' => 'password',
- 'password_hash_type' => 'Eksblowfish::Bcrypt',
+ 'password_hash_type' => 'SHA-1',
'class' => 'Password'
}
}
@@ -465,16 +465,16 @@
});
__digest__
-__PACKAGE__->add_columns(
- 'password' => {
- data_type => 'CHAR',
- size => 22,
- encode_column => 1,
- encode_class => 'Crypt::Eksblowfish::Bcrypt',
- encode_args => { key_nul => 0, cost => 8 },
- digest_check_method => 'check_password',
- });
+ __PACKAGE__->add_columns(
+ 'password' => {
+ data_type => 'CHAR',
+ size => 40,
+ encode_column => 1,
+ encode_class => 'Digest',
+ encode_args => {algorithm => 'SHA-1', format => 'hex'},
+ });
+
__requires__
requires 'Catalyst::Plugin::Authentication';
requires 'Catalyst::Plugin::Authorization::Roles';
@@ -483,7 +483,6 @@
requires 'Catalyst::Plugin::Session::Store::FastMmap';
requires 'Catalyst::Authentication::Store::DBIx::Class';
requires 'Catalyst::Authentication::Credential::HTTP';
-requires 'Crypt::Eksblowfish::Bcrypt';
requires 'DBIx::Class::EncodedColumn;
__login.tt__
<h1> Please login</h1>
Modified: Catalyst-Helper-AuthDBIC/trunk/script/auth_bootstrap.pl
===================================================================
--- Catalyst-Helper-AuthDBIC/trunk/script/auth_bootstrap.pl 2008-10-01 09:14:31 UTC (rev 8481)
+++ Catalyst-Helper-AuthDBIC/trunk/script/auth_bootstrap.pl 2008-10-01 09:14:59 UTC (rev 8482)
@@ -17,6 +17,13 @@
(basic) authentication. Use of the password option provides some
basic html templates and (buggy - patches welcome) pass through login.
+Once you're done running this script, add a user with the
+script/myapp_auth_admin.pl command (run myapp_auth_admin.pl -help for
+instructions), and then add some code to one of your controllers. For
+example to require application wide authentication add the following to your Controller::Root :
+
+
+
=cut
Modified: Catalyst-Helper-AuthDBIC/trunk/t/02-usage.t
===================================================================
--- Catalyst-Helper-AuthDBIC/trunk/t/02-usage.t 2008-10-01 09:14:31 UTC (rev 8481)
+++ Catalyst-Helper-AuthDBIC/trunk/t/02-usage.t 2008-10-01 09:14:59 UTC (rev 8482)
@@ -5,16 +5,51 @@
use Test::Command qw/no_plan/;
use Test::More;
use Directory::Scratch;
+use Path::Class;
use FindBin qw/$Bin/;
my $bootstrap = "$Bin/../script/auth_bootstrap.pl";
use ok 'Catalyst::Helper::AuthDBIC';
-my $wdir = Directory::Scratch->new();
+my $scratch = Directory::Scratch->new();
+my $wdir = Path::Class::Dir->new($scratch);
chdir $wdir;
exit_is_num ( 'catalyst.pl Test::App', 0 , 'test app');
ok(chdir 'Test-App');
exit_is_num ("/usr/bin/env perl $bootstrap -credential http", 0, 'auth bootstrap');
exit_is_num( "/usr/bin/env perl script/test_app_auth_admin.pl -user fred -password wilma", 0 , "created user");
-undef $wdir;
+
+my $controller = <<'EOF';
+
+package Test::App::Controller::Secret;
+
+use strict;
+use warnings;
+use parent 'Catalyst::Controller';
+
+sub auto : Private {
+ my ( $self, $c ) = @_;
+ $c->authenticate({realm => 'users'});
+}
+
+sub default : Path {
+ my ($self, $c) = @_;
+ $c->res->body('ok');
+}
+
+1;
+
+EOF
+
+my $controller_file;
+$controller_file = $wdir->subdir('Test-App')->subdir('lib')->subdir('Test')->subdir('App')->subdir('Controller')->file('Secret.pm');
+
+my $FH;
+
+open $FH, ">", $controller_file;
+print $FH $controller;
+close $FH;
+# stdout_like('$wdir/script/test_app_test.pl /secret', qr/Authorization required/ism, 'auth required');
+$DB::single=1;
+undef $scratch;
More information about the Catalyst-commits
mailing list