[Catalyst-commits] r8498 - in Catalyst-Authentication-Store-Htpasswd/1.000/trunk: . lib/Catalyst/Authentication/Store lib/Catalyst/Authentication/Store/Htpasswd t

t0m at dev.catalyst.perl.org t0m at dev.catalyst.perl.org
Thu Oct 2 09:23:21 BST 2008


Author: t0m
Date: 2008-10-02 09:23:21 +0100 (Thu, 02 Oct 2008)
New Revision: 8498

Modified:
   Catalyst-Authentication-Store-Htpasswd/1.000/trunk/Changes
   Catalyst-Authentication-Store-Htpasswd/1.000/trunk/Makefile.PL
   Catalyst-Authentication-Store-Htpasswd/1.000/trunk/Todo
   Catalyst-Authentication-Store-Htpasswd/1.000/trunk/lib/Catalyst/Authentication/Store/Htpasswd.pm
   Catalyst-Authentication-Store-Htpasswd/1.000/trunk/lib/Catalyst/Authentication/Store/Htpasswd/User.pm
   Catalyst-Authentication-Store-Htpasswd/1.000/trunk/t/backend.t
Log:
Checking in changes prior to tagging of version 1.002.  Changelog diff is:

=== Changes
==================================================================
--- Changes	(revision 7836)
+++ Changes	(local)
@@ -1,6 +1,7 @@
-1.002  ??? Oct   ?? ??:??:?? GMT 2008
-    - Add Test::WWW::Mechanize::Catalyst to build_requires.
-      CPANTs will keep hitting me until I get it right :(
+1.002  Thu Oct   02 09:20:30 GMT 2008
+    - Add Test::WWW::Mechanize::Catalyst and Test::use::ok
+      to build_requires. CPANTs will keep hitting me until 
+      I get it right :(
     - Add code and docs for user_field configuration option
     - Add code and docs for user_class configuration option
 


Modified: Catalyst-Authentication-Store-Htpasswd/1.000/trunk/Changes
===================================================================
--- Catalyst-Authentication-Store-Htpasswd/1.000/trunk/Changes	2008-10-02 04:13:53 UTC (rev 8497)
+++ Catalyst-Authentication-Store-Htpasswd/1.000/trunk/Changes	2008-10-02 08:23:21 UTC (rev 8498)
@@ -1,6 +1,7 @@
-1.002  ??? Oct   ?? ??:??:?? GMT 2008
-    - Add Test::WWW::Mechanize::Catalyst to build_requires.
-      CPANTs will keep hitting me until I get it right :(
+1.002  Thu Oct   02 09:20:30 GMT 2008
+    - Add Test::WWW::Mechanize::Catalyst and Test::use::ok
+      to build_requires. CPANTs will keep hitting me until 
+      I get it right :(
     - Add code and docs for user_field configuration option
     - Add code and docs for user_class configuration option
 

Modified: Catalyst-Authentication-Store-Htpasswd/1.000/trunk/Makefile.PL
===================================================================
--- Catalyst-Authentication-Store-Htpasswd/1.000/trunk/Makefile.PL	2008-10-02 04:13:53 UTC (rev 8497)
+++ Catalyst-Authentication-Store-Htpasswd/1.000/trunk/Makefile.PL	2008-10-02 08:23:21 UTC (rev 8498)
@@ -9,5 +9,6 @@
 requires 'Class::Accessor::Fast';
 requires 'Crypt::PasswdMD5';
 build_requires 'Test::WWW::Mechanize::Catalyst';
+build_requires 'Test::use::ok';
 
 WriteAll;  

Modified: Catalyst-Authentication-Store-Htpasswd/1.000/trunk/Todo
===================================================================
--- Catalyst-Authentication-Store-Htpasswd/1.000/trunk/Todo	2008-10-02 04:13:53 UTC (rev 8497)
+++ Catalyst-Authentication-Store-Htpasswd/1.000/trunk/Todo	2008-10-02 08:23:21 UTC (rev 8498)
@@ -2,4 +2,6 @@
 . Better docs
 . Test configurable user class
 . Test configurable username field.
-. Configurable password field.
\ No newline at end of file
+. Configurable password field.
+. Test autoload
+. Test stringification

Modified: Catalyst-Authentication-Store-Htpasswd/1.000/trunk/lib/Catalyst/Authentication/Store/Htpasswd/User.pm
===================================================================
--- Catalyst-Authentication-Store-Htpasswd/1.000/trunk/lib/Catalyst/Authentication/Store/Htpasswd/User.pm	2008-10-02 04:13:53 UTC (rev 8497)
+++ Catalyst-Authentication-Store-Htpasswd/1.000/trunk/lib/Catalyst/Authentication/Store/Htpasswd/User.pm	2008-10-02 08:23:21 UTC (rev 8498)
@@ -6,7 +6,7 @@
 use strict;
 use warnings;
 
-BEGIN { __PACKAGE__->mk_accessors(qw/user store/) }
+BEGIN { __PACKAGE__->mk_accessors(qw/_user _store/) }
 
 use overload '""' => sub { shift->id }, fallback => 1;
 
@@ -15,12 +15,12 @@
 
 	return unless $user;
 
-	bless { store => $store, user => $user }, $class;
+	bless { _store => $store, _user => $user }, $class;
 }
 
 sub id {
     my $self = shift;
-    return $self->user->username;
+    return $self->_user->username;
 }
 
 sub supported_features {
@@ -35,20 +35,19 @@
 
 sub check_password {
 	my ( $self, $password ) = @_;
-	return $self->user->check_password( $password );
+	return $self->_user->check_password( $password );
 }
 
 sub roles {
 	my $self = shift;
-	my $field = $self->user->extra_info->[0];
+	my $field = $self->_user->extra_info->[0];
 	return defined $field ? split /,/, $field : ();
 }
 
-sub for_session {
-    my $self = shift;
-    return $self->id;
-}
+*for_session = \&id;
 
+*get_object = \&_user;
+
 sub AUTOLOAD {
 	my $self = shift;
 	
@@ -56,7 +55,7 @@
 
 	return if $method eq "DESTROY";
 	
-	$self->user->$method;
+	$self->_user->$method;
 }
 
 1;
@@ -106,6 +105,10 @@
 
 Returns data about which featurs this user module supports.
 
+=head2 get_object
+
+Returns the underlieing L<Authen::Htpasswd::User> object for this user
+
 =head1 AUTHORS
 
 Yuval Kogman C<nothingmuch at woobling.org>

Modified: Catalyst-Authentication-Store-Htpasswd/1.000/trunk/lib/Catalyst/Authentication/Store/Htpasswd.pm
===================================================================
--- Catalyst-Authentication-Store-Htpasswd/1.000/trunk/lib/Catalyst/Authentication/Store/Htpasswd.pm	2008-10-02 04:13:53 UTC (rev 8497)
+++ Catalyst-Authentication-Store-Htpasswd/1.000/trunk/lib/Catalyst/Authentication/Store/Htpasswd.pm	2008-10-02 08:23:21 UTC (rev 8498)
@@ -9,7 +9,7 @@
 use Catalyst::Authentication::Store::Htpasswd::User;
 use Scalar::Util qw/blessed/;
 
-our $VERSION = '1.001';
+our $VERSION = '1.002';
 
 BEGIN { __PACKAGE__->mk_accessors(qw/file user_field user_class/) }
 
@@ -93,7 +93,7 @@
 
 =head1 DESCRIPTION
 
-This plugin uses C<Authen::Htpasswd> to let your application use C<.htpasswd>
+This plugin uses L<Authen::Htpasswd> to let your application use C<<.htpasswd>>
 files for it's authentication storage.
 
 =head1 METHODS
@@ -112,7 +112,7 @@
 
 =head2 from_session
 
-Delegates the user lookup to C< find_user >
+Delegates the user lookup to C<< find_user >>
 
 =head1 CONFIGURATION
 
@@ -133,7 +133,7 @@
 
 =head2 user_field
 
-Change the field that the username is found in in the information passed into the call to C< $c->authenticate() >.
+Change the field that the username is found in in the information passed into the call to C<< $c->authenticate() >>.
 
 This defaults to I< username >, and generally you should be able to use the module as shown in the synopsis, however
 if you need a different field name then this setting can change the default.
@@ -151,11 +151,11 @@
 
 =head1 AUTHORS
 
-Yuval Kogman C<nothingmuch at woobling.org>
+Yuval Kogman C<<nothingmuch at woobling.org>>
 
-David Kamholz C<dkamholz at cpan.org>
+David Kamholz C<<dkamholz at cpan.org>>
 
-Tomas Doran C<bobtfish at bobtfish.net>
+Tomas Doran C<<bobtfish at bobtfish.net>>
 
 =head1 SEE ALSO
 

Modified: Catalyst-Authentication-Store-Htpasswd/1.000/trunk/t/backend.t
===================================================================
--- Catalyst-Authentication-Store-Htpasswd/1.000/trunk/t/backend.t	2008-10-02 04:13:53 UTC (rev 8497)
+++ Catalyst-Authentication-Store-Htpasswd/1.000/trunk/t/backend.t	2008-10-02 08:23:21 UTC (rev 8498)
@@ -36,11 +36,11 @@
 
 ok( $m->user_supports(qw/session/), "user_supports session");
 
-is( $u->store, $o, "can get store");
+is( $u->_store, $o, "can get store");
 
 can_ok( $m, "from_session" );
 can_ok( $u, "for_session" );
 
-my $recovered = $u->store->from_session( undef, $u->for_session );
+my $recovered = $u->_store->from_session( undef, $u->for_session );
 
 is( $recovered->username, $u->username, "recovery from session works");




More information about the Catalyst-commits mailing list