Ignore:
Timestamp:
20/08/08 14:03:20 (11 years ago)
Author:
cbyrom
Message:

General refactoring and updating of code, including:

Removal of refC14nKw and singnedInfoC14nKw keywords in wsssecurity session manager config
(the refC14nInclNS and signedInfoC14nInclNS keywords are sufficient);
Creation of new DOM signature handler class, dom.py, based on the wsSecurity
class;
Abstraction of common code between dom.py and etree.py into new parent
class, BaseSignatureHandler?.py.
Fixing and extending use of properties in the SignatureHandler? code.
Fixing a few bugs with the original SignatureHandler? code.
Updating of test cases to new code/code structure.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI12-security/trunk/python/ndg.security.server/ndg/security/server/AttAuthority/__init__.py

    r4110 r4129  
    140140 
    141141        # Set from input or use defaults based or environment variables 
    142         self.setPropFilePath(propFilePath) 
     142        self.propFilePath = propFilePath 
    143143 
    144144        # Initialise role mapping look-ups - These are set in readMapConfig() 
     
    314314        """Set properties file from input or based on environment variable 
    315315        settings""" 
     316        log.debug("Setting property file path") 
    316317        if not val: 
    317318            if 'NDGSEC_AA_PROPFILEPATH' in os.environ: 
     
    332333                                  "must be a valid string." 
    333334       
    334         self.__propFilePath = val 
     335        self._propFilePath = val 
     336        log.debug("Path set to: %s" %val) 
     337         
     338    def getPropFilePath(self): 
     339        log.debug("Getting property file path") 
     340        if hasattr(self, '_propFilePath'): 
     341            return self._propFilePath 
     342        else: 
     343            return "" 
    335344         
    336345    # Also set up as a property 
    337346    propFilePath = property(fset=setPropFilePath, 
     347                            fget=getPropFilePath, 
    338348                            doc="Set the path to the properties file")    
    339349     
     
    618628        log.debug("Calling readProperties ...") 
    619629        try: 
    620             tree = ElementTree.parse(self.__propFilePath) 
     630            tree = ElementTree.parse(self.propFilePath) 
    621631             
    622632        except IOError, ioErr: 
     
    630640            raise AttAuthorityError, \ 
    631641            "Parsing properties file \"%s\": root element is not defined" % \ 
    632             self.__propFilePath 
     642            self.propFilePath 
    633643 
    634644 
     
    662672            raise AttAuthorityError, \ 
    663673                "Error parsing tag \"%s\" in properties file \"%s\": %s" % \ 
    664                 (elem.tag, self.__propFilePath, e) 
     674                (elem.tag, self.propFilePath, e) 
    665675 
    666676        if invalidKeys != []: 
     
    687697                (self.__prop['attCertDir'], osError.strerror) 
    688698 
    689         log.info('Loaded properties from "%s"' % self.__propFilePath) 
     699        log.info('Loaded properties from "%s"' % self.propFilePath) 
    690700         
    691701         
Note: See TracChangeset for help on using the changeset viewer.