X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FAuthentication%2FStore%2FHtpasswd.pm;h=090f6e3bb261f6bd16a289b350ba71210772fd4c;hb=29150588559a88acff99d5486408d2966f0b856d;hp=b45019febe4cfcd0342c23237922dfbde7a9fe24;hpb=1fad0d369cd0f2370affdae8cf07466dfe1322f0;p=catagits%2FCatalyst-Authentication-Store-Htpasswd.git diff --git a/lib/Catalyst/Authentication/Store/Htpasswd.pm b/lib/Catalyst/Authentication/Store/Htpasswd.pm index b45019f..090f6e3 100644 --- a/lib/Catalyst/Authentication/Store/Htpasswd.pm +++ b/lib/Catalyst/Authentication/Store/Htpasswd.pm @@ -1,21 +1,23 @@ #!/usr/bin/perl package Catalyst::Authentication::Store::Htpasswd; +# ABSTRACT: Authen::Htpasswd based user storage/authentication + use base qw/Class::Accessor::Fast/; use strict; use warnings; -use Authen::Htpasswd; +use Authen::Htpasswd 0.13; use Catalyst::Authentication::Store::Htpasswd::User; use Scalar::Util qw/blessed/; -our $VERSION = '1.004'; +our $VERSION = '1.006'; 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; @@ -25,7 +27,7 @@ sub new { $config->{file} = $file; $config->{user_class} ||= __PACKAGE__ . '::User'; $config->{user_field} ||= 'username'; - + bless { %$config }, $class; } @@ -38,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(@_); @@ -55,11 +57,6 @@ __END__ =pod -=head1 NAME - -Catalyst::Authentication::Store::Htpasswd - Authen::Htpasswd based -user storage/authentication. - =head1 SYNOPSIS use Catalyst qw/ @@ -82,7 +79,7 @@ user storage/authentication. }, }, }, - }, + }, ); sub login : Global { @@ -93,7 +90,7 @@ user storage/authentication. =head1 DESCRIPTION -This plugin uses L to let your application use C<<.htpasswd>> +This plugin uses L to let your application use C<< .htpasswd >> files for it's authentication storage. =head1 METHODS @@ -108,18 +105,19 @@ Looks up the user, and returns a Catalyst::Authentication::Store::Htpasswd::User =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 @@ -149,24 +147,8 @@ Example: # Later in your code $c->authenticate({ email_address => $c->req->param("email"), password => $c->req->param("password") }); -=head1 AUTHORS - -Yuval Kogman C<> - -David Kamholz C<> - -Tomas Doran C<> - =head1 SEE ALSO L. -=head1 COPYRIGHT & LICENSE - - Copyright (c) 2005-2008 the aforementioned authors. All rights - reserved. This program is free software; you can redistribute - it and/or modify it under the same terms as Perl itself. - =cut - -