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;
$config->{file} = $file;
$config->{user_class} ||= __PACKAGE__ . '::User';
$config->{user_field} ||= 'username';
-
+
bless { %$config }, $class;
}
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(@_);
},
},
},
- },
+ },
);
sub login : Global {
=head1 DESCRIPTION
-This plugin uses L<Authen::Htpasswd> to let your application use C<<.htpasswd>>
-files for it's authentication storage.
+This plugin uses L<Authen::Htpasswd> to let your application use C<< .htpasswd >>
+files for its authentication storage.
=head1 METHODS
=head2 user_supports
-Delegates to L<Catalyst::Authentication::Store::Htpasswd::User->user_supports|Catalyst::Authentication::Store::Htpasswd::User#user_supports>
+Delegates to L<< Catalyst::Authentication::User->supports|Catalyst::Authentication::User/supports >> or an
+override in L<user_class|/user_class>.
=head2 from_session
-Delegates the user lookup to C<< find_user >>
+Delegates the user lookup to L<find_user|/find_user>
=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<Authen::Htpasswd> object here, and this will be