Ignore:
Timestamp:
29/11/06 17:30:23 (14 years ago)
Author:
pjkersha
Message:

ndg.security.server/setup.py: added 4Suite url to dependency links
server/SessionMgr/server-config.tac: minor reformatting
test/SessionMgrClientTest.py, common/SessionMgr/init.py: added WS-Security Signature handler code.
common/wsSecurity.py: WS-Security module as used in WebSphere? testing. will need refactoring to
use ZSI pyclass code generated from WS-Security schema.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/SessionMgrClientTest.py

    r1783 r1784  
    3232 
    3333        testConfig = {} 
    34         testConfig['smURI'] = 'https://localhost:5000/SessionManager' 
    35         testConfig['aaURI'] = 'https://localhost:5700/AttributeAuthority' 
     34        testConfig['smURI'] = 'https://gabriel.bnsc.rl.ac.uk/SessionManager'#'https://localhost:5700/SessionManager' 
     35        testConfig['aaURI'] = 'https://localhost:5000/AttributeAuthority' 
    3636 
    3737         
     
    4747        # If no public key is set, it will be retrieved using the 
    4848        # getCert WS method 
    49         testConfig['smCertFilePath'] = None 
    50  
    51         testConfig['clntPriKeyPwd'] = None#open("./tmp3").read().strip() 
    52  
    53         testConfig['clntCertFilePath'] = None#"./Junk-cert.pem" 
    54         testConfig['clntPriKeyFilePath'] = None#"./Junk-key.pem" 
     49        testConfig['smCertFilePath'] = '../../../../Tests/webSphereTestcert.pem' 
     50 
     51        testConfig['clntPriKeyPwd'] = open("./tmp3").read().strip() 
     52 
     53        testConfig['clntCertFilePath'] = None 
     54        testConfig['clntPriKeyFilePath'] = '../../../../Tests/webSphereTestkey.pem' 
    5555         
    5656         
     
    9696        #self.config = glueConfig 
    9797 
    98          
    99         self.__clntPriKeyPwd = self.config['clntPriKeyPwd'] 
    10098        tracefile = sys.stderr 
    10199         
     
    106104                        clntCertFilePath=self.config['clntCertFilePath'], 
    107105                        clntPriKeyFilePath=self.config['clntPriKeyFilePath'], 
     106                        clntPriKeyPwd=self.config['clntPriKeyPwd'], 
    108107                        tracefile=tracefile)  
    109108         
     
    118117        # explicitly as a string use the 'pPhrase' keyword instead 
    119118        self.clnt.addUser(self.config['newUserName'],  
    120                           pPhrase=self.config['newUsernamePPhrase'], 
    121                           clntPriKeyPwd=self.__clntPriKeyPwd) 
     119                          pPhrase=self.config['newUsernamePPhrase']) 
    122120        print "Added user '%s'" % self.config['newUserName'] 
    123121         
     
    126124        """testCookieConnect: Connect as if acting as a browser client -  
    127125        a cookie is returned""" 
    128          
     126        #import pdb;pdb.set_trace() 
    129127        # Note the pass-phrase is read from the file tmp.  To pass 
    130128        # explicitly as a string use the 'pPhrase' keyword instead 
    131129        sSessCookie = self.clnt.connect(self.config['userName'],  
    132                                     pPhrase=self.config['userNamePPhrase'], 
    133                                     clntPriKeyPwd=self.__clntPriKeyPwd) 
     130                                    pPhrase=self.config['userNamePPhrase']) 
    134131 
    135132        self.sessCookie = SessionCookie(sSessCookie) 
     
    145142                                      pPhrase=self.config['userNamePPhrase'], 
    146143                                      createServerSess=True, 
    147                                       getCookie=False, 
    148                                       clntPriKeyPwd=self.__clntPriKeyPwd) 
     144                                      getCookie=False) 
    149145        print "User '%s' connected to Session Manager:\n%s" % \ 
    150146            (self.config['userName'], self.proxyCert) 
     
    172168 
    173169    def testCookieReqAuthorisation(self): 
     170        """testCookieReqAuthorisation: make an authorisation request using 
     171        a cookie as authentication credential""" 
     172         
     173        self.testCookieConnect() 
     174        resp = self.clnt.reqAuthorisation(\ 
     175                        sessID=self.sessCookie.sessionID,  
     176                        attAuthorityURI=self.config['aaURI'], 
     177                        encrSessionMgrURI=self.sessCookie.encrSessionMgrURI) 
     178           
     179        print resp 
     180 
     181 
     182    def testCookieReqAuthorisationWithExtAttCertList(self): 
    174183        """testCookieReqAuthorisation: make an authorisation request using 
    175184        a cookie as authentication credential""" 
     
    180189                        attAuthorityURI=self.config['aaURI'], 
    181190                        encrSessionMgrURI=self.sessCookie.encrSessionMgrURI, 
    182                         clntPriKeyPwd=self.__clntPriKeyPwd) 
    183            
    184         print resp 
    185  
    186  
    187     def testCookieReqAuthorisationWithExtAttCertList(self): 
    188         """testCookieReqAuthorisation: make an authorisation request using 
    189         a cookie as authentication credential""" 
    190          
    191         self.testCookieConnect() 
    192         resp = self.clnt.reqAuthorisation(\ 
    193                         sessID=self.sessCookie.sessionID,  
    194                         attAuthorityURI=self.config['aaURI'], 
    195                         encrSessionMgrURI=self.sessCookie.encrSessionMgrURI, 
    196                         extAttCertList=['AC1', 'AC2', 'AC3'], 
    197                         clntPriKeyPwd=self.__clntPriKeyPwd) 
     191                        extAttCertList=['AC1', 'AC2', 'AC3']) 
    198192           
    199193        print resp 
     
    208202        # using the proxyCert returned from connect() 
    209203        resp = self.clnt.reqAuthorisation(proxyCert=self.proxyCert, 
    210                                          attAuthorityURI=self.config['aaURI'], 
    211                                          clntPriKeyPwd=self.__clntPriKeyPwd) 
     204                                         attAuthorityURI=self.config['aaURI']) 
    212205                                              
    213206        print resp 
Note: See TracChangeset for help on using the changeset viewer.