Andrew Ho wrote:

> Hello,
> 
> GY>well, it's an API in that it doesn't do anything for you except provide
> GY>an API. meaning, I'd expect Apache::AuthDigest to work as so:
> GY>
> GY>PerlAuthenHandler Apache::AuthDigest
> GY>
> GY>all this module does is provide methods that parallel
> GY>$r->get_basic_auth_pw() and $r->note_basic_auth_failure - you need to
> GY>use the methods yourself to build an actual authentication mechanism.
> 
> I just commented this because it would make more sense to me as someone
> looking to implement digest authentication in Perl if an
> Apache::AuthDigest module existed which WAS useable directly as a
> PerlAuthenHandler (with a configuration API identical or similar to
> mod_digest.c), and the API came bundled with it if you wanted to use it
> directly.


hmmm.  ok, lemme think on that.  in general, I don't think there are 
many mod_perl modules out there that re-implement default Apache 
functionality, so it was never my intent to redo mod_digest in Perl.

also, all of the other Apache::Auth* modules seem to be specific 
authentication schemes (Raduis, SMB, DBI, etc).  what I was trying to do 
was create a way for people to be able to do the same thing for Digest 
auth, since there is no way now.  hence the API designation - I'm really 
just extending the mod_perl API proper here...


> 
> I could imagine there being a different namespace (I want the methods, so
> I use Apache::AuthDigest::API), 


ok.

> or Deep Perl Magick (when I use
> Apache::AuthDigest::API in a handler or an Apache::Registry script,
> $r->note_basic_auth_failure() suddenly just works because someone mucked
> with Apache's namespace), or some permutation thereof (when I have
> Apache::AuthDigest as a PerlAuthenHandler, $r->note_basic_auth_failure()  
> just works in any associated mod_perl handlers or scripts).


yucko.  personally I hate action-at-a-distance behaviors.


> 
> That would mean that you could just download one package, with a name one
> would expect when asking the question "how can I implement digest
> authentication in a mod_perl enabled server without recompiling Apache?"
> 
> On a totally different note, I can't seem to get this module to load
> properly at build time:
> 
>     % perl Makefile.PL
>     % make
>     % perl -Mblib -MApache::DigestAPI -e0


I'll look more closely at this tomorrow, but I don't expect that would 
ever work, as note_digest_auth_failure() is really part of the Apache 
API (stolen via XS) and needs a real request object.

try

$ make test

and see if the live tests (via Apache::Test) work.

(a good time to check out the httpd-test project, no? :)


>     Can't locate loadable object for module Apache::DigestAPI in @INC (@INC 
>contains: /home/andrew/install/pm/Apache-DigestAPI-0.01/blib/arch 
>/home/andrew/install/pm/Apache-DigestAPI-0.01/blib/lib 
>/usr/libdata/perl5/i386-openbsd/5.6.1 /usr/local/libdata/perl5/i386-openbsd/5.6.1 
>/usr/libdata/perl5 /usr/local/libdata/perl5 
>/usr/local/libdata/perl5/site_perl/i386-openbsd 
>/usr/libdata/perl5/site_perl/i386-openbsd /usr/local/libdata/perl5/site_perl 
>/usr/libdata/perl5/site_perl /usr/local/lib/perl5/site_perl .) at -e line 0
> 
> This is on OpenBSD 3.1, with Perl 5.6.1. After installing the module
> anyway and trying it inside mod_perl itself, I get a similar error in the
> server error_log:
> 
>     [Thu May 23 14:21:30 2002] [error] Can't locate loadable object for module 
>Apache::DigestAPI in @INC (@INC contains: 
>/home/andrew/pm/Zeuscat-Addressbook/blib/arch 
>/home/andrew/pm/Zeuscat-Addressbook/blib/lib 
>/usr/local/encap/mod_perl-1.26/lib/site_perl/5.6.1/i386-openbsd 
>/usr/libdata/perl5/i386-openbsd/5.6.1 /usr/local/libdata/perl5/i386-openbsd/5.6.1 
>/usr/libdata/perl5 /usr/local/libdata/perl5 
>/usr/local/libdata/perl5/site_perl/i386-openbsd 
>/usr/libdata/perl5/site_perl/i386-openbsd /usr/local/libdata/perl5/site_perl 
>/usr/libdata/perl5/site_perl /usr/local/lib/perl5/site_perl . /home/andrew/httpd/ 
>/home/andrew/httpd/lib/perl) at 
>/var/www/htdocs/zeuscat.com/andrew/test/digest/digest.pl line 9
>     Compilation failed in require at 
>/var/www/htdocs/zeuscat.com/andrew/test/digest/digest.pl line 9.
>     BEGIN failed--compilation aborted at 
>/var/www/htdocs/zeuscat.com/andrew/test/digest/digest.pl line 9.


hmm.  I'll take a look.  I have no problem using it from either 
Apache::Test or my local installation, but I may have missed something 
simple.  I'm on linux, fwiw.  try copying the config in 
t/conf/extra.conf.in and see if that works - you may need to pre-load 
the module specifically via PerlModule and not a use in startup.pl...


> 
> I also note that during building, I end up with a Session.so in blib/arch,
> but after doing make install, Session.so disappears. There is also an
> DigestAPI.xs that gets copied into blib/lib/Apache, which seems fishy.


I have no idea on either count - I'm trusting ExtUtils::MakeMaker 
entirely here, which is really a pot of black magic.

anyway, as I said, I'll look more into it tomorrow.

thanks for the feedback, though.  much appreciated :)

--Geoff

Reply via email to