Apache-AuthenCache
view release on metacpan or search on metacpan
AuthenCache.pm view on Meta::CPAN
unless ($passwd_sent eq $passwd) {
$r->log->debug("AuthenCache::handler: user $user_sent: " .
"password mismatch" . $r->uri);
# Must return DECLINED so that user has a chance to put in a
# new password
return DECLINED;
}
# Password matches so end stage
# The required patch was not introduced in 1.26. It is no longer
# promised to be included in any timeframe. Commenting out.
# if ($mod_perl::VERSION > 1.25) {
# I should be able to use the below lines and be done with it.
# Since set_handlers() doesn't work properly until 1.26
# (according to Doug MacEachern) I have to work around it by
# cobbling together cheat sheets for the subsequent handlers
# in this phase. I get the willies about the security implications
# in a general environment where you might be using someone else's
# handlers upstream or downstream...
$r->log->debug("handler: user in cache and password matches; ",
"returning OK and clearing authen handler stack");
AuthenCache.pm view on Meta::CPAN
# Get response and password
my ($res, $passwd_sent) = $r->get_basic_auth_pw;
return $res if $res; # e.g. HTTP_UNAUTHORIZED
# Get username
my $user_sent = $r->connection->user;
$r->log->debug("manage_cache: username=$user_sent");
# The required patch was not introduced in 1.26. It is no longer
# promised to be included in any timeframe. Commenting out.
# unless ($mod_perl::VERSION > 1.25) {
# The below test is dubious. I'm putting it in as a hack around the
# problems with set_handlers not working quite right until 1.26 is
# released (according to Doug MacEachern).
my $cache_result = $r->notes('AuthenCache');
if ($cache_result eq 'hit') {
$r->log->debug("manage_cache: upstream cache hit for username=",
"$user_sent");
return OK;
# }
( run in 0.755 second using v1.01-cache-2.11-cpan-df04353d9ac )