Issue Details (XML | Word | Printable)

Key: MODPYTHON-27
Type: New Feature New Feature
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Graham Dumpleton
Reporter: Graham Dumpleton
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
mod_python

mod_python.publisher authentication

Created: 05/Mar/05 12:07 PM   Updated: 02/Apr/07 11:13 AM
Return to search
Component/s: publisher
Affects Version/s: 3.1.4
Fix Version/s: 3.3.1

Time Tracking:
Not Specified

Resolution Date: 07/Mar/06 06:51 PM


 Description  « Hide
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
      else:
        # 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.



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
No work has yet been logged on this issue.