Changeset 4377


Ignore:
Timestamp:
29/10/08 10:26:30 (11 years ago)
Author:
pjkersha
Message:

Renamed Attribute Authority classes and reran unittests

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

Legend:

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

    r1696 r4377  
    33#from twisted.internet import reactor 
    44 
    5 from AttAuthority_services import AttAuthorityServiceLocator 
     5from ndg.security.common.zsi.attributeauthority.AttAuthority_services import AttAuthorityServiceLocator 
    66 
    77def main(**kw): 
  • TI12-security/trunk/python/Tests/AttAuthority/AttAuthorityServer.py

    r1696 r4377  
    11#!/usr/bin/env python 
    22# 
    3 # How to build an AttAuthority server using the extended code generation 
     3# How to build an AttributeAuthority server using the extended code generation 
    44# 
    55import sys 
     
    1212 
    1313# Import the generated Server Object 
    14 from AttAuthority_services_server import AttAuthorityService 
     14from ndg.security.common.zsi.attributeauthority.AttAuthority_services_server import AttAuthorityService 
    1515 
    1616     
     
    1818 
    1919#_____________________________________________________________________________ 
    20 class AttAuthoritySOAPRequestHandler(SOAPRequestHandler): 
     20class AttributeAuthoritySOAPRequestHandler(SOAPRequestHandler): 
    2121     """Add a do_GET method to return the WSDL on HTTP GET requests. 
    2222     Please note that the path to the wsdl file is derived from what 
     
    3636          SOAPRequestHandler.do_POST(self) 
    3737    
    38 class AttAuthorityImpl(AttAuthorityService): 
     38class AttributeAuthorityImpl(AttAuthorityService): 
    3939 
    4040     def soap_getAttCert(self, ps, **kw): 
     
    4646# Here we set up the server 
    4747serviceContainer = ServiceContainer(('localhost', 5700), 
    48                 RequestHandlerClass=AttAuthoritySOAPRequestHandler) 
     48                RequestHandlerClass=AttributeAuthoritySOAPRequestHandler) 
    4949 
    5050 
    5151# Create the Inherited version of the server 
    5252import sys 
    53 service = AttAuthorityImpl() 
     53service = AttributeAuthorityImpl() 
    5454serviceContainer.setNode(service, url="/AttAuthorityServIn") 
    5555 
  • TI12-security/trunk/python/Tests/AttAuthority/AttAuthority_services.py

    r1771 r4377  
    11##################################################  
    2 # AttAuthority_services.py  
     2# ndg.security.common.zsi.attributeauthority.AttAuthority_services.py  
    33# generated by ZSI.generate.wsdl2python 
    44################################################## 
    55 
    66 
    7 from AttAuthority_services_types import * 
     7from ndg.security.common.zsi.attributeauthority.AttAuthority_services_types import * 
    88import urlparse, types 
    99from ZSI.TCcompound import ComplexType, Struct 
  • TI12-security/trunk/python/Tests/AttAuthority/AttAuthority_services_server.py

    r1696 r4377  
    11################################################## 
    2 # AttAuthority_services_server.py 
     2# ndg.security.common.zsi.attributeauthority.AttAuthority_services_server.py 
    33#      Generated by ZSI.generate.wsdl2dispatch.DelAuthServiceModuleWriter 
    44# 
    55################################################## 
    66 
    7 from AttAuthority_services import * 
     7from ndg.security.common.zsi.attributeauthority.AttAuthority_services import * 
    88from ZSI.ServiceContainer import ServiceSOAPBinding 
    99 
  • TI12-security/trunk/python/Tests/AttAuthority/twistedClnt/AttAuthorityClient.py

    r1696 r4377  
    55import sys 
    66 
    7 from AttAuthority_services import AttAuthorityServiceLocator 
     7from ndg.security.common.zsi.attributeauthority.AttAuthority_services import AttAuthorityServiceLocator 
    88 
    99def main(**kw): 
  • TI12-security/trunk/python/Tests/AttAuthority/twistedClnt/AttAuthority_services.py

    r1696 r4377  
    55 
    66 
    7 from AttAuthority_services_types import * 
     7from ndg.security.common.zsi.attributeauthority.AttAuthority_services_types import * 
    88import urlparse, types 
    99from ZSI.TCcompound import ComplexType, Struct 
  • TI12-security/trunk/python/Tests/pylonsAttributeAuthority/ndgsecurity/ndgsecurity/config/attributeauthority.py

    r4369 r4377  
    88        AttAuthorityService as _AttAuthorityService 
    99 
    10 from ndg.security.server.attributeauthority import AttAuthority, \ 
    11         AttAuthorityAccessDenied 
     10from ndg.security.server.attributeauthority import AttributeAuthority, \ 
     11        AttributeAuthorityAccessDenied 
    1212         
    1313from ndg.security.common.X509 import X509Cert, X509CertRead 
     
    2929        # Initialize Attribute Authority class - property file will be 
    3030        # picked up from default location under $NDG_DIR directory 
    31         self.aa = AttAuthority() 
     31        self.aa = AttributeAuthority() 
    3232 
    3333 
     
    6262                response.AttCert = attCert.toString() 
    6363                 
    64         except AttAuthorityAccessDenied, e: 
     64        except AttributeAuthorityAccessDenied, e: 
    6565            response.Msg = str(e) 
    6666                         
  • TI12-security/trunk/python/ndg.security.common/ndg/security/common/CredWallet.py

    r4369 r4377  
    3030    # AttAuthority client package resides with CredWallet module in  
    3131    # ndg.security.common 
    32     from ndg.security.common.AttAuthority import AttAuthorityClient, \ 
    33         AttAuthorityClientError, AttributeRequestDenied, \ 
     32    from ndg.security.common.attributeauthority import AttributeAuthorityClient, \ 
     33        AttributeAuthorityClientError, AttributeRequestDenied, \ 
    3434        NoMatchingRoleInTrustedHosts 
    3535    aaImportError = False 
     
    3838    pass 
    3939 
    40 # Likewise - may not want to use WS and use AttAuthority locally in which case 
     40# Likewise - may not want to use WS and use AttributeAuthority locally in which case 
    4141# no need to import it 
    4242try: 
    43     from ndg.security.server.attributeauthority import AttAuthority, \ 
    44         AttAuthorityError, AttAuthorityAccessDenied 
     43    from ndg.security.server.attributeauthority import AttributeAuthority, \ 
     44        AttributeAuthorityError, AttributeAuthorityAccessDenied 
    4545    aaImportError = False 
    4646except: 
     
    5050 
    5151if aaImportError: 
    52     raise ImportError("Either AttAuthority or AttAuthorityClient classes must " 
     52    raise ImportError("Either AttributeAuthority or AttributeAuthorityClient classes must " 
    5353                      "be present to allow interoperation with Attribute " 
    5454                      "Authorities") 
     
    174174    @type attributeAuthorityURI: string 
    175175    @ivar attributeAuthorityURI: URI of Attribute Authority to make  
    176     requests to.  Setting this ALSO creates an AttAuthorityClient instance  
     176    requests to.  Setting this ALSO creates an AttributeAuthorityClient instance  
    177177    self._attributeAuthorityClnt.  - See attributeAuthorityURI property for 
    178178    details. (property attribute) 
    179179     
    180     @type attributeAuthority: ndg.security.server.attributeauthority.AttAuthority 
     180    @type attributeAuthority: ndg.security.server.attributeauthority.AttributeAuthority 
    181181    @ivar attributeAuthority: Attribute Authority to make requests to.   
    182182    attributeAuthorityURI takes precedence over this keyword i.e. if an 
     
    721721        @param attributeAuthorityURI: Attribute Authority Web Service URI. 
    722722 
    723         @rtype: ndg.security.common.AttAuthorityClient 
     723        @rtype: ndg.security.common.attributeauthority.AttributeAuthorityClient 
    724724        @return: new Attribute Authority client instance""" 
    725725 
     
    727727                  attributeAuthorityURI) 
    728728 
    729         attributeAuthorityClnt = AttAuthorityClient(uri=attributeAuthorityURI, 
    730                                 sslCACertFilePathList=self._sslCACertFilePathList, 
    731                                 cfg=self.wssCfgFilePath or self._cfg, 
    732                                 cfgFileSection=self.wssCfgSection, 
    733                                 cfgFilePrefix=self.wssCfgPrefix, 
    734                                 **(self.wssCfgKw or {})) 
     729        attributeAuthorityClnt = AttributeAuthorityClient(uri=attributeAuthorityURI, 
     730                            sslCACertFilePathList=self._sslCACertFilePathList, 
     731                            cfg=self.wssCfgFilePath or self._cfg, 
     732                            cfgFileSection=self.wssCfgSection, 
     733                            cfgFilePrefix=self.wssCfgPrefix, 
     734                            **(self.wssCfgKw or {})) 
    735735         
    736736        # If a user certificate is set, use this to sign messages instead of 
     
    802802                                     doc="Attribute Authority address - " 
    803803                                         "setting also sets up " 
    804                                          "AttAuthorityClient instance!") 
     804                                         "AttributeAuthorityClient instance!") 
    805805 
    806806 
     
    810810        attributeAuthorityClnt 
    811811         
    812         @type attributeAuthorityClnt: AttAuthorityClient 
     812        @type attributeAuthorityClnt: AttributeAuthorityClient 
    813813        @param attributeAuthorityClnt: Attribute Authority Web Service client  
    814814        instance""" 
     
    825825        attributeAuthorityClnt 
    826826         
    827         @rtype attributeAuthority: ndg.security.server.attributeauthority.AttAuthority 
     827        @rtype attributeAuthority: ndg.security.server.attributeauthority.AttributeAuthority 
    828828        @return attributeAuthority: Attribute Authority instance""" 
    829829        return self._attributeAuthority 
     
    833833        connect to. 
    834834         
    835         @type attributeAuthority: ndg.security.server.attributeauthority.AttAuthority 
     835        @type attributeAuthority: ndg.security.server.attributeauthority.AttributeAuthority 
    836836        @param attributeAuthority: Attribute Authority instance.""" 
    837837        if attributeAuthority is not None and \ 
    838            not isinstance(attributeAuthority, AttAuthority): 
     838           not isinstance(attributeAuthority, AttributeAuthority): 
    839839            raise AttributeError("Expecting %r for attributeAuthority " 
    840                                  "attribute" % AttAuthority) 
     840                                 "attribute" % AttributeAuthority) 
    841841             
    842842        self._attributeAuthority = attributeAuthority 
     
    10281028        and added into the wallet 
    10291029 
    1030         @type attributeAuthorityClnt: ndg.security.common.AttAuthorityClient 
     1030        @type attributeAuthorityClnt: ndg.security.common.attributeauthority.AttributeAuthorityClient 
    10311031        @param attributeAuthorityClnt: client object to Attribute Authority to  
    10321032        make a request to.  If omitted, it is set to  
     
    10811081                         attCert.issuerDN) 
    10821082                 
    1083             except AttAuthorityAccessDenied, e: 
     1083            except AttributeAuthorityAccessDenied, e: 
    10841084                raise CredWalletAttributeRequestDenied, str(e) 
    10851085                         
  • TI12-security/trunk/python/ndg.security.common/ndg/security/common/attributeauthority.py

    r4374 r4377  
    2323 
    2424__all__ = [ 
    25     'AttAuthorityClient', 
    26     'AttAuthorityClientError', 
     25    'AttributeAuthorityClient', 
     26    'AttributeAuthorityClientError', 
    2727    'AttributeRequestDenied', 
    2828    'NoTrustedHosts',] 
     
    3232from ZSI.wstools.Utility import HTTPResponse 
    3333 
    34 from AttAuthority_services import AttAuthorityServiceLocator 
     34from ndg.security.common.zsi.attributeauthority.AttAuthority_services import AttAuthorityServiceLocator 
    3535from ndg.security.common.wssecurity.dom import SignatureHandler 
    3636from ndg.security.common.AttCert import AttCert, AttCertParse 
     
    4343log = logging.getLogger(__name__) 
    4444 
    45 class AttAuthorityClientError(Exception): 
     45class AttributeAuthorityClientError(Exception): 
    4646    """Exception handling for AttributeAuthorityClient class""" 
    4747 
     
    4949    """Raise when a getAttCert call to the AA is denied""" 
    5050 
    51 class NoTrustedHosts(AttAuthorityClientError): 
     51class NoTrustedHosts(AttributeAuthorityClientError): 
    5252    """Raise from getTrustedHosts if there are no trusted hosts defined in 
    5353    the map configuration""" 
    5454 
    55 class NoMatchingRoleInTrustedHosts(AttAuthorityClientError): 
     55class NoMatchingRoleInTrustedHosts(AttributeAuthorityClientError): 
    5656    """Raise from getTrustedHosts if there is no mapping to any of the  
    5757    trusted hosts for the given input role name""" 
    5858 
    5959 
    60 class AttAuthorityClient(object): 
     60class AttributeAuthorityClient(object): 
    6161    """Client interface to Attribute Authority web service 
    6262     
     
    6666     
    6767    excepMap = { 
    68         'AttAuthorityNoTrustedHosts': NoTrustedHosts, 
    69         'AttAuthorityNoMatchingRoleInTrustedHosts': NoMatchingRoleInTrustedHosts 
     68        'AttributeAuthorityNoTrustedHosts': NoTrustedHosts, 
     69        'AttributeAuthorityNoMatchingRoleInTrustedHosts':NoMatchingRoleInTrustedHosts 
    7070        } 
    7171     
     
    109109        @param signatureHandlerKw: keywords to configure signature handler""" 
    110110 
    111         log.debug("AttAuthorityClient.__init__ ...") 
     111        log.debug("AttributeAuthorityClient.__init__ ...") 
    112112        self.__srv = None 
    113113        self.__uri = None 
     
    148148        @param uri: URI for service to connect to""" 
    149149        if not isinstance(uri, basestring): 
    150             raise AttAuthorityClientError( 
     150            raise AttributeAuthorityClientError( 
    151151                        "Attribute Authority URI must be a valid string") 
    152152         
     
    279279                                         transdict=self._transdict) 
    280280        except HTTPResponse, e: 
    281             raise AttAuthorityClientError, \ 
     281            raise AttributeAuthorityClientError, \ 
    282282                "Error initialising service for \"%s\": %s %s" % \ 
    283283                (self.__uri, e.status, e.reason) 
     
    300300            response = list(self.__srv.getHostInfo()) 
    301301        except httplib.BadStatusLine, e: 
    302             raise AttAuthorityClientError, "HTTP bad status line: %s" % e 
     302            raise AttributeAuthorityClientError, "HTTP bad status line: %s" % e 
    303303 
    304304        except Exception, e: 
     
    343343 
    344344        except httplib.BadStatusLine, e: 
    345             raise AttAuthorityClientError, "HTTP bad status line: %s" % e 
     345            raise AttributeAuthorityClientError, "HTTP bad status line: %s" % e 
    346346 
    347347        except Exception, e: 
     
    355355            raise e 
    356356 
    357         # Convert into dictionary form as used by AttAuthority class 
     357        # Convert into dictionary form as used by AttributeAuthority class 
    358358        trustedHostInfo = {} 
    359359        for host in trustedHosts: 
     
    389389 
    390390        except httplib.BadStatusLine, e: 
    391             raise AttAuthorityClientError, "HTTP bad status line: %s" % e 
     391            raise AttributeAuthorityClientError, "HTTP bad status line: %s" % e 
    392392 
    393393        except Exception, e: 
     
    401401            raise e 
    402402 
    403         # Convert into dictionary form as used by AttAuthority class 
     403        # Convert into dictionary form as used by AttributeAuthority class 
    404404        allHostInfo = {} 
    405405        for host in hosts: 
     
    460460            sAttCert, msg = self.__srv.getAttCert(userId,userCert,userAttCert)   
    461461        except httplib.BadStatusLine, e: 
    462             raise AttAuthorityClientError, \ 
     462            raise AttributeAuthorityClientError, \ 
    463463                'Calling "%s" HTTP bad status line: %s' % (self.__uri, e) 
    464464 
     
    491491            return self.__srv.getX509Cert()                 
    492492        except httplib.BadStatusLine, e: 
    493             raise AttAuthorityClientError, "HTTP bad status line: %s" % e 
     493            raise AttributeAuthorityClientError, "HTTP bad status line: %s" % e 
  • TI12-security/trunk/python/ndg.security.common/ndg/security/common/sessionmanager.py

    r4374 r4377  
    5959 
    6060#_____________________________________________________________________________ 
    61 class InvalidAttAuthorityClientCtx(SessionMgrClientError): 
     61class InvalidAttributeAuthorityClientCtx(SessionMgrClientError): 
    6262    """Attribute Authority ZSI Client is not initialised""" 
    6363  
     
    388388     
    389389        if not self.__srv: 
    390             raise InvalidAttAuthorityClientCtx(\ 
     390            raise InvalidAttributeAuthorityClientCtx(\ 
    391391                                        "Client binding is not initialised") 
    392392         
     
    424424     
    425425        if not self.__srv: 
    426             raise InvalidAttAuthorityClientCtx(\ 
     426            raise InvalidAttributeAuthorityClientCtx(\ 
    427427                                        "Client binding is not initialised") 
    428428 
     
    449449     
    450450        if not self.__srv: 
    451             raise InvalidAttAuthorityClientCtx(\ 
     451            raise InvalidAttributeAuthorityClientCtx(\ 
    452452                                        "Client binding is not initialised") 
    453453         
     
    532532     
    533533        if not self.__srv: 
    534             raise InvalidAttAuthorityClientCtx(\ 
     534            raise InvalidAttributeAuthorityClientCtx(\ 
    535535                                        "Client binding is not initialised") 
    536536         
     
    567567     
    568568        if not self.__srv: 
    569             raise InvalidAttAuthorityClientCtx(\ 
     569            raise InvalidAttributeAuthorityClientCtx(\ 
    570570                                        "Client binding is not initialised") 
    571571        return self.__srv.getX509Cert() 
  • TI12-security/trunk/python/ndg.security.common/ndg/security/common/zsi/attributeauthority/AttAuthority_services.py

    r4261 r4377  
    11##################################################  
    2 # AttAuthority_services.py  
     2# ndg.security.common.zsi.attributeauthority.AttAuthority_services.py  
    33# generated by ZSI.generate.wsdl2python 
    44################################################## 
    55 
    66 
    7 from AttAuthority_services_types import * 
     7from ndg.security.common.zsi.attributeauthority.AttAuthority_services_types import * 
    88import urlparse, types 
    99from ZSI.TCcompound import ComplexType, Struct 
  • TI12-security/trunk/python/ndg.security.common/ndg/security/common/zsi/twisted/attributeauthority/AttAuthority_services.py

    r4361 r4377  
    11##################################################  
    2 # AttAuthority_services.py  
     2# ndg.security.common.zsi.attributeauthority.AttAuthority_services.py  
    33# generated by ZSI.generate.wsdl2python 
    44################################################## 
    55 
    66 
    7 from AttAuthority_services_types import * 
     7from ndg.security.common.zsi.attributeauthority.AttAuthority_services_types import * 
    88import urlparse, types 
    99from ZSI.TCcompound import ComplexType, Struct 
  • TI12-security/trunk/python/ndg.security.server/ndg/security/server/attributeauthority.py

    r4368 r4377  
    4545 
    4646#_____________________________________________________________________________ 
    47 class AttAuthorityError(Exception): 
     47class AttributeAuthorityError(Exception): 
    4848    """Exception handling for NDG Attribute Authority class.""" 
    4949    def __init__(self, msg): 
     
    5252 
    5353#_____________________________________________________________________________ 
    54 class AttAuthorityConfigError(Exception): 
     54class AttributeAuthorityConfigError(Exception): 
    5555    """NDG Attribute Authority error with configuration. e.g. properties file 
    5656    directory permissions or role mapping file""" 
     
    6161 
    6262#_____________________________________________________________________________ 
    63 class AttAuthorityAccessDenied(AttAuthorityError): 
     63class AttributeAuthorityAccessDenied(AttributeAuthorityError): 
    6464    """NDG Attribute Authority - access denied exception. 
    6565 
    6666    Raise from getAttCert method where no roles are available for the user 
    6767    but that the request is otherwise valid.  In all other error cases raise 
    68     AttAuthorityError"""    
    69  
    70 class AttAuthorityNoTrustedHosts(AttAuthorityError): 
     68    AttributeAuthorityError"""    
     69 
     70class AttributeAuthorityNoTrustedHosts(AttributeAuthorityError): 
    7171    """Raise from getTrustedHosts if there are no trusted hosts defined in 
    7272    the map configuration""" 
    7373 
    74 class AttAuthorityNoMatchingRoleInTrustedHosts(AttAuthorityError): 
     74class AttributeAuthorityNoMatchingRoleInTrustedHosts(AttributeAuthorityError): 
    7575    """Raise from getTrustedHosts if there is no mapping to any of the  
    7676    trusted hosts for the given input role name""" 
     
    7878 
    7979#_____________________________________________________________________________ 
    80 class AttAuthority(dict): 
     80class AttributeAuthority(dict): 
    8181    """NDG Attribute Authority - service for allocation of user authorization 
    8282    tokens - attribute certificates. 
     
    188188             
    189189        except Exception, e: 
    190             raise AttAuthorityError("Attribute Authority's certificate is " 
     190            raise AttributeAuthorityError("Attribute Authority's certificate is " 
    191191                                    "invalid: " + str(e)) 
    192192         
     
    201201                 
    202202            except Exception, e: 
    203                 raise AttAuthorityError('CA certificate "%s" is invalid: %s'%\ 
     203                raise AttributeAuthorityError('CA certificate "%s" is invalid: %s'%\ 
    204204                                        (caCert.dn, e)) 
    205205         
     
    249249        # Configuration file properties are held together in a dictionary 
    250250        fileProp = readAndValidateProperties(self.propFilePath,  
    251                                      validKeys=AttAuthority.propertyDefaults, 
     251                                     validKeys=AttributeAuthority.propertyDefaults, 
    252252                                     prefix=prefix, 
    253253                                     sections=(section,)) 
     
    274274 
    275275        except OSError, osError: 
    276             raise AttAuthorityConfigError('Invalid directory path Attribute ' 
     276            raise AttributeAuthorityConfigError('Invalid directory path Attribute ' 
    277277                                    'Certificates store "%s": %s' % \ 
    278278                                    (self.__prop['attCertDir'],  
     
    286286     
    287287    def __delitem__(self, key): 
    288         AttAuthority.__name__ + " keys cannot be removed"         
    289         raise KeyError('Keys cannot be deleted from '+AttAuthority.__name__) 
     288        AttributeAuthority.__name__ + " keys cannot be removed"         
     289        raise KeyError('Keys cannot be deleted from '+AttributeAuthority.__name__) 
    290290 
    291291 
    292292    def __getitem__(self, key): 
    293         AttAuthority.__name__ + """ behaves as data dictionary of Attribute 
     293        AttributeAuthority.__name__ + """ behaves as data dictionary of Attribute 
    294294        Authority properties 
    295295        """ 
     
    303303     
    304304    def clear(self): 
    305         raise KeyError("Data cannot be cleared from "+AttAuthority.__name__) 
     305        raise KeyError("Data cannot be cleared from "+AttributeAuthority.__name__) 
    306306    
    307307    def keys(self): 
     
    335335            elif 'NDGSEC_DIR' in os.environ: 
    336336                val = os.path.join(os.environ['NDGSEC_DIR'],  
    337                                    AttAuthority._confDir, 
    338                                    AttAuthority._propFileName) 
     337                                   AttributeAuthority._confDir, 
     338                                   AttributeAuthority._propFileName) 
    339339            else: 
    340340                raise AttributeError('Unable to set default Attribute ' 
     
    501501                 
    502502            elif not isinstance(holderCert, X509Cert): 
    503                 raise AttAuthorityError("No input file path or cert text/" 
     503                raise AttributeAuthorityError("No input file path or cert text/" 
    504504                                        "object set") 
    505505             
    506506        except Exception, e: 
    507             raise AttAuthorityError("User X.509 certificate: %s" % e) 
     507            raise AttributeAuthorityError("User X.509 certificate: %s" % e) 
    508508 
    509509 
     
    514514             
    515515        except Exception, e: 
    516             raise AttAuthorityError("User X.509 certificate is invalid: " + \ 
     516            raise AttributeAuthorityError("User X.509 certificate is invalid: " + \ 
    517517                                    str(e)) 
    518518 
     
    524524                                         separator=self.__prop['dnSeparator'])  
    525525            except Exception, e: 
    526                 raise AttAuthorityError("Setting user Id from holder " 
     526                raise AttributeAuthorityError("Setting user Id from holder " 
    527527                                        "certificate DN: %s" % e) 
    528528        
     
    544544                holderCert.dn.serialise(separator=self.__prop['dnSeparator'])             
    545545        except Exception, e: 
    546             raise AttAuthorityError("Holder DN: %s" % e) 
     546            raise AttributeAuthorityError("Holder DN: %s" % e) 
    547547 
    548548         
     
    553553                    issuerDN.serialise(separator=self.__prop['dnSeparator'])             
    554554        except Exception, e: 
    555             raise AttAuthorityError("Issuer DN: %s" % e) 
     555            raise AttributeAuthorityError("Issuer DN: %s" % e) 
    556556         
    557557        attCert['issuerName'] = self.__prop['name'] 
     
    580580             
    581581        except Exception, e: 
    582             raise AttAuthorityError("Error setting validity time: %s" % e) 
     582            raise AttributeAuthorityError("Error setting validity time: %s" % e) 
    583583         
    584584 
     
    609609                     
    610610                except Exception, e: 
    611                     raise AttAuthorityError("Reading external Attribute " 
     611                    raise AttributeAuthorityError("Reading external Attribute " 
    612612                                            "Certificate: %s" % e)                            
    613613            elif userAttCert: 
     
    617617                     
    618618                elif not isinstance(userAttCert, AttCert): 
    619                     raise AttAuthorityError( 
     619                    raise AttributeAuthorityError( 
    620620                        "Expecting userAttCert as a string or AttCert type")         
    621621            else: 
    622                 raise AttAuthorityAccessDenied("User \"%s\" is not registered " 
     622                raise AttributeAuthorityAccessDenied("User \"%s\" is not registered " 
    623623                                               "and no external attribute " 
    624624                                               "certificate is available to " 
     
    629629            # be used to make further mappings 
    630630            if userAttCert.isMapped(): 
    631                 raise AttAuthorityError("External Attribute Certificate must " 
     631                raise AttributeAuthorityError("External Attribute Certificate must " 
    632632                                        "have an original provenance in order " 
    633633                                        "to make further mappings.") 
     
    641641                 
    642642            except Exception, e: 
    643                 raise AttAuthorityError("Invalid Remote Attribute " 
     643                raise AttributeAuthorityError("Invalid Remote Attribute " 
    644644                                        "Certificate: " + str(e))        
    645645 
     
    648648            # certificate DN 
    649649            if userAttCert.holderDN != holderCert.dn: 
    650                 raise AttAuthorityError("User certificate and Attribute " 
     650                raise AttributeAuthorityError("User certificate and Attribute " 
    651651                                        'Certificate DNs don\'t match: "%s"' 
    652652                                        ' and "%s"' % (holderCert.dn,  
     
    663663                                                    trustedHostRoles) 
    664664            if not localRoles: 
    665                 raise AttAuthorityAccessDenied("No local roles mapped to the " 
     665                raise AttributeAuthorityAccessDenied("No local roles mapped to the " 
    666666                                               "%s roles: %s" % \ 
    667667                                               (userAttCert['issuerName'],  
     
    698698         
    699699        except Exception, e: 
    700             raise AttAuthorityError("New Attribute Certificate \"%s\": %s" % \ 
     700            raise AttributeAuthorityError("New Attribute Certificate \"%s\": %s" % \ 
    701701                                    (attCert.filePath, e)) 
    702702        
     
    715715        if mapConfigFilePath is not None: 
    716716            if not isinstance(mapConfigFilePath, basestring): 
    717                 raise AttAuthorityError( 
     717                raise AttributeAuthorityError( 
    718718                "Input Map Configuration file path must be a valid string.") 
    719719             
     
    726726             
    727727        except IOError, e: 
    728             raise AttAuthorityConfigError('Error parsing properties file ' 
     728            raise AttributeAuthorityConfigError('Error parsing properties file ' 
    729729                                          '"%s": %s' % (e.filename,e.strerror))           
    730730        except Exception, e: 
    731             raise AttAuthorityConfigError('Error parsing Map Configuration ' 
     731            raise AttributeAuthorityConfigError('Error parsing Map Configuration ' 
    732732                                          'file: "%s": %s' %  
    733733                                          (self.__prop['mapConfigFile'], e)) 
     
    757757             
    758758        except Exception, e: 
    759             raise AttAuthorityConfigError('"thisHost" tag not found in Map ' 
     759            raise AttributeAuthorityConfigError('"thisHost" tag not found in Map ' 
    760760                                          'Configuration file "%s"' %  
    761761                                          self.__prop['mapConfigFile']) 
     
    765765             
    766766        except Exception, e: 
    767             raise AttAuthorityConfigError('"name" attribute of "thisHost" ' 
     767            raise AttributeAuthorityConfigError('"name" attribute of "thisHost" ' 
    768768                                    'element not found in Map Configuration ' 
    769769                                    'file "%s"' % self.__prop['mapConfigFile']) 
     
    779779        # P J Kershaw 14/06/06 
    780780        if hostName != self.__prop['name']: 
    781             raise AttAuthorityError('"name" attribute of "thisHost" element in' 
     781            raise AttributeAuthorityError('"name" attribute of "thisHost" element in' 
    782782                                    " Map Configuration file doesn't match " 
    783783                                    '"name" element in properties file.') 
     
    799799                 
    800800            except Exception, e: 
    801                 raise AttAuthorityError('Error reading trusted host name: %s' % 
     801                raise AttributeAuthorityError('Error reading trusted host name: %s' % 
    802802                                        e) 
    803803 
     
    837837                    remoteRole = role['remote'] 
    838838                except KeyError, e: 
    839                     raise AttAuthorityError('Reading map config file "%s": no ' 
     839                    raise AttributeAuthorityError('Reading map config file "%s": no ' 
    840840                                            'element "%s" for host "%s"' % \ 
    841841                                            (self.__prop['mapConfigFile'],  
     
    878878        Attribute Authority represents 
    879879         
    880         Nb. this method is not used internally by AttAuthority class and is 
     880        Nb. this method is not used internally by AttributeAuthority class and is 
    881881        not a required part of the AAUserRoles API 
    882882         
     
    906906 
    907907        except Exception, e: 
    908             raise AttAuthorityError("Getting user roles: %s" % e) 
     908            raise AttributeAuthorityError("Getting user roles: %s" % e) 
    909909        
    910910         
     
    946946        if not self.__mapConfig or not self.__localRole2RemoteRole: 
    947947            # This Attribute Authority has no trusted hosts 
    948             raise AttAuthorityNoTrustedHosts("The %s Attribute Authority has " 
     948            raise AttributeAuthorityNoTrustedHosts("The %s Attribute Authority has " 
    949949                                             "no trusted hosts" %  
    950950                                             self.__prop['name']) 
     
    980980                trustedHosts = self.__localRole2TrustedHost[role] 
    981981            except: 
    982                 raise AttAuthorityNoMatchingRoleInTrustedHosts( 
     982                raise AttributeAuthorityNoMatchingRoleInTrustedHosts( 
    983983                    'None of the trusted hosts have a mapping to the ' 
    984984                    'input role "%s"' % role) 
     
    10161016 
    10171017        if not self.__remoteRole2LocalRole: 
    1018             raise AttAuthorityError("Roles map is not set - ensure "  
     1018            raise AttributeAuthorityError("Roles map is not set - ensure "  
    10191019                                    "readMapConfig() has been called.") 
    10201020 
     
    10481048        """Set up a rotating file handler to log ACs issued. 
    10491049        @type attCertFilePath: string 
    1050         @param attCertFilePath: set where to store ACs.  Set from AttAuthority 
     1050        @param attCertFilePath: set where to store ACs.  Set from AttributeAuthority 
    10511051        properties file. 
    10521052         
     
    11051105        otherwise False 
    11061106         
    1107         Nb. this method is not used by AttAuthority class and so does NOT need  
     1107        Nb. this method is not used by AttributeAuthority class and so does NOT need  
    11081108        to be implemented in a derived class. 
    11091109         
  • TI12-security/trunk/python/ndg.security.server/ndg/security/server/sso/sso/controllers/login.py

    r4081 r4377  
    66from ndg.security.common.pylons.security_util import setSecuritySession, \ 
    77    SecuritySession, SSOServiceQuery 
    8 from ndg.security.common.AttAuthority import AttAuthorityClient 
     8from ndg.security.common.attributeauthority import AttributeAuthorityClient 
    99from ndg.security.common.SessionMgr import SessionMgrClient, SessionExpired, \ 
    1010    AttributeRequestDenied 
     
    200200             
    201201            # Look-up list of Cert DNs for trusted requestors 
    202             aaClnt = AttAuthorityClient(uri=self.cfg.aaURI, 
     202            aaClnt = AttributeAuthorityClient(uri=self.cfg.aaURI, 
    203203                                    tracefile=self.cfg.tracefile, 
    204204                                    httpProxyHost=self.cfg.httpProxyHost, 
  • TI12-security/trunk/python/ndg.security.server/ndg/security/server/sso/sso/controllers/wayf.py

    r4038 r4377  
    22 
    33from ndg.security.server.sso.sso.lib.base import * 
    4 from ndg.security.common.AttAuthority import AttAuthorityClient 
     4from ndg.security.common.attributeauthority import AttributeAuthorityClient 
    55from base64 import urlsafe_b64decode 
    66 
  • TI12-security/trunk/python/ndg.security.server/ndg/security/server/sso/sso/lib/openid_util.py

    r3994 r4377  
    102102 
    103103 
    104 from ndg.security.common.AttAuthority import AttAuthorityClient 
     104from ndg.security.common.attributeauthority import AttributeAuthorityClient 
    105105 
    106106def _getTrustedIdPs(g): 
     
    123123     
    124124    try: 
    125         aaClnt = AttAuthorityClient(uri=cfg.aaURI, 
     125        aaClnt = AttributeAuthorityClient(uri=cfg.aaURI, 
    126126                                tracefile=cfg.tracefile, 
    127127                                httpProxyHost=cfg.httpProxyHost, 
     
    131131        c.xml='Error establishing security context.  Please report ' + \ 
    132132              'the error to your site administrator' 
    133         log.error("Initialising AttAuthorityClient for " + \ 
     133        log.error("Initialising AttributeAuthorityClient for " + \ 
    134134                  "getAllHostsInfo call: %s" % e) 
    135135        return _render('ndg.security.error', h=h, g=config['pylons.g'], c=c) 
     
    143143        c.xml='Error getting a list of trusted sites for login.  ' + \ 
    144144            'Please report the error to your site administrator.' 
    145         log.error("AttAuthorityClient getAllHostsInfo call: %s" % e)   
     145        log.error("AttributeAuthorityClient getAllHostsInfo call: %s" % e)   
    146146        return _render('ndg.security.error', h=h, g=config['pylons.g'], c=c) 
    147147         
  • TI12-security/trunk/python/ndg.security.server/ndg/security/server/zsi/attributeauthority/__init__.py

    r4369 r4377  
    2626    import AttAuthorityService as _AttAuthorityService 
    2727 
    28 from ndg.security.server.attributeauthority import AttAuthority, \ 
    29     AttAuthorityAccessDenied 
     28from ndg.security.server.attributeauthority import AttributeAuthority, \ 
     29    AttributeAuthorityAccessDenied 
    3030     
    3131from ndg.security.common.wssecurity.dom import SignatureHandler 
     
    4747        # Initialise Attribute Authority class - property file will be 
    4848        # picked up from default location under $NDG_DIR directory 
    49         self.aa = AttAuthority(**kw) 
     49        self.aa = AttributeAuthority(**kw) 
    5050 
    5151 
     
    8585            response.AttCert = attCert.toString() 
    8686             
    87         except AttAuthorityAccessDenied, e: 
     87        except AttributeAuthorityAccessDenied, e: 
    8888            response.Msg = str(e) 
    8989             
  • TI12-security/trunk/python/ndg.security.server/ndg/security/server/zsi/twisted/attributeauthority/AttAuthority_services_server.py

    r4363 r4377  
    55################################################## 
    66 
    7 from ndg.security.common.AttAuthority.AttAuthority_services import * 
     7from ndg.security.common.zsi.attributeauthority.AttAuthority_services import * 
    88from ZSI.ServiceContainer import ServiceSOAPBinding 
    99 
  • TI12-security/trunk/python/ndg.security.server/ndg/security/server/zsi/twisted/attributeauthority/attAuthority.tac

    r4369 r4377  
    4040        import AttAuthorityService 
    4141 
    42 from ndg.security.server.attributeauthority import AttAuthority, \ 
    43         AttAuthorityAccessDenied 
     42from ndg.security.server.attributeauthority import AttributeAuthority, \ 
     43        AttributeAuthorityAccessDenied 
    4444         
    4545from ndg.security.common.wssecurity.dom import SignatureHandler 
     
    5050 
    5151 
    52 class AttAuthorityServiceSub(AttAuthorityService, WSResource): 
     52class AttributeAuthorityServiceSub(AttributeAuthorityService, WSResource): 
    5353 
    5454    # Add WS-Security handlers 
     
    6868        # Initialize Attribute Authority class - property file will be 
    6969        # picked up from default location under $NDG_DIR directory 
    70         self.aa = AttAuthority() 
     70        self.aa = AttributeAuthority() 
    7171 
    7272 
     
    102102                response.AttCert = attCert.toString() 
    103103                 
    104         except AttAuthorityAccessDenied, e: 
     104        except AttributeAuthorityAccessDenied, e: 
    105105            response.Msg = str(e) 
    106106                         
     
    244244 
    245245# Create Service 
    246 srv = AttAuthorityServiceSub() 
     246srv = AttributeAuthorityServiceSub() 
    247247if srv.aa.has_key('WS-Security'): 
    248248    # Initialise WS-Security signature handler passing Attribute Authority 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/attributeauthorityclient/attCertLog/__init__.py

    r2954 r4377  
    11"""Include attCertLog/ directory temp repository in Attribute Authority 
    2 unit tests package ndg.security.test.AttAuthority 
     2unit tests package ndg.security.test.AttributeAuthority 
    33 
    44NERC Data Grid Project 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/attributeauthorityclient/test_attributeauthorityclient.py

    r4372 r4377  
    1111License, version 1.0 or later.""" 
    1212__contact__ = "P.J.Kershaw@rl.ac.uk" 
    13 __revision__ = '$Id$' 
     13__revision__ = '$Id:test_attributeauthorityclient.py 4372 2008-10-29 09:45:39Z pjkersha $' 
    1414 
    1515import unittest 
     
    1818logging.basicConfig() 
    1919 
    20 from ndg.security.common.AttAuthority import AttAuthorityClient, \ 
     20from ndg.security.common.attributeauthority import AttributeAuthorityClient, \ 
    2121    NoMatchingRoleInTrustedHosts 
    2222from ndg.security.common.AttCert import AttCertRead 
     
    3131 
    3232 
    33 class AttAuthorityClientTestCase(unittest.TestCase): 
     33class AttributeAuthorityClientTestCase(unittest.TestCase): 
    3434    clntPriKeyPwd = None 
    3535    pemPat = "-----BEGIN CERTIFICATE-----[^\-]*-----END CERTIFICATE-----" 
     
    7979             
    8080        # Instantiate WS proxy 
    81         self.siteAClnt = AttAuthorityClient(uri=self.cfg['setUp']['uri'], 
     81        self.siteAClnt = AttributeAuthorityClient(uri=self.cfg['setUp']['uri'], 
    8282                        sslPeerCertCN=self.cfg['setUp'].get('sslPeerCertCN'), 
    8383                        sslCACertList=sslCACertList, 
     
    229229         
    230230        # Make client to site B Attribute Authority 
    231         siteBClnt = AttAuthorityClient(uri=_cfg['uri'],  
     231        siteBClnt = AttributeAuthorityClient(uri=_cfg['uri'],  
    232232                                       cfgFileSection='wsse', 
    233233                                       cfg=self.cfgParser) 
     
    261261 
    262262        # Make client to site B Attribute Authority 
    263         siteBClnt = AttAuthorityClient(uri=_cfg['uri'],  
     263        siteBClnt = AttributeAuthorityClient(uri=_cfg['uri'],  
    264264                                       cfgFileSection='wsse', 
    265265                                       cfg=self.cfgParser) 
     
    288288              
    289289#_____________________________________________________________________________        
    290 class AttAuthorityClientTestSuite(unittest.TestSuite): 
     290class AttributeAuthorityClientTestSuite(unittest.TestSuite): 
    291291    def __init__(self): 
    292         map = map(AttAuthorityClientTestCase, 
     292        map = map(AttributeAuthorityClientTestCase, 
    293293                  ( 
    294294                    "test1GetX509Cert", 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/attributeauthorityclient/wsgi/site-a.ini

    r4318 r4377  
    5858 
    5959[app:mainApp] 
    60 paste.app_factory = ndg.security.test.attAuthority.wsgi.siteAServerApp:app_factory 
     60paste.app_factory = ndg.security.test.attributeauthorityclient.wsgi.siteAServerApp:app_factory 
    6161 
    6262# Chain of SOAP Middleware filters 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/attributeauthorityclient/wsgi/site-b.ini

    r4318 r4377  
    5858 
    5959[app:mainApp] 
    60 paste.app_factory = ndg.security.test.attAuthority.wsgi.siteBServerApp:app_factory 
     60paste.app_factory = ndg.security.test.attributeauthorityclient.wsgi.siteBServerApp:app_factory 
    6161 
    6262# Chain of SOAP Middleware filters 
  • TI12-security/trunk/python/ndg.security.test/ndg/security/test/utils/testConfigFileParsers.py

    r4369 r4377  
    77import unittest, os 
    88from ndg.security.common.utils.ConfigFileParsers import readProperties, readAndValidateProperties 
    9 from ndg.security.server.attributeauthority import AttAuthority 
     9from ndg.security.server.attributeauthority import AttributeAuthority 
    1010from ndg.security.server.sessionmanager import SessionMgr 
    1111from ConfigParser import MissingSectionHeaderError 
     
    5454    def testBasicINIInput(self): 
    5555         
    56         cfg = readProperties(self.ATT_AUTH_INI_FILE, validKeys=AttAuthority._AttAuthority__validKeys) 
     56        cfg = readProperties(self.ATT_AUTH_INI_FILE, validKeys=AttributeAuthority._AttributeAuthority__validKeys) 
    5757        # do some basic checks of what is returned 
    5858        self.assertNotEqual(cfg, None) 
     
    6767    def testBasicXMLInput(self): 
    6868         
    69         cfg = readProperties(self.ATT_AUTH_XML_FILE, validKeys=AttAuthority._AttAuthority__validKeys) 
     69        cfg = readProperties(self.ATT_AUTH_XML_FILE, validKeys=AttributeAuthority._AttributeAuthority__validKeys) 
    7070        # do some basic checks of what is returned 
    7171        self.assertNotEqual(cfg, None) 
     
    7979 
    8080    def testINIandXMLInput(self): 
    81         cfgINI = readProperties(self.ATT_AUTH_INI_FILE, validKeys=AttAuthority._AttAuthority__validKeys) 
    82         cfgXML = readProperties(self.ATT_AUTH_XML_FILE, validKeys=AttAuthority._AttAuthority__validKeys) 
     81        cfgINI = readProperties(self.ATT_AUTH_INI_FILE, validKeys=AttributeAuthority._AttributeAuthority__validKeys) 
     82        cfgXML = readProperties(self.ATT_AUTH_XML_FILE, validKeys=AttributeAuthority._AttributeAuthority__validKeys) 
    8383        self.assertEqual(cfgINI, cfgXML) 
    8484         
    8585 
    86     def testAttAuthorityINIInput(self): 
     86    def testAttributeAuthorityINIInput(self): 
    8787         
    88         cfg = readProperties(self.ATT_AUTH_INI_FILE, validKeys=AttAuthority._AttAuthority__validKeys) 
     88        cfg = readProperties(self.ATT_AUTH_INI_FILE, validKeys=AttributeAuthority._AttributeAuthority__validKeys) 
    8989        # do some basic checks of what is returned 
    9090        self.assertNotEqual(cfg, None) 
     
    9797 
    9898 
    99     def testAttAuthorityXMLInput(self): 
     99    def testAttributeAuthorityXMLInput(self): 
    100100         
    101         cfg = readProperties(self.ATT_AUTH_XML_FILE, validKeys=AttAuthority._AttAuthority__validKeys) 
     101        cfg = readProperties(self.ATT_AUTH_XML_FILE, validKeys=AttributeAuthority._AttributeAuthority__validKeys) 
    102102        # do some basic checks of what is returned 
    103103        self.assertNotEqual(cfg, None) 
     
    137137    def testBasicINIInputValidate(self): 
    138138         
    139         cfg = readAndValidateProperties(self.ATT_AUTH_INI_FILE, validKeys=AttAuthority._AttAuthority__validKeys) 
     139        cfg = readAndValidateProperties(self.ATT_AUTH_INI_FILE, validKeys=AttributeAuthority._AttributeAuthority__validKeys) 
    140140        # do some basic checks of what is returned 
    141141        self.assertNotEqual(cfg, None) 
     
    150150    def testBasicXMLInputValidate(self): 
    151151         
    152         cfg = readAndValidateProperties(self.ATT_AUTH_XML_FILE, validKeys=AttAuthority._AttAuthority__validKeys) 
     152        cfg = readAndValidateProperties(self.ATT_AUTH_XML_FILE, validKeys=AttributeAuthority._AttributeAuthority__validKeys) 
    153153        # do some basic checks of what is returned 
    154154        self.assertNotEqual(cfg, None) 
Note: See TracChangeset for help on using the changeset viewer.