X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FPlugin%2FAuthentication%2FStore%2FHtpasswd.pm;h=505ed0f624d2df36b692a62b0d9df58acaf89f72;hb=f3ed9b8405f77d8a75287a5afde95bd3cd9dd156;hp=2dfb066ca14efce051db2fb7d7003557aba4ba0f;hpb=0b5b70bafb779ab4c30b593b235ce049f4cce964;p=catagits%2FCatalyst-Authentication-Store-Htpasswd.git diff --git a/lib/Catalyst/Plugin/Authentication/Store/Htpasswd.pm b/lib/Catalyst/Plugin/Authentication/Store/Htpasswd.pm index 2dfb066..505ed0f 100644 --- a/lib/Catalyst/Plugin/Authentication/Store/Htpasswd.pm +++ b/lib/Catalyst/Plugin/Authentication/Store/Htpasswd.pm @@ -1,18 +1,20 @@ #!/usr/bin/perl -package Catalyst::Plugin::Authentication::Store::Minimal; +package Catalyst::Plugin::Authentication::Store::Htpasswd; use strict; use warnings; -use Catalyst::Plugin::Authentication::Store::Minimal::Backend; +our $VERSION = '0.011'; + +use Catalyst::Plugin::Authentication::Store::Htpasswd::Backend; sub setup { my $c = shift; $c->default_auth_store( - Catalyst::Plugin::Authentication::Store::Minimal::Backend->new( - $c->config->{authentication}{users} + Catalyst::Plugin::Authentication::Store::Htpasswd::Backend->new( + $c->config->{authentication}{htpasswd} ) ); @@ -27,24 +29,18 @@ __END__ =head1 NAME -Catalyst::Plugin::Authentication::Store::Minimal - Authentication +Catalyst::Plugin::Authentication::Store::Htpasswd - Authentication database in C<<$c->config>>. =head1 SYNOPSIS use Catalyst qw/ Authentication - Authentication::Store::Minimal + Authentication::Store::Htpasswd Authentication::Credential::Password /; - __PACKAGE__->config->{authentication}{users} = { - name => { - password => "s3cr3t", - roles => [qw/admin editor/], - ... - }, - }; + __PACKAGE__->config->{authentication}{htpasswd} = "passwdfile"; sub login : Global { my ( $self, $c ) = @_; @@ -54,25 +50,37 @@ database in C<<$c->config>>. =head1 DESCRIPTION -This authentication store plugin lets you create a very quick and dirty user -database in your application's config hash. - -It's purpose is mainly for testing, and it should probably be replaced by a -more "serious" store for production. - -The hash in the config, as well as the user objects/hashes are freely mutable -at runtime. +This plugin uses C to let your application use C<.htpasswd> +files for it's authentication storage. =head1 METHODS -=over 4 - -=item setup +=head2 setup This method will popultate C<< $c->config->{authentication}{store} >> so that L can use it. -=back +=head1 CONFIGURATION + +=head2 $c->config->{authentication}{htpasswd} + +The path to the htpasswd file. + +=head1 AUTHORS + +Yuval Kogman C + +David Kamholz C + +=head1 SEE ALSO + +L. + +=head1 COPYRIGHT & LICENSE + + Copyright (c) 2005 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