X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FAuthentication%2FStore%2FHtpasswd.pm;h=6c76388370160f9d870e4c828397391291acfdce;hb=0fb17be538c4161addf13b7ee2dd6ea13a609c8e;hp=8fa2568f4cc385f48de1d4affe0efe6557d9f270;hpb=a44689b3a17fecea111528ff797c299aa5cd9dad;p=catagits%2FCatalyst-Authentication-Store-Htpasswd.git diff --git a/lib/Catalyst/Authentication/Store/Htpasswd.pm b/lib/Catalyst/Authentication/Store/Htpasswd.pm index 8fa2568..6c76388 100644 --- a/lib/Catalyst/Authentication/Store/Htpasswd.pm +++ b/lib/Catalyst/Authentication/Store/Htpasswd.pm @@ -11,13 +11,13 @@ use Authen::Htpasswd 0.13; use Catalyst::Authentication::Store::Htpasswd::User; use Scalar::Util qw/blessed/; -our $VERSION = '1.006'; +our $VERSION = '1.007'; BEGIN { __PACKAGE__->mk_accessors(qw/file user_field user_class/) } sub new { my ($class, $config, $app, $realm) = @_; - + my $file = delete $config->{file}; unless (ref $file) { my $filename = ($file =~ m|^/|) ? $file : $app->path_to($file)->stringify; @@ -27,7 +27,7 @@ sub new { $config->{file} = $file; $config->{user_class} ||= __PACKAGE__ . '::User'; $config->{user_field} ||= 'username'; - + bless { %$config }, $class; } @@ -40,7 +40,7 @@ sub find_user { sub user_supports { my $self = shift; - # this can work as a class method, but in that case you can't have + # this can work as a class method, but in that case you can't have # a custom user class ref($self) ? $self->user_class->supports(@_) : Catalyst::Authentication::Store::Htpasswd::User->supports(@_); @@ -79,7 +79,7 @@ __END__ }, }, }, - }, + }, ); sub login : Global { @@ -90,8 +90,8 @@ __END__ =head1 DESCRIPTION -This plugin uses L to let your application use C<<.htpasswd>> -files for it's authentication storage. +This plugin uses L to let your application use C<< .htpasswd >> +files for its authentication storage. =head1 METHODS @@ -101,22 +101,23 @@ Simple constructor, dies if the htpassword file can't be found =head2 find_user -Looks up the user, and returns a Catalyst::Authentication::Store::Htpasswd::User object. +Looks up the user, and returns a L object. =head2 user_supports -Delegates to Luser_supports|Catalyst::Authentication::Store::Htpasswd::User#user_supports> +Delegates to L<< Catalyst::Authentication::User->supports|Catalyst::Authentication::User/supports >> or an +override in L. =head2 from_session -Delegates the user lookup to C<< find_user >> +Delegates the user lookup to L =head1 CONFIGURATION =head2 file The path to the htpasswd file. If the path starts with a slash, then it is assumed to be a fully -qualified path, otherwise the path is fed through C<< $c->path_to >> and so normalised to the +qualified path, otherwise the path is fed through C<< $c->path_to >> and so normalised to the application root. Alternatively, it is possible to pass in an L object here, and this will be