Changeset 543


Ignore:
Timestamp:
08/02/06 10:26:59 (14 years ago)
Author:
pjkersha
Message:

AttAuthority?.py, MyProxy?.py, Session.py: for all properties files, enable
file path properties to contain environment variables.

SimpleCA.py: setCAPassPhrase() now a property "caPassPhrase".

attAuthorityProperties.xml: modified Attribute Certificate life time
<attCertLifeTime> to 8 hours.

Location:
security/trunk/python/NDG
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • security/trunk/python/NDG/AttAuthority.py

    r539 r543  
    481481        # Strip white space - apart from fields where may be required 
    482482        for key in prop: 
    483             if key != 'keyPwd' and prop[key]: prop[key] = prop[key].strip() 
     483            if key != 'keyPwd' and prop[key]:  
     484                prop[key] = prop[key].strip() 
     485                 
     486            # Check for environment variables in file paths 
     487            tagCaps = key.upper() 
     488            if 'FILE' in tagCaps or 'PATH' in tagCaps or 'DIR' in tagCaps: 
     489                prop[key] = os.path.expandvars(prop[key]) 
     490  
    484491  
    485492        # Ensure Certificate Lifetime is converted into a numeric type 
  • security/trunk/python/NDG/MyProxy.py

    r525 r543  
    218218            raise MyProxyError("Root element for parsing is not defined") 
    219219 
     220 
    220221        # Get properties as a data dictionary 
    221         prop = dict([(elem.tag, elem.text.strip()) for elem in propElem]) 
    222  
     222        prop = {} 
     223        for elem in propElem: 
     224 
     225            # Check for environment variables in file paths 
     226            tagCaps = elem.tag.upper() 
     227            if 'FILE' in tagCaps or 'PATH' in tagCaps or 'DIR' in tagCaps: 
     228                elem.text = os.path.expandvars(elem.text) 
     229 
     230            prop[elem.tag] = elem.text 
     231             
    223232 
    224233        # Check for SimpleCA properties - should be either WS client or 
  • security/trunk/python/NDG/Session.py

    r541 r543  
    348348            elif elem.tag in self.__validKeys: 
    349349                self.__prop[elem.tag] = elem.text 
     350                 
     351                # Check for environment variables in file paths 
     352                tagCaps = elem.tag.upper() 
     353                if 'FILE' in tagCaps or 'PATH' in tagCaps or 'DIR' in tagCaps: 
     354                    elem.text = os.path.expandvars(elem.text) 
    350355            else: 
    351356                raise SessionMgrError(\ 
     
    11051110 
    11061111        # Read properties into a dictionary 
    1107         prop = dict([(elem.tag, elem.text) for elem in propElem]) 
     1112        prop = {} 
     1113        for elem in propElem: 
     1114                     
     1115            # Check for environment variables in file paths 
     1116            tagCaps = elem.tag.upper() 
     1117            if 'FILE' in tagCaps or 'PATH' in tagCaps or 'DIR' in tagCaps: 
     1118                elem.text = os.path.expandvars(elem.text) 
     1119 
     1120            prop[elem.tag] = elem.text 
     1121             
    11081122        self.setProperties(dbPPhrase=dbPPhrase, **prop) 
    11091123 
  • security/trunk/python/NDG/SimpleCA.py

    r527 r543  
    107107             
    108108        if caPassPhrase is not None: 
    109             self.setCAPassPhrase(caPassPhrase) 
     109            self.__setCAPassPhrase(caPassPhrase) 
    110110 
    111111         
     
    190190 
    191191 
    192     def setCAPassPhrase(self, caPassPhrase): 
     192    def __setCAPassPhrase(self, caPassPhrase): 
    193193        """Give this instance the pass-phrase for the SimpleCA""" 
    194194        self.chkCAPassPhrase(caPassPhrase)         
    195195        self.__caPassPhrase = caPassPhrase 
    196196            
    197  
     197    caPassPhrase = property(fset=__setCAPassPhrase, 
     198                            doc="Enter pass-phrase for Simple CA") 
     199                             
     200                             
    198201    #_________________________________________________________________________ 
    199202    def setProperties(self, **prop): 
Note: See TracChangeset for help on using the changeset viewer.