RubyAuthzHandler not executing
"Ted B" <[email protected]> Tue, 27 Jun 2006 18:36:31 -0400
| Newsgroups | gmane.comp.apache.mod-ruby |
|---|---|
| Message-ID | <[email protected]> |
------=_Part_3528_1150979.1151447791545
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
I am trying to use mod_ruby's RubyAuthzHandler directive under Apache
2.0.52on Linux. The Ruby object referenced by this directive seems to
never get
invoked, although RubyAccessHandler and RubyAuthenHandler work great.
Below is the httpd.conf (excerpt) and Ruby class I'm trying to make work.
This is supposed to successfully pass the Access and Authentication stages,
and yield a Forbidden error in the Authorization stage. Instead, the
request goes through successfully. If I edit the Ruby file and change the
authenticate() method to return Apache::FORBIDDEN, the request does
correctly get forbidden.
The strange thing is, even if I completely comment-out the authorize()
method, no error occurs anywhere. If I did that for authenticate(), I get
"undefined method `authenticate'" in the server error log. It's as though
RubyAuthzHandler is unimplemented, but it does seem to be in the mod_ruby
source code.
Has anyone out there successfully used RubyAuthzHandler? Am I doing
something wrong? Thanks for any advice!
------------
<IfModule mod_ruby.c>
<Files *.html>
RubyAddPath /path/to/myauth
RubyRequire myauth
require valid-user
RubyAccessHandler MyAuth.instance
RubyAuthenHandler MyAuth.instance
RubyAuthzHandler MyAuth.instance
</Files>
</IfModule>
------------
require 'singleton'
class MyAuth
include Singleton
#function called via RubyAccessHandler
def check_access(req)
return Apache::OK
end
#function called via RubyAuthenHandler
def authenticate(req)
return Apache::OK
end
#function called via RubyAuthzHandler
def authorize(req)
return Apache::FORBIDDEN
end
end
------------
------=_Part_3528_1150979.1151447791545--