Changeset 2086


Ignore:
Timestamp:
31/01/07 17:16:51 (12 years ago)
Author:
pjkersha
Message:

python/ndg.security.server/ndg/security/server/SessionMgr/server-config.tac:
leave out debug statements

python/ndg.security.test/ndg/security/test/AttAuthority/siteBMapConfig.xml:
give a sensible setting to Site A's AA URI so that mapped AC generatino can be tested.

python/ndg.security.test/ndg/security/test/AttAuthority/attAuthorityClientTest.cfg:
included note to the effect that the URI for setUp section must agree with
siteBMapConfig.xml's Site A setting.

python/ndg.security.test/ndg/security/test/SessionMgr/SessionMgrClientTest.py:
fixed output tuples for getAttCert tests.

python/ndg.security.common/ndg/security/common/CredWallet.py:

  • convert extAttCert to string before call AttAuthorityClient? web service.
  • fixed block in getAttCert method to get an AC from a trusted host
Location:
TI12-security/trunk/python
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • TI12-security/trunk/python/ndg.security.common/ndg/security/common/CredWallet.py

    r2085 r2086  
    621621        be used to making a mapping should the user not be registered with the 
    622622        Attribute Authority""" 
    623              
     623           
     624        if extAttCert is not None: 
     625            extAttCert = extAttCert.toString() 
     626               
    624627        if self.__aaClnt is not None: 
    625628            try: 
     
    630633             
    631634            except Exception, e: 
    632                 raise CredWalletError, \ 
    633                         "Attribute Certificate request denied: %s" % str(e) 
     635                raise CredWalletError, str(e) 
    634636                             
    635637        elif aaPropFilePath is not None: 
     
    649651                 
    650652            except AttAuthorityAccessDenied, e: 
    651                 raise CredWalletAttributeRequestDenied, \ 
    652                                 "Attribute Certificate request denied: %s" % e             
     653                raise CredWalletAttributeRequestDenied, str(e)             
    653654            except Exception, e: 
    654655                raise CredWalletError,"Requesting attribute certificate: %s"%e 
     
    935936                                                     
    936937                 
    937             # Request Authorisation from Attribute Authority 
     938            # Request Attribute Certificate from Attribute Authority 
    938939            try: 
    939940                attCert = self.__getAttCert(extAttCert=extAttCert)                 
     
    10071008                    # Try each host in turn in order to get a certificate with 
    10081009                    # the required credentials in order to do a mapping 
    1009                     for key, val in trustedHostInfo.items(): 
    1010  
     1010                    for host, info in trustedHostInfo.items(): 
    10111011                        try: 
    1012                             extAttCert=self.__getAttCert(aaURI=val['aaURI']) 
     1012                            # Try request to trusted host 
     1013                            self.aaURI = info['aaURI'] 
     1014                            extAttCert=self.__getAttCert() 
    10131015 
    10141016                            # Check the certificate contains at least one of 
    10151017                            # the required roles 
    10161018                            roles = extAttCert.getRoles() 
    1017                             if [True for r in roles if r in val['role']]: 
     1019                            if [True for r in roles if r in info['role']]: 
    10181020                               extAttCertList.append(extAttCert) 
    10191021 
  • TI12-security/trunk/python/ndg.security.server/ndg/security/server/SessionMgr/server-config.tac

    r2085 r2086  
    4545 
    4646    def soap_connect(self, ps, **kw): 
    47         import pdb;pdb.set_trace() 
     47        #import pdb;pdb.set_trace() 
    4848        request, response = SessionMgrService.soap_connect(self, ps) 
    4949 
     
    6464 
    6565    def soap_getAttCert(self, ps, **kw): 
    66         import pdb;pdb.set_trace() 
     66        #import pdb;pdb.set_trace() 
    6767        request, response = SessionMgrService.soap_getAttCert(self, ps) 
    6868         
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/AttAuthority/attAuthorityClientTest.cfg

    r2051 r2086  
    88# version 1.0 or later. 
    99[setUp] 
     10# ! SiteBMapConfig.xml trusted site A aaURI setting must agree with this  
     11# setting for test6GetMappedAttCert 
    1012uri = http://localhost:5000/AttributeAuthority 
    1113 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/AttAuthority/siteBMapConfig.xml

    r2044 r2086  
    22<AAmap> 
    33        <thisHost name="Site B"> 
    4             <aaURI>thisHostAttAuthorityURI</aaURI> 
     4            <aaURI>http://localhost:5100/AttributeAuthority</aaURI> 
    55            <loginURI>thisHostLoginPageURI</loginURI> 
    66        </thisHost> 
    77    <trusted name="Site A"> 
    8             <aaURI>attAuthorityURI</aaURI> 
     8            <aaURI>http://localhost:5000/AttributeAuthority</aaURI> 
    99            <loginURI>loginPageURI</loginURI> 
    1010                <role remote="postdoc" local="researcher"/> 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/SessionMgr/SessionMgrClientTest.py

    r2085 r2086  
    212212        self.test2CookieConnect() 
    213213         
    214         attCert, statusCode, msg, extAttCertList = self.clnt.getAttCert(\ 
     214        attCert, extAttCertList = self.clnt.getAttCert(\ 
    215215            sessID=self.sessCookie.sessionID,  
    216216            encrSessionMgrURI=self.sessCookie.encrSessionMgrURI, 
     
    218218         
    219219        print "Attribute Certificate:\n%s" % attCert   
    220         print "Status: %s" % statusCode 
    221         print "Message: %s" % msg 
    222220        print "External Attribute Certificate List:\n%s" % extAttCertList 
    223221 
     
    233231            self.cfg['test6cCookieGetAttCertWithExtAttCertList']['aauri'] 
    234232             
    235         attCert, statusCode, msg, extAttCertList = self.clnt.getAttCert(\ 
     233        attCert, extAttCertList = self.clnt.getAttCert(\ 
    236234                        sessID=self.sessCookie.sessionID,  
    237235                        encrSessionMgrURI=self.sessCookie.encrSessionMgrURI, 
     
    240238           
    241239        print "Attribute Certificate:\n%s" % attCert   
    242         print "Status: %s" % statusCode 
    243         print "Message: %s" % msg 
    244240        print "External Attribute Certificate List:\n%s" % extAttCertList 
    245241 
     
    255251         
    256252        aaURI = self.cfg['test7ProxyCertGetAttCert']['aauri'] 
    257         attCert, statusCode, msg, extAttCertList = self.clnt.getAttCert(\ 
     253        attCert, extAttCertList = self.clnt.getAttCert(\ 
    258254                                                 proxyCert=self.proxyCert, 
    259255                                                 attAuthorityURI=aaURI) 
    260256           
    261257        print "Attribute Certificate:\n%s" % attCert   
    262         print "Status: %s" % statusCode 
    263         print "Message: %s" % msg 
    264258        print "External Attribute Certificate List:\n%s" % extAttCertList 
    265259 
Note: See TracChangeset for help on using the changeset viewer.