"Fossies" - the Fresh Open Source Software Archive

Member "mod_perl-2.0.11/t/hooks/TestHooks/authen_digest.pm" (5 Oct 2019, 1041 Bytes) of package /linux/www/apache_httpd_modules/mod_perl-2.0.11.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "authen_digest.pm": 2.0.8_vs_2.0.9.

    1 # please insert nothing before this line: -*- mode: cperl; cperl-indent-level: 4; cperl-continued-statement-offset: 4; indent-tabs-mode: nil -*-
    2 package TestHooks::authen_digest;
    3 
    4 use strict;
    5 use warnings FATAL => 'all';
    6 
    7 use Apache2::Access ();
    8 use Apache2::RequestRec ();
    9 
   10 use Apache2::Const -compile => qw(OK HTTP_UNAUTHORIZED);
   11 
   12 sub handler {
   13 
   14     my $r = shift;
   15 
   16     # we don't need to do the entire Digest auth round
   17     # trip just to see if note_digest_auth_failure is
   18     # functioning properly - see authen_digest.t for the
   19     # header checks
   20     if ($r->args) {
   21         $r->note_digest_auth_failure;
   22         return Apache2::Const::HTTP_UNAUTHORIZED;
   23     }
   24 
   25     $r->user("user");
   26     $r->ap_auth_type("Digest");
   27 
   28     return Apache2::Const::OK;
   29 }
   30 
   31 1;
   32 __DATA__
   33 <NoAutoConfig>
   34 <Location /TestHooks__authen_digest>
   35     PerlAuthenHandler TestHooks::authen_digest
   36     PerlResponseHandler Apache::TestHandler::ok
   37     SetHandler modperl
   38 
   39     require valid-user
   40     AuthType Digest
   41     AuthName "Simple Digest"
   42 </Location>
   43 </NoAutoConfig>