Ignore:
Timestamp:
16/03/10 16:40:35 (10 years ago)
Author:
pjkersha
Message:

Adding parsing for Subject type and SubjectMatch? elements.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI12-security/trunk/NDG_XACML/ndg/xacml/core/match.py

    r6746 r6747  
    1111__revision__ = "$Id: $" 
    1212from ndg.xacml.core import PolicyComponent 
     13from ndg.xacml.core.attributedesignator import AttributeDesignator 
     14from ndg.xacml.core.attributeselector import AttributeSelector 
    1315from ndg.xacml.core.attribute import AttributeValue 
    1416 
     
    1618class MatchBase(PolicyComponent): 
    1719    ELEMENT_LOCAL_NAME = None 
    18      
     20    MATCH_ID_ATTRIB_NAME = 'MatchId' 
     21    ATTRIBUTE_VALUE_ELEMENT_LOCAL_NAME = 'AttributeValue' 
     22 
    1923    __slots__ = ( 
    2024        '__attributeValue',  
     
    4650                              "attribute value") 
    4751 
     52    @property 
     53    def attributeDesignator(self): 
     54        return self.__attributeDesignator 
     55     
     56    @attributeDesignator.setter 
     57    def attributeDesignator(self, value): 
     58        if not isinstance(value, AttributeDesignator): 
     59            raise TypeError('Expecting %r type for "attributeDesignator" ' 
     60                            'attribute; got %r' %  
     61                            (AttributeDesignator, type(value))) 
     62             
     63        self.__attributeDesignator = value 
     64  
     65    @property 
     66    def attributeSelector(self): 
     67        return self.__attributeSelector 
     68     
     69    @attributeSelector.setter 
     70    def attributeSelector(self, value): 
     71        if not isinstance(value, AttributeSelector): 
     72            raise TypeError('Expecting %r type for "matchId" ' 
     73                            'attribute; got %r' %  
     74                            (AttributeSelector, type(value))) 
     75             
     76        self.__attributeSelector = value 
     77                        
    4878    def _getMatchId(self): 
    4979        return self.__matchId 
     
    6292    "Subject Match Type" 
    6393    ELEMENT_LOCAL_NAME = 'SubjectMatch' 
     94    ATTRIBUTE_DESIGNATOR_ELEMENT_LOCAL_NAME = 'SubjectAttributeDesignator'    
    6495     
    6596     
     
    6798    "Resource Match" 
    6899    ELEMENT_LOCAL_NAME = 'ResourceMatch' 
     100    ATTRIBUTE_DESIGNATOR_ELEMENT_LOCAL_NAME = 'ResourceAttributeDesignator' 
    69101     
    70102     
     
    72104    "Action match" 
    73105    ELEMENT_LOCAL_NAME = 'ActionMatch' 
     106    ATTRIBUTE_DESIGNATOR_ELEMENT_LOCAL_NAME = 'ActionAttributeDesignator'     
    74107     
    75108     
     
    77110    "Environment Match" 
    78111    ELEMENT_LOCAL_NAME = 'EnvironmentMatch' 
    79      
     112    ATTRIBUTE_DESIGNATOR_ELEMENT_LOCAL_NAME = 'EnvironmentAttributeDesignator' 
Note: See TracChangeset for help on using the changeset viewer.