Changeset 941


Ignore:
Timestamp:
17/05/06 14:23:02 (13 years ago)
Author:
pjkersha
Message:

Tests/SecurityClientTest?.py: renamed test methods to be prefixed with 'test' so that they are
automatically called by default when the script is called with no args.

ndgSetup.sh: cosmetic changes

dist/NDG-Security-0.65.tar.gz: new distribution.

logs/ -> log/ renamed

setup.py: for new release 0.65

NDG/X509.py: fixed bugs - refs to wrong exception class names 'X509Error' and 'AttCertError?'

NDG/SecurityClient.py: AttAuthorityClient?.reqAuthorisation ref'd 'resp' instead of 'authResp'

NDG/Logging.py: fixed comment error

NDG/Session.py: fixed ref to SessionClient? - is now called SecurityClient?.

Location:
TI12-security/trunk/python
Files:
1 added
7 edited
1 moved

Legend:

Unmodified
Added
Removed
  • TI12-security/trunk/python/NDG/LogClient.py

    r921 r941  
    2121#_____________________________________________________________________________ 
    2222class LogClientError(Exception): 
    23     """Exception handling for SessionClient class""" 
     23    """Exception handling for Logging class""" 
    2424    def __init__(self, msg): 
    2525        self.__msg = msg 
  • TI12-security/trunk/python/NDG/SecurityClient.py

    r848 r941  
    700700             
    701701        if 'errMsg' in authResp and authResp['errMsg']: 
    702             raise AttAuthorityClientError(resp['errMsg']) 
     702            raise AttAuthorityClientError(authResp['errMsg']) 
    703703         
    704704        return authResp 
  • TI12-security/trunk/python/NDG/Session.py

    r930 r941  
    5050from NDG import AttAuthorityIO 
    5151 
    52 # Use client package to allow reidrection of authorisation requests 
    53 from NDG.SessionClient import * 
     52# Use client package to allow redirection of authorisation requests 
     53from NDG.SecurityClient import SessionClient 
     54from NDG.SecurityClient import SessionClientError 
    5455 
    5556# Use to pipe output from ZSI ServiceProxy 
  • TI12-security/trunk/python/NDG/X509.py

    r930 r941  
    254254 
    255255        if not isinstance(self.__dtNotBefore, datetime): 
    256             raise AttCertError("Not Before datetime is not set") 
     256            raise X509CertError("Not Before datetime is not set") 
    257257 
    258258        if not isinstance(self.__dtNotAfter, datetime): 
    259             raise AttCertError("Not After datetime is not set") 
     259            raise X509CertError("Not After datetime is not set") 
    260260        
    261261        dtNow = datetime.utcnow() 
     
    263263        if raiseExcep: 
    264264            if dtNow < self.__dtNotBefore: 
    265                 raise X509Error("Current time is before the " + \ 
    266                                 "certificate's Not Before Time") 
     265                raise X509CertError("Current time is before the " + \ 
     266                                    "certificate's Not Before Time") 
    267267             
    268268            elif dtNow > self.__dtNotAfter: 
    269                 raise X509Error("Certificate has expired") 
     269                raise X509CertError("Certificate has expired") 
    270270        else: 
    271271            return dtNow > self.__dtNotBefore and dtNow < self.__dtNotAfter 
  • TI12-security/trunk/python/Tests/SecurityClientTest.py

    r848 r941  
    2828        try: 
    2929            # Session Manager WSDL 
    30             smWSDL = 'http://gabriel.bnsc.rl.ac.uk/sessionMgr.wsdl' 
     30            smWSDL = 'http://glue.badc.rl.ac.uk/sessionMgr.wsdl' 
    3131     
    3232            # Public key of session manager used to encrypt requests 
     
    3939            clntPubKeyFilePath = "./Junk-cert.pem" 
    4040            clntPriKeyFilePath = "./Junk-key.pem" 
     41            traceFile = None#sys.stderr 
    4142             
    4243            # Initialise the Session Manager client connection 
     
    4647                                        clntPubKeyFilePath=clntPubKeyFilePath, 
    4748                                        clntPriKeyFilePath=clntPriKeyFilePath, 
    48                                         traceFile=sys.stderr)  
     49                                        traceFile=traceFile)  
    4950 
    5051            # Attribute Authority client tests 
     
    5657                                        clntPubKeyFilePath=clntPubKeyFilePath, 
    5758                                        clntPriKeyFilePath=clntPriKeyFilePath, 
    58                                         traceFile=sys.stderr)  
     59                                        traceFile=traceFile)  
    5960        except Exception, e: 
    6061            self.fail(str(e)) 
     
    6566 
    6667 
    67     def addUserTest(self): 
     68    def testAddUser(self): 
    6869         
    6970        userName = 'pjkersha' 
     
    163164 
    164165 
    165     def getPubKeyTest(self): 
     166    def testGetPubKey(self): 
    166167        try: 
    167168            # Request an attribute certificate from an Attribute Authority  
    168169            # using the proxyCert returned from connect() 
    169             import pdb 
    170             pdb.set_trace() 
    171170            pubKey = self.sessClnt.getPubKey() 
    172171                                                  
     
    177176            
    178177 
    179     def aaGetTrustedHostInfo(self): 
     178    def testAAgetTrustedHostInfo(self): 
    180179        """Call Attribute Authority GetTrustedHostInfo""" 
    181          
    182         import pdb 
    183         pdb.set_trace() 
    184180         
    185181        role = 'rapid' 
     
    194190            
    195191 
    196     def aaReqAuthorisation(self): 
     192    def testAAReqAuthorisation(self): 
    197193        """Call Attribute Authority authorisation request""" 
    198194         
    199195        import pdb 
    200196        pdb.set_trace() 
    201          
    202          
    203197        try: 
    204198            proxyCert = open("./proxy.pem").read().strip() 
     
    221215        map = map(SecurityClientTestCase, 
    222216                  ( 
    223                     "addUserTest", 
    224                     "connectTest", 
    225                     "reqAuthorisationTest", 
    226                     "getPubKeyTest", 
    227                     "aaGetTrustedHostInfo", 
    228                     "aaReqAuthorisation", 
     217                    "testAddUser", 
     218                    "testConnect", 
     219                    "testReqAuthorisation", 
     220                    "testGetPubKey", 
     221                    "testAAgetTrustedHostInfo", 
     222                    "testAAReqAuthorisation", 
    229223                  )) 
    230224        unittest.TestSuite.__init__(self, map) 
  • TI12-security/trunk/python/ndgSetup.sh

    r737 r941  
    5252 
    5353# Set DN explicitly to ensure match with server certificate 
    54 #export MYPROXY_SERVER_DN="<hostcert DN with '/' delimiters" 
     54#export MYPROXY_SERVER_DN="<hostcert DN with '/' delimiters>" 
    5555 
    5656 
  • TI12-security/trunk/python/setup.py

    r850 r941  
    1818{ 
    1919    'name':           'NDG-Security', 
    20     'version':        '0.64', 
     20    'version':        '0.65', 
    2121    'description':    'NERC DataGrid Security Utilities', 
    2222    'author':         'P J Kershaw', 
Note: See TracChangeset for help on using the changeset viewer.