Ignore:
Timestamp:
08/06/06 15:28:07 (14 years ago)
Author:
spascoe
Message:

Authorisation in python is confirmed as working with 2 test cases.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI05-delivery/trunk/lib/python/delivery/server.py

    r1141 r1144  
    2323     
    2424    return bbftpd.run(authHandler, args) 
     25 
     26 
     27class AuthenticationFailure(Exception): 
     28    """Signals authentication failed. 
     29    """ 
     30    pass 
     31 
     32class AuthorisationFailure(Exception): 
     33    """Signals authorisation failed. 
     34    """ 
     35    pass 
     36 
    2537 
    2638 
     
    5769            see the state of the python interpreter as it was when start() was called. 
    5870 
    59         @return an AuthzHandler instance if authentication succeeds, else None. 
     71        @return an AuthzHandler instance if authentication succeeds.  Any false value is considered 
     72            an authorisation failure. 
    6073        """ 
    6174 
     
    7588        @param transferoption: extra options specified in the command. 
    7689        @param path: the file or directory to which the command applies. 
    77         @return: 0 on success or -1 on failure. 
     90        @return: bool for success or failure. 
    7891        """ 
    7992 
     
    8497 
    8598        @param path: the file being retrieved. 
    86         @return: 0 on success or -1 on failure. 
     99        @return: bool for success or failure. 
    87100        """ 
    88101 
     
    93106 
    94107        @param path: the destination file. 
    95         @return: 0 on success or -1 on failure. 
     108        @return: bool for success or failure. 
    96109        """ 
    97110 
     
    138151 
    139152    def authzControl(self, m, t, p): 
    140         return 0; 
     153        return True; 
    141154 
    142155    def authzRetr(self, p): 
    143         return 0; 
     156        return True; 
    144157 
    145158    def authzStore(self, p): 
    146         return 0; 
     159        return True; 
    147160     
Note: See TracChangeset for help on using the changeset viewer.