Changeset 4392


Ignore:
Timestamp:
29/10/08 11:49:44 (11 years ago)
Author:
pjkersha
Message:

Rerun Credential Wallet and AA client unittests with refactored WSDL stubs in place.

Location:
TI12-security/trunk/python
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • TI12-security/trunk/python/Tests/AttAuthority/AttAuthorityClient.py

    r4377 r4392  
    33#from twisted.internet import reactor 
    44 
    5 from ndg.security.common.zsi.attributeauthority.AttAuthority_services import AttAuthorityServiceLocator 
     5from ndg.security.common.zsi.attributeauthority.AttributeAuthority_services import AttributeAuthorityServiceLocator 
    66 
    77def main(**kw): 
    8     locator = AttAuthorityServiceLocator() 
    9     port = locator.getAttAuthority(**kw) 
     8    locator = AttributeAuthorityServiceLocator() 
     9    port = locator.getAttributeAuthority(**kw) 
    1010    import pdb;pdb.set_trace() 
    1111    attCert = port.getAttCert("USER CERT") 
     
    1515    #response = port.create(CLIENT.CreateRequest()) 
    1616    #kw['endPointReference'] = response._EndpointReference 
    17     #iport = locator.getAttAuthority(**kw) 
     17    #iport = locator.getAttributeAuthority(**kw) 
    1818#    reactor.stop() 
    1919 
  • TI12-security/trunk/python/Tests/AttAuthority/AttAuthorityServer.py

    r4377 r4392  
    1212 
    1313# Import the generated Server Object 
    14 from ndg.security.common.zsi.attributeauthority.AttAuthority_services_server import AttAuthorityService 
     14from ndg.security.common.zsi.attributeauthority.AttributeAuthority_services_server import AttributeAuthorityService 
    1515 
    1616     
     
    2626     def do_GET(self): 
    2727         """Return the WSDL file."""          
    28          self.send_xml(AttAuthorityService._wsdl) 
     28         self.send_xml(AttributeAuthorityService._wsdl) 
    2929          
    3030     def do_POST(self): 
     
    3333          the wsdl e.g. http://glue.badc.rl.ac.uk/sessionMgr points to the 
    3434          default port for the Session Manager.""" 
    35           self.path = "/AttAuthorityServIn" 
     35          self.path = "/AttributeAuthorityServIn" 
    3636          SOAPRequestHandler.do_POST(self) 
    3737    
    38 class AttributeAuthorityImpl(AttAuthorityService): 
     38class AttributeAuthorityImpl(AttributeAuthorityService): 
    3939 
    4040     def soap_getAttCert(self, ps, **kw): 
    4141         #import pdb;pdb.set_trace() 
    42          response = AttAuthorityService.soap_getAttCert(self, ps) 
     42         response = AttributeAuthorityService.soap_getAttCert(self, ps) 
    4343         response.set_element_attCert('ATTRIBUTE CERT') 
    4444         return response 
     
    5252import sys 
    5353service = AttributeAuthorityImpl() 
    54 serviceContainer.setNode(service, url="/AttAuthorityServIn") 
     54serviceContainer.setNode(service, url="/AttributeAuthorityServIn") 
    5555 
    5656try: 
  • TI12-security/trunk/python/Tests/AttAuthority/twistedClnt/AttAuthorityClient.py

    r4377 r4392  
    55import sys 
    66 
    7 from ndg.security.common.zsi.attributeauthority.AttAuthority_services import AttAuthorityServiceLocator 
     7from ndg.security.common.zsi.attributeauthority.AttributeAuthority_services import AttributeAuthorityServiceLocator 
    88 
    99def main(**kw): 
    10     locator = AttAuthorityServiceLocator() 
    11     port = locator.getAttAuthority(**kw) 
     10    locator = AttributeAuthorityServiceLocator() 
     11    port = locator.getAttributeAuthority(**kw) 
    1212    import pdb;pdb.set_trace() 
    1313    attCert = port.getAttCert("USER CERT") 
     
    1717    #response = port.create(CLIENT.CreateRequest()) 
    1818    #kw['endPointReference'] = response._EndpointReference 
    19     #iport = locator.getAttAuthority(**kw) 
     19    #iport = locator.getAttributeAuthority(**kw) 
    2020    reactor.stop() 
    2121 
  • TI12-security/trunk/python/Tests/pylonsAttributeAuthority/ndgsecurity/ndgsecurity/config/attributeauthority.py

    r4377 r4392  
    55 
    66 
    7 from ndg.security.server.attributeauthority.AttAuthority_services_server import \ 
    8         AttAuthorityService as _AttAuthorityService 
     7from ndg.security.server.attributeauthority.AttributeAuthority_services_server import \ 
     8        AttributeAuthorityService as _AttributeAuthorityService 
    99 
    1010from ndg.security.server.attributeauthority import AttributeAuthority, \ 
     
    1616 
    1717 
    18 class AttributeAuthorityWS(_AttAuthorityService): 
     18class AttributeAuthorityWS(_AttributeAuthorityService): 
    1919 
    2020    def __init__(self): 
     
    4343                pdb.set_trace() 
    4444                 
    45         request, response = _AttAuthorityService.soap_getAttCert(self, ps) 
     45        request, response = _AttributeAuthorityService.soap_getAttCert(self, ps) 
    4646 
    4747        # Derive designated holder cert differently according to whether 
     
    7979                pdb.set_trace() 
    8080                 
    81         request, response = _AttAuthorityService.soap_getHostInfo(self, ps) 
     81        request, response = _AttributeAuthorityService.soap_getHostInfo(self, ps) 
    8282         
    8383        response.Hostname = self.aa.hostInfo.keys()[0] 
     
    104104                pdb.set_trace() 
    105105                 
    106         request, response = _AttAuthorityService.soap_getAllHostsInfo(self, ps) 
     106        request, response = _AttributeAuthorityService.soap_getAllHostsInfo(self, ps) 
    107107         
    108108 
     
    159159                 
    160160        request, response = \ 
    161                         _AttAuthorityService.soap_getTrustedHostInfo(self, ps) 
     161                        _AttributeAuthorityService.soap_getTrustedHostInfo(self, ps) 
    162162         
    163163        trustedHostInfo = self.aa.getTrustedHostInfo(role=request.Role) 
     
    194194                pdb.set_trace() 
    195195                 
    196         request, response = _AttAuthorityService.soap_getX509Cert(self, ps) 
     196        request, response = _AttributeAuthorityService.soap_getX509Cert(self, ps) 
    197197         
    198198        x509Cert = X509CertRead(self.aa['signingCertFilePath']) 
  • TI12-security/trunk/python/ndg.security.common/ndg/security/common/attributeauthority.py

    r4384 r4392  
    3232from ZSI.wstools.Utility import HTTPResponse 
    3333 
    34 from ndg.security.common.zsi.attributeauthority.AttAuthority_services import \ 
    35     AttAuthorityServiceLocator 
     34from ndg.security.common.zsi.attributeauthority.AttributeAuthority_services import \ 
     35    AttributeAuthorityServiceLocator 
    3636from ndg.security.common.wssecurity.dom import SignatureHandler 
    3737from ndg.security.common.AttCert import AttCert, AttCertParse 
     
    271271        # WS-Security Signature handler object is passed to binding 
    272272        try: 
    273             locator = AttAuthorityServiceLocator() 
    274             self.__srv = locator.getAttAuthority(self.__uri,  
     273            locator = AttributeAuthorityServiceLocator() 
     274            self.__srv = locator.getAttributeAuthority(self.__uri,  
    275275                                         sig_handler=self.__signatureHandler, 
    276276                                         tracefile=self.__tracefile, 
  • TI12-security/trunk/python/ndg.security.common/ndg/security/common/credentialwallet.py

    r4379 r4392  
    2424 
    2525# Access Attribute Authority's web service using ZSI - allow pass if not  
    26 # loaded since it's possible to make AttAuthority instance locally without  
     26# loaded since it's possible to make AttributeAuthority instance locally without  
    2727# using the WS 
    2828aaImportError = True 
    2929try: 
    30     # AttAuthority client package resides with CredentialWallet module in  
     30    # AttributeAuthority client package resides with CredentialWallet module in  
    3131    # ndg.security.common 
    32     from ndg.security.common.attributeauthority import AttributeAuthorityClient, \ 
    33         AttributeAuthorityClientError, AttributeRequestDenied, \ 
    34         NoMatchingRoleInTrustedHosts 
     32    from ndg.security.common.attributeauthority import \ 
     33        AttributeAuthorityClient, AttributeAuthorityClientError, \ 
     34        AttributeRequestDenied, NoMatchingRoleInTrustedHosts 
    3535    aaImportError = False 
    3636except ImportError: 
     
    3838    pass 
    3939 
    40 # Likewise - may not want to use WS and use AttributeAuthority locally in which case 
    41 # no need to import it 
     40# Likewise - may not want to use WS and use AttributeAuthority locally in which 
     41# case no need to import it 
    4242try: 
    4343    from ndg.security.server.attributeauthority import AttributeAuthority, \ 
     
    4545    aaImportError = False 
    4646except: 
    47     log.warning('Loading CredentialWallet without Attribute Authority interface ' 
    48                 'imports') 
     47    log.warning('Loading CredentialWallet without Attribute Authority ' 
     48                'interface imports') 
    4949    pass 
    5050 
    5151if aaImportError: 
    52     raise ImportError("Either AttributeAuthority or AttributeAuthorityClient classes must " 
    53                       "be present to allow interoperation with Attribute " 
    54                       "Authorities") 
     52    raise ImportError("Either AttributeAuthority or AttributeAuthorityClient " 
     53                      "classes must be present to allow interoperation with " 
     54                      "Attribute Authorities") 
    5555 
    5656# Authentication X.509 Certificate 
     
    6868 
    6969class _CredentialWalletException(Exception):     
    70     """Generic Exception class for CredentialWallet module.  Overrides Exception to  
    71     enable writing to the log""" 
     70    """Generic Exception class for CredentialWallet module.  Overrides  
     71    Exception to enable writing to the log""" 
    7272    def __init__(self, msg): 
    7373        log.error(msg) 
     
    156156 
    157157 
    158 # CredentialWallet is a 'new-style' class inheriting from "object" and making use 
    159 # of new Get/Set methods for hiding of attributes 
     158# CredentialWallet is a 'new-style' class inheriting from "object" and making  
     159# use of new Get/Set methods for hiding of attributes 
    160160class CredentialWallet(object): 
    161161    """Volatile store of user credentials associated with a user session 
     
    329329        from 
    330330        @type cfgPrefix: basestring 
    331         @param cfgPrefix: apply a prefix to all CredentialWallet config params so  
    332         that if placed in a file with other parameters they can be  
     331        @param cfgPrefix: apply a prefix to all CredentialWallet config params  
     332        so that if placed in a file with other parameters they can be  
    333333        distinguished 
    334334        @type cfgKw: dict 
  • TI12-security/trunk/python/ndg.security.server/ndg/security/server/zsi/attributeauthority/__init__.py

    r4377 r4392  
    1616log = logging.getLogger(__name__) 
    1717 
    18 from ndg.security.common.zsi.attributeauthority.AttAuthority_services import \ 
     18from ndg.security.common.zsi.attributeauthority.AttributeAuthority_services import \ 
    1919    getAttCertInputMsg, getAttCertOutputMsg, \ 
    2020    getHostInfoInputMsg, getHostInfoOutputMsg, \ 
     
    2323    getX509CertInputMsg, getX509CertOutputMsg 
    2424     
    25 from ndg.security.server.zsi.attributeauthority.AttAuthority_services_server \ 
    26     import AttAuthorityService as _AttAuthorityService 
     25from ndg.security.server.zsi.attributeauthority.AttributeAuthority_services_server \ 
     26    import AttributeAuthorityService as _AttributeAuthorityService 
    2727 
    2828from ndg.security.server.attributeauthority import AttributeAuthority, \ 
     
    3333 
    3434 
    35 class AttributeAuthorityWS(_AttAuthorityService): 
     35class AttributeAuthorityWS(_AttributeAuthorityService): 
    3636    '''Attribute Authority ZSI SOAP Service Binding class''' 
    3737 
     
    5555        @type ps: ZSI ParsedSoap 
    5656        @param ps: client SOAP message 
    57         @rtype: ndg.security.common.zsi.attributeauthority.AttAuthority_services_types.getAttCertResponse_Holder 
     57        @rtype: ndg.security.common.zsi.attributeauthority.AttributeAuthority_services_types.getAttCertResponse_Holder 
    5858        @return: response''' 
    5959        if self.__debug: 
     
    6262         
    6363        request = ps.Parse(getAttCertInputMsg.typecode)     
    64         response = _AttAuthorityService.soap_getAttCert(self, ps) 
     64        response = _AttributeAuthorityService.soap_getAttCert(self, ps) 
    6565 
    6666        # Derive designated holder cert differently according to whether 
     
    102102            pdb.set_trace() 
    103103             
    104         response = _AttAuthorityService.soap_getHostInfo(self, ps) 
     104        response = _AttributeAuthorityService.soap_getHostInfo(self, ps) 
    105105         
    106106        response.Hostname = self.aa.hostInfo.keys()[0] 
     
    127127            pdb.set_trace() 
    128128             
    129         response = _AttAuthorityService.soap_getAllHostsInfo(self, ps) 
     129        response = _AttributeAuthorityService.soap_getAllHostsInfo(self, ps) 
    130130         
    131131 
     
    182182             
    183183        request = ps.Parse(getTrustedHostInfoInputMsg.typecode)     
    184         response = _AttAuthorityService.soap_getTrustedHostInfo(self, ps) 
     184        response = _AttributeAuthorityService.soap_getTrustedHostInfo(self, ps) 
    185185         
    186186        trustedHostInfo = self.aa.getTrustedHostInfo(role=request.Role) 
     
    217217            pdb.set_trace() 
    218218             
    219         response = _AttAuthorityService.soap_getX509Cert(self, ps) 
     219        response = _AttributeAuthorityService.soap_getX509Cert(self, ps) 
    220220         
    221221        x509Cert = X509CertRead(self.aa['signingCertFilePath']) 
  • TI12-security/trunk/python/ndg.security.server/ndg/security/server/zsi/twisted/attributeauthority/attAuthority.tac

    r4377 r4392  
    3737 
    3838from \ 
    39 ndg.security.server.zsi.twisted.attributeauthority.AttAuthority_services_server\ 
    40         import AttAuthorityService 
     39ndg.security.server.zsi.twisted.attributeauthority.SessionManager_services_server\ 
     40        import SessionManagerService 
    4141 
    4242from ndg.security.server.attributeauthority import AttributeAuthority, \ 
     
    8282                pdb.set_trace() 
    8383                 
    84         request, response = AttAuthorityService.soap_getAttCert(self, ps) 
     84        request, response = SessionManagerService.soap_getAttCert(self, ps) 
    8585 
    8686        # Derive designated holder cert differently according to whether 
     
    119119                pdb.set_trace() 
    120120                 
    121         request, response = AttAuthorityService.soap_getHostInfo(self, ps) 
     121        request, response = SessionManagerService.soap_getHostInfo(self, ps) 
    122122         
    123123        response.Hostname = srv.aa.hostInfo.keys()[0] 
     
    144144                pdb.set_trace() 
    145145                 
    146         request, response = AttAuthorityService.soap_getAllHostsInfo(self, ps) 
     146        request, response = SessionManagerService.soap_getAllHostsInfo(self, ps) 
    147147         
    148148 
     
    199199                 
    200200        request, response = \ 
    201                         AttAuthorityService.soap_getTrustedHostInfo(self, ps) 
     201                        SessionManagerService.soap_getTrustedHostInfo(self, ps) 
    202202         
    203203        trustedHostInfo = srv.aa.getTrustedHostInfo(role=request.Role) 
     
    234234                pdb.set_trace() 
    235235                 
    236         request, response = AttAuthorityService.soap_getX509Cert(self, ps) 
     236        request, response = AttributeAuthorityService.soap_getX509Cert(self, ps) 
    237237         
    238238        x509Cert = X509CertRead(srv.aa['signingCertFilePath']) 
Note: See TracChangeset for help on using the changeset viewer.