Plack::Middleware::Auth::Htpasswd - http basic authentication through apache-style .htpasswd files
version 0.02
use Plack::Builder; my $app = sub { ... }; builder { enable "Auth::Htpasswd", file => '/path/to/.htpasswd'; $app; };
or
builder { enable "Auth::Htpasswd", file_root => '/path/to/my/static/files'; $app; };
This middleware enables HTTP Basic authenication, based on the users in an Apache-style htpasswd file. You can either specify the file directly, through the file option, or use the file_root option to specify the root directory on the filesystem that corresponds to the web application root. This second option is more useful when using an app that is closely tied to the filesystem, such as Plack::App::Directory. If file_root is used, the requested path will be inspected, and a file named .htpasswd will be checked in each containing directory, up to the file_root. The first one found will be used to validate the requested user.
file
file_root
.htpasswd
Name of a .htpasswd file to read authentication information from. Required if file_root is not set.
Path to the on-disk directory that corresponds to the root URL path of the app. Required file is not set, and ignored if file is set.
Realm name to display in the basic authentication dialog. Defaults to 'restricted area'.
Large parts of this code were modeled after (read: stolen from) Plack::Middleware::Auth::Basic by Tatsuhiko Miyagawa.
No known bugs.
Please report any bugs through RT: email bug-plack-middleware-auth-htpasswd at rt.cpan.org, or browse to http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Plack-Middleware-Auth-Htpasswd.
bug-plack-middleware-auth-htpasswd at rt.cpan.org
Plack
Plack::Middleware::Auth::Basic
You can find this documentation for this module with the perldoc command.
perldoc Plack::Middleware::Auth::Htpasswd
You can also look for information at:
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Plack-Middleware-Auth-Htpasswd
CPAN Ratings
http://cpanratings.perl.org/d/Plack-Middleware-Auth-Htpasswd
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Plack-Middleware-Auth-Htpasswd
Search CPAN
http://search.cpan.org/dist/Plack-Middleware-Auth-Htpasswd
Jesse Luehrs <doy at tozt dot net>
This software is copyright (c) 2010 by Jesse Luehrs.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Plack::Middleware::Auth::Htpasswd, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Plack::Middleware::Auth::Htpasswd
CPAN shell
perl -MCPAN -e shell install Plack::Middleware::Auth::Htpasswd
For more information on module installation, please visit the detailed CPAN module installation guide.