[mod_python] AuthHandler to restrict ip adress only (no need to ask user for a password)

okparanoid okparanoid at free.fr
Sun Sep 28 07:09:39 EDT 2008


Hello !

I want to write a python program to restrict the access of urls by IP 
adress.

I have an authorize_access table in a Database with values : ip, 
datetime, url
this table is dynamically felt by an other program.

The need is that my python handle apache to choose if the url requested 
by an IP owner is authorized for this owner or not by matching the 3 
values correspond (ip, url, date) in the authorize_access table.

In fact this url correspond to dav documents.

The problem I have with Python Auth Handler is that, if I have well 
understand, it's only called with the apache directive "require valid user".
As a result apache ask the user for a couple login/password who is not 
needed in my case because my authHandler only take care of the adress ip.

Is there a solution to restrict access by ip without the need to prompt 
the user for login/password, by using mod_python or mod_wsgi ?

Cheers


More information about the Mod_python mailing list