quetz-mod_python-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Graham Dumpleton (JIRA)" <j...@apache.org>
Subject [jira] Created: (MODPYTHON-27) mod_python.publisher authentication
Date Sat, 05 Mar 2005 03:17:48 GMT
mod_python.publisher authentication

         Key: MODPYTHON-27
         URL: http://issues.apache.org/jira/browse/MODPYTHON-27
     Project: mod_python
        Type: New Feature
  Components: publisher  
    Versions: 3.1.4    
    Reporter: Graham Dumpleton
    Priority: Minor

The documentation for mod_python.publisher gives that more specific authentication
check can be performed on a function by using code:

def sensitive(req):

   def __auth__(req, user, password):
      if user == 'spam' and password == 'eggs':
        # let them in
        return 1
        # no access
        return 0

   # something involving sensitive information
   return 'sensitive information`

Ie., authentication function can be nested inside the actual function.

This only works for functions and not methods of a class. Thus, code could be enhanced
to allow it to work for MethodType as well as FunctionType. Method that needs to be
changed is process_auth() and it simply needs to track through im_func to get to the
func_code member.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
If you want more information on JIRA, or have a bug to report see:

View raw message