-
-
15 Dec 2010 08:55:37 UTC
- Distribution: HTTP-AppServer
- Module version: 0.01
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues
- Testers (691 / 0 / 38)
- Kwalitee
Bus factor: 0- 90.00% Coverage
- License: unknown
- Activity
24 month- Tools
- Download (16.24KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- DBI
- Data::Dumper
- Data::UUID
- HTTP::Server::Simple::CGI
- IO::File
- JSON
- MIME::Base64
- Path::Trim
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
HTTP::AppServer::Plugin::HTTPAuth - Plugin for HTTP::AppServer uses HTTP authentication to authenticate a client. The authentication works based on a certain handler regex.
SYNOPSIS
use HTTP::AppServer; my $server = HTTP::AppServer->new(); $server->plugin('HTTPAuth', Logins => {guest => '', mrx => 'pass'}, URLs => ['^\/admin']);
DESCRIPTION
Plugin for HTTP::AppServer uses HTTP authentication to authenticate a client. The authentication works based on a certain handler regex.
Plugin configuration
Logins => hash
A hash containing the available accounts that are allowed to access the restricted URLs, e.g.:
..., Logins => {guest => '', mrx => 'pass'}, ...
URLs => array
This is a list of restricted URLs. When an URL is accessed that matches any regular expression in this list, a HTTP authorization is preformed. If the authorization fails an error page is returned. In all other cases (URL not restricted or authorization was successful) other handlers are allowed to process the URL.
LoginsFile => filename
This can be supplied additionally to the Logins option. The account information is then read from a file that has the format of normal .htpasswd files, e.g.
username1:password username2:password ...
while password is a Base64 encoded password.
Installed URL handlers
HTTPAuth installs a binding to the URL '^(.*)$', which means it matches everything. It allows for further processing after that if the URL is not restricted (is not contained in the URLs option when loading the plugin).
Installed server properties
httpauth_logins
This is a reference to the Logins that are configured when loading the plugin.
httpauth_urls
This is a reference to the URLs that are configured when loading the plugin.
Installed server methods
None.
SEE ALSO
HTTP::AppServer, HTTP::AppServer::Plugin
AUTHOR
Tom Kirchner, <tom@tkirchner.com>
COPYRIGHT AND LICENSE
Copyright (C) 2010 by Tom Kirchner
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.0 or, at your option, any later version of Perl 5 you may have available.
Module Install Instructions
To install HTTP::AppServer, copy and paste the appropriate command in to your terminal.
cpanm HTTP::AppServer
perl -MCPAN -e shell install HTTP::AppServer
For more information on module installation, please visit the detailed CPAN module installation guide.