Ignore:
Timestamp:
21/08/08 14:31:44 (11 years ago)
Author:
cbyrom
Message:

Create new utility package with class, ConfigFileParsers? - a utility
class with parsers for XML and INI style config files. This takes
a filename, together with an optional dictionary of valid keys (to
check for invalid config inputs) + optional section list (to restrict
parsing of INI files to particular sections) and returns a
dictionary of read in properties. NB, if valid keys are specified
and not featured in the prop file, default values are set up in the
returned property dict.
Implemented use of the ConfigFileParsers? in the AttAuthority? service.
Added new testsuite (together with noseTests class to drive tests) to
exercise the new parsers in the context of the AttAuthority? section +
added test config files.

File:
1 edited

Legend:

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

    r4129 r4131  
    432432        @return X.509 certificate object""" 
    433433         
    434         if cert is None or isinstance(cert, X509Cert): 
     434        if not cert or isinstance(cert, X509Cert): 
    435435            # ndg.security.common.X509.X509Cert type / None 
    436436            return cert 
     
    469469        "Set property method for X.509 cert. used to verify a signature" 
    470470        log.debug("Setting verifying cert") 
     471        print "Cert:", verifyingCert 
    471472        self._verifyingCert = self.__setCert(verifyingCert) 
    472473        # Reset file path as it may no longer apply 
     
    481482    def _setVerifyingCertFilePath(self, verifyingCertFilePath): 
    482483        "Set method for Service X.509 cert. file path property" 
    483          
    484         if isinstance(verifyingCertFilePath, basestring): 
    485             self._verifyingCert = X509CertRead(verifyingCertFilePath) 
    486              
    487         elif verifyingCertFilePath is not None: 
    488             raise AttributeError, \ 
    489             "Verifying X.509 Cert. file path must be None or a valid string" 
     484        if verifyingCertFilePath: 
     485            if isinstance(verifyingCertFilePath, basestring): 
     486                self._verifyingCert = X509CertRead(verifyingCertFilePath) 
     487            else: 
     488                raise AttributeError, "X.509 Cert file path is not a valid string" 
    490489         
    491490        self._verifyingCertFilePath = verifyingCertFilePath 
Note: See TracChangeset for help on using the changeset viewer.