Ignore:
Timestamp:
28/06/10 13:54:57 (11 years ago)
Author:
pjkersha
Message:

Incomplete - task 2: XACML-Security Integration

  • updating epydoc ready for release.
Location:
TI12-security/trunk/ndg_xacml/ndg/xacml/parsers/etree
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • TI12-security/trunk/ndg_xacml/ndg/xacml/parsers/etree/__init__.py

    r7087 r7109  
    5454     
    5555    def _getPrefix(self): 
     56        """Get prefix 
     57        @return: prefix 
     58        @rtype: string 
     59        """ 
    5660        return self.__prefix 
    5761 
    5862    def _setPrefix(self, value): 
     63        """Set prefix 
     64        @param value: prefix 
     65        @type value: string 
     66        @raise TypeError: invalid input value type 
     67        """ 
    5968        self.__prefix = value 
    6069     
     
    6271 
    6372    def _getLocalPart(self): 
     73        """Get local part 
     74        @return: local part 
     75        @rtype: string 
     76        """ 
    6477        return self.__localPart 
    6578     
    6679    def _setLocalPart(self, value): 
     80        """Set local part 
     81        @param value: local part 
     82        @type value: string 
     83        @raise TypeError: invalid input value type 
     84        """ 
    6785        self.__localPart = value 
    6886         
     
    7088 
    7189    def _getNamespaceURI(self): 
     90        """Get namespace URI 
     91        @return: namespace URI 
     92        @rtype: string 
     93        """ 
    7294        return self.__namespaceURI 
    7395 
    7496    def _setNamespaceURI(self, value): 
     97        """Set namespace URI 
     98        @param value: namespace URI 
     99        @type value: string 
     100        @raise TypeError: invalid input value type 
     101        """ 
    75102        self.__namespaceURI = value 
    76103   
     
    84111        @type qname: ndg.xacml.utils.etree.QName 
    85112        @param qname: Qualified Name to compare with self  
     113        @return: True if input and this object match 
     114        @rtype: bool 
    86115        """ 
    87116        if not isinstance(qname, QName): 
  • TI12-security/trunk/ndg_xacml/ndg/xacml/parsers/etree/actionattributedesignatorreader.py

    r7087 r7109  
    1717class ActionAttributeDesignatorReader(AttributeDesignatorReaderBase):  
    1818    '''ElementTree based XACML Action Attribute Designator type parser 
     19     
     20    @cvar TYPE: XACML class type that this reader will read values into 
     21    @type TYPE: abc.ABCMeta 
    1922    ''' 
    2023    TYPE = ActionAttributeDesignator 
  • TI12-security/trunk/ndg_xacml/ndg/xacml/parsers/etree/actionmatchreader.py

    r7087 r7109  
    1616 
    1717class ActionMatchReader(MatchReaderBase): 
    18     """ElementTree based parser for XACML ActionMatch""" 
     18    """ElementTree based parser for XACML ActionMatch 
     19         
     20    @cvar TYPE: XACML class type that this reader will read values into 
     21    @type TYPE: type 
     22     
     23    @cvar ATTRIBUTE_DESIGNATOR_TYPE: type of attribute designator that this  
     24    match type holds 
     25    @type ATTRIBUTE_DESIGNATOR_TYPE: abc.ABCMeta 
     26    """ 
    1927    TYPE = ActionMatch 
    2028    ATTRIBUTE_DESIGNATOR_TYPE = ActionAttributeDesignator 
  • TI12-security/trunk/ndg_xacml/ndg/xacml/parsers/etree/actionreader.py

    r7087 r7109  
    1717    '''ElementTree based parser for Action type 
    1818    @cvar TYPE: XACML type to instantiate from parsed object 
    19     @type string: type 
     19    @type TYPE: type 
    2020    ''' 
    21     TYPE = Action     
     21    TYPE = Action 
  • TI12-security/trunk/ndg_xacml/ndg/xacml/parsers/etree/applyreader.py

    r7087 r7109  
    3131    '''ElementTree based XACML Apply type parser 
    3232     
    33     @cvar TYPE: XACML type to instantiate from parsed object 
    34     @type string: type 
     33    @cvar FUNCTION_ELEMENT_LOCAL_NAME: XML local name for function element 
     34    @type FUNCTION_ELEMENT_LOCAL_NAME: string 
     35     
     36    @cvar VARIABLE_REFERENCE_ELEMENT_LOCAL_NAME: XML local name for variable 
     37    reference element 
     38    @type VARIABLE_REFERENCE_ELEMENT_LOCAL_NAME: string 
     39     
     40    @cvar TYPE: XACML class type that this reader will read values into 
     41    @type TYPE: abc.ABCMeta 
    3542    ''' 
    3643    TYPE = Apply 
     
    4350     
    4451    def __call__(self, obj): 
    45         """Parse Apply type object""" 
     52        """Parse Apply type object 
     53 
     54        @param obj: input object to parse 
     55        @type obj: ElementTree Element, or stream object 
     56        @return: ElementTree element 
     57        @rtype: xml.etree.Element 
     58        """ 
    4659        elem = super(ApplyReader, self)._parse(obj) 
    4760         
  • TI12-security/trunk/ndg_xacml/ndg/xacml/parsers/etree/attributedesignatorreader.py

    r7087 r7109  
    2020    ''' 
    2121    def _parseExtension(self, elem, attributeDesignator): 
    22         """Parse AttributeDesignator object""" 
     22        """Parse Attribute Designator element 
     23         
     24        @param elem: ElementTree XML element 
     25        @type elem: xml.etree.Element 
     26         
     27        @param attributeDesignator: attribute designator 
     28        @type attributeDesignator: ndg.xacml.core.attributedesignator.AttributeDesignator 
     29         
     30        @raise XMLParseError: error parsing attribute ID XML attribute 
     31         
     32        @return: updated attribute designator 
     33        @rtype: ndg.xacml.core.attributedesignator.AttributeDesignator 
     34        """ 
    2335        xacmlType = self.__class__.TYPE 
    2436         
  • TI12-security/trunk/ndg_xacml/ndg/xacml/parsers/etree/attributeselectorreader.py

    r7087 r7109  
    1010__contact__ = "Philip.Kershaw@stfc.ac.uk" 
    1111__revision__ = "$Id$" 
     12from ndg.xacml.utils import str2Bool 
    1213from ndg.xacml.core.attributeselector import AttributeSelector 
    1314from ndg.xacml.parsers import XMLParseError 
     
    1718 
    1819class AttributeSelectorReader(ExpressionReader): 
    19     '''ElementTree based parser for XACML Attribute Selector type''' 
     20    '''ElementTree based parser for XACML Attribute Selector type 
     21     
     22    @cvar TYPE: XACML class type that this reader will read values into 
     23    @type TYPE: abc.ABCMeta 
     24    ''' 
    2025    TYPE = AttributeSelector 
    2126     
    2227    def _parseExtension(self, elem, attributeSelector): 
     28        """Parse XML Attribute Selector element 
     29         
     30        @param elem: ElementTree XML element 
     31        @type elem: xml.etree.Element 
     32         
     33        @param attributeSelector: attribute selector to be updated with parsed 
     34        values 
     35        @type attributeSelector: ndg.xacml.core.attributeSelector.AttributeSelector 
     36         
     37        @raise XMLParseError: error parsing attribute ID XML attribute 
     38         
     39        @return: updated attribute selector 
     40        @rtype: ndg.xacml.core.attributeSelector.AttributeSelector 
     41        """ 
    2342         
    2443        xacmlType = self.__class__.TYPE 
  • TI12-security/trunk/ndg_xacml/ndg/xacml/parsers/etree/attributevaluereader.py

    r7087 r7109  
    1919class AttributeValueReader(ExpressionReader): 
    2020    '''ElementTree based XACML Expression type parser 
     21     
     22    @cvar TYPE: XACML class type that this reader will read values into 
     23    @type TYPE: abc.ABCMeta 
     24     
     25    @cvar FACTORY: factory function for returning an Attribute value type for a  
     26    given XACML Attribute value URI 
     27    @type FACTORY: ndg.xacml.core.attributevalue.AttributeValueClassFactory 
    2128    ''' 
    2229    TYPE = AttributeValue 
     
    2734        _parseExtension since AttributeValue class is virtual.  A sub-type can 
    2835        be instantiated only once the data type attribute is parsed 
     36         
     37        @param obj: input object to parse 
     38        @type obj: ElementTree Element, or stream object 
     39        @return: new XACML attribute value instance 
     40        @rtype: ndg.xacml.core.attributevalue.AttributeValue derived type  
     41        @raise XMLParseError: error reading element        
    2942        """ 
    3043        elem = super(AttributeValueReader, self)._parse(obj) 
     
    5568     
    5669    def _parseExtension(self, elem, attributeValue): 
     70        """Parse XML Attribute value element 
     71         
     72        @param elem: ElementTree XML element 
     73        @type elem: xml.etree.Element 
     74         
     75        @param attributeValue: attribute selector to be updated with parsed 
     76        values 
     77        @type attributeValue: ndg.xacml.core.attributevalue.AttributeValue 
     78         
     79        @raise XMLParseError: error parsing attribute ID XML attribute 
     80        """ 
    5781        if elem.text is None: 
    5882            raise XMLParseError('No attribute value element found parsing %r' %  
  • TI12-security/trunk/ndg_xacml/ndg/xacml/parsers/etree/conditionreader.py

    r7087 r7109  
    2323     
    2424    @cvar TYPE: XACML type to instantiate from parsed object 
    25     @type string: type 
     25    @type TYPE: type 
    2626    ''' 
    2727    TYPE = Condition 
    2828     
    2929    def __call__(self, obj): 
    30         """Parse policy object""" 
     30        """Parse condition object 
     31         
     32        @param obj: input object to parse 
     33        @type obj: ElementTree Element, or stream object 
     34        @return: new XACML condition instance 
     35        @rtype: ndg.xacml.core.condition.Condition 
     36        @raise XMLParseError: error reading sub-elements 
     37        """ 
    3138        elem = super(ConditionReader, self)._parse(obj) 
    3239         
  • TI12-security/trunk/ndg_xacml/ndg/xacml/parsers/etree/environmentreader.py

    r7087 r7109  
    1717    '''ElementTree based XACML Rule parser 
    1818    @cvar TYPE: XACML type to instantiate from parsed object 
    19     @type string: type 
     19    @type TYPE: type 
    2020    ''' 
    21     TYPE = Environment         
     21    TYPE = Environment 
     22  
  • TI12-security/trunk/ndg_xacml/ndg/xacml/parsers/etree/expressionreader.py

    r7087 r7109  
    2020class ExpressionReader(ETreeAbstractReader): 
    2121    '''ElementTree based XACML Expression type parser 
     22     
     23    @cvar TYPE: XACML type to instantiate from parsed object 
     24    @type TYPE: abc.ABCMeta 
    2225    ''' 
    2326    TYPE = Expression 
    2427     
    2528    def __call__(self, obj): 
    26         """Parse AttributeValue object""" 
     29        """Parse Expression object 
     30         
     31        @param obj: input object to parse 
     32        @type obj: ElementTree Element, or stream object 
     33        @return: new XACML expression instance 
     34        @rtype: ndg.xacml.core.expression.Expression derived type  
     35        @raise XMLParseError: error reading element                
     36        """ 
    2737        elem = super(ExpressionReader, self)._parse(obj) 
    2838         
     
    5565    def _parseExtension(self, elem, expression): 
    5666        """Derived classes should implement this method to read any remaining 
    57         attributes and elements specific to their type""" 
     67        attributes and elements specific to their type 
     68         
     69        @param elem: ElementTree XML element 
     70        @type elem: xml.etree.Element 
     71         
     72        @param expression: attribute selector to be updated with parsed 
     73        values 
     74        @type expression: ndg.xacml.core.attributevalue.AttributeValue 
     75         
     76         
     77        @raise NotImplementedError: Derived classes should implement 
     78        """ 
    5879        raise NotImplementedError() 
    5980           
  • TI12-security/trunk/ndg_xacml/ndg/xacml/parsers/etree/matchreader.py

    r7087 r7109  
    2222    '''ElementTree based XACML generic Match parser for subject, resource,  
    2323    action and environment match types 
     24     
     25    @cvar ATTRIBUTE_DESIGNATOR_TYPE: type for attribute designator sub-elements: 
     26    derived class should set to relevant type e.g. for SubjectMatch, 
     27    SubjectAttributeDesignator 
     28    @type ATTRIBUTE_DESIGNATOR_TYPE: NoneType 
    2429    ''' 
    2530    ATTRIBUTE_DESIGNATOR_TYPE = None 
    2631     
    2732    def __init__(self): 
     33        """Virtual method 
     34         
     35        @raise NotImplementedError: ATTRIBUTE_DESIGNATOR_TYPE must be set in a  
     36        derived class 
     37        """ 
    2838        if self.__class__.ATTRIBUTE_DESIGNATOR_TYPE is None: 
    2939            raise NotImplementedError('Extend this class setting the ' 
    30                                       '"ATTRIBUTE_DESIGNATOR_TYPE" ' 
    31                                       'class variable') 
     40                                      '"ATTRIBUTE_DESIGNATOR_TYPE" class ' 
     41                                      'variable') 
    3242             
    3343        super(MatchReaderBase, self).__init__() 
    3444         
    3545    def __call__(self, obj): 
    36         """Parse subject object""" 
     46        """Parse *Match object (where * = Subject, Resource, Environment or 
     47        Action 
     48         
     49        @param obj: input object to parse 
     50        @type obj: ElementTree Element, or stream object 
     51        @return: new XACML match instance 
     52        @rtype: ndg.xacml.core.matchreader.MatchReaderBase derived type  
     53        @raise XMLParseError: error reading element                  
     54        """ 
    3755        elem = super(MatchReaderBase, self)._parse(obj) 
    3856         
  • TI12-security/trunk/ndg_xacml/ndg/xacml/parsers/etree/policydefaultsreader.py

    r7087 r7109  
    1818class PolicyDefaultsReader(ETreeAbstractReader): 
    1919    '''ElementTree based XACML PolicyDefaults type parser 
     20     
     21    @cvar TYPE: XACML class type that this reader will read values into 
     22    @type TYPE: type 
    2023    ''' 
    2124    TYPE = PolicyDefaults 
    2225     
    2326    def __call__(self, obj): 
    24         """Parse AttributeValue object""" 
     27        """Parse Policy defaults object 
     28         
     29        @param obj: input object to parse 
     30        @type obj: ElementTree Element, or stream object 
     31        @return: new XACML expression instance 
     32        @rtype: ndg.xacml.core.policydefaults.PolicyDefaults derived type  
     33        @raise XMLParseError: error reading element                
     34        """ 
    2535        elem = super(PolicyDefaultsReader, self)._parse(obj) 
    2636         
  • TI12-security/trunk/ndg_xacml/ndg/xacml/parsers/etree/policyreader.py

    r7087 r7109  
    2424    """Parse a Policy Document using ElementTree 
    2525    @cvar TYPE: XACML type to instantiate from parsed object 
    26     @type string: type""" 
     26    @type TYPE: type""" 
    2727    TYPE = Policy 
    2828     
    2929    def __call__(self, obj): 
    30         """Parse policy object""" 
     30        """Parse policy object 
     31         
     32        @param obj: input object to parse 
     33        @type obj: ElementTree Element, or stream object 
     34        @return: new XACML expression instance 
     35        @rtype: ndg.xacml.core.policy.Policy derived type  
     36        @raise XMLParseError: error reading element   
     37        @raise NotImplementedError: parsing is not implemented for rule 
     38        combiner, combiner parameters and obligations elements.          
     39        """ 
    3140        elem = super(PolicyReader, self)._parse(obj) 
    3241         
  • TI12-security/trunk/ndg_xacml/ndg/xacml/parsers/etree/reader.py

    r7087 r7109  
    2323     
    2424    @cvar TYPE: XACML type to instantiate from parsed object 
    25     @type string: type""" 
     25    @type TYPE: NoneType""" 
    2626    TYPE = None 
    2727     
    2828    def __init__(self): 
     29        """Initialise ElementTree namespace map for XACML 2.0 namespaces 
     30         
     31        @raise NotImplementedError: TYPE class variable must be set in a  
     32        derived class 
     33        """ 
    2934        if self.__class__.TYPE is None: 
    3035            raise NotImplementedError('No "TYPE" class variable set to specify ' 
  • TI12-security/trunk/ndg_xacml/ndg/xacml/parsers/etree/resourceattributedesignatorreader.py

    r7087 r7109  
    1717class ResourceAttributeDesignatorReader(AttributeDesignatorReaderBase):  
    1818    '''ElementTree based XACML Resource Attribute Designator type parser 
     19     
     20    @cvar TYPE: XACML class type that this reader will read values into 
     21    @type TYPE: abc.ABCMeta 
    1922    ''' 
    2023    TYPE = ResourceAttributeDesignator 
  • TI12-security/trunk/ndg_xacml/ndg/xacml/parsers/etree/resourcematchreader.py

    r7087 r7109  
    1616 
    1717class ResourceMatchReader(MatchReaderBase): 
    18     """ElementTree based parser for XACML ResourceMatch""" 
     18    """ElementTree based parser for XACML ResourceMatch 
     19     
     20    @cvar TYPE: XACML class type that this reader will read values into 
     21    @type TYPE: abc.ABCMeta 
     22     
     23    @cvar ATTRIBUTE_DESIGNATOR_TYPE: type for attribute designator sub-elements 
     24    @type ATTRIBUTE_DESIGNATOR_TYPE: abc.ABCMeta 
     25    """ 
    1926    TYPE = ResourceMatch 
    2027    ATTRIBUTE_DESIGNATOR_TYPE = ResourceAttributeDesignator 
  • TI12-security/trunk/ndg_xacml/ndg/xacml/parsers/etree/resourcereader.py

    r7087 r7109  
    1717    '''ElementTree based XACML Rule parser 
    1818    @cvar TYPE: XACML type to instantiate from parsed object 
    19     @type string: type 
     19    @type TYPE: type 
    2020    ''' 
    2121    TYPE = Resource 
  • TI12-security/trunk/ndg_xacml/ndg/xacml/parsers/etree/rulereader.py

    r7087 r7109  
    2323     
    2424    @cvar TYPE: XACML type to instantiate from parsed object 
    25     @type string: type 
     25    @type TYPE: type 
    2626    ''' 
    2727    TYPE = Rule 
    2828     
    2929    def __call__(self, obj): 
    30         """Parse rule object""" 
     30        """Parse rule object 
     31         
     32        @param obj: input object to parse 
     33        @type obj: ElementTree Element, or stream object 
     34        @return: new XACML expression instance 
     35        @rtype: ndg.xacml.core.rule.Rule derived type  
     36        @raise XMLParseError: error reading element                
     37        """ 
    3138        elem = super(RuleReader, self)._parse(obj) 
    3239         
  • TI12-security/trunk/ndg_xacml/ndg/xacml/parsers/etree/subjectattributedesignatorreader.py

    r7087 r7109  
    1717class SubjectAttributeDesignatorReader(AttributeDesignatorReaderBase):  
    1818    '''ElementTree based XACML Subject Attribute Designator type parser 
     19     
     20    @cvar TYPE: XACML class type that this reader will read values into 
     21    @type TYPE: abc.ABCMeta 
    1922    ''' 
    2023    TYPE = SubjectAttributeDesignator 
  • TI12-security/trunk/ndg_xacml/ndg/xacml/parsers/etree/subjectmatchreader.py

    r7087 r7109  
    1616 
    1717class SubjectMatchReader(MatchReaderBase): 
    18     """ElementTree based parser for XACML SubjectMatch""" 
     18    """ElementTree based parser for XACML SubjectMatch 
     19     
     20    @cvar TYPE: XACML class type that this reader will read values into 
     21    @type TYPE: abc.ABCMeta 
     22     
     23    @cvar ATTRIBUTE_DESIGNATOR_TYPE: type for attribute designator sub-elements 
     24    @type ATTRIBUTE_DESIGNATOR_TYPE: abc.ABCMeta 
     25    """ 
    1926    TYPE = SubjectMatch 
    2027    ATTRIBUTE_DESIGNATOR_TYPE = SubjectAttributeDesignator 
  • TI12-security/trunk/ndg_xacml/ndg/xacml/parsers/etree/subjectreader.py

    r7087 r7109  
    1717    '''ElementTree based XACML Rule parser 
    1818    @cvar TYPE: XACML type to instantiate from parsed object 
    19     @type string: type 
     19    @type TYPE: type 
    2020    ''' 
    2121    TYPE = Subject 
  • TI12-security/trunk/ndg_xacml/ndg/xacml/parsers/etree/targetchildreader.py

    r7087 r7109  
    1111__contact__ = "Philip.Kershaw@stfc.ac.uk" 
    1212__revision__ = "$Id$" 
    13 from ndg.xacml.core.subject import Subject 
    1413from ndg.xacml.parsers import XMLParseError 
    1514from ndg.xacml.parsers.etree import QName 
     
    2120    '''ElementTree based XACML generic target child element parser 
    2221    @cvar TYPE: XACML type to instantiate from parsed object 
    23     @type string: type 
     22    @type TYPE: type 
    2423    ''' 
    2524 
    2625    def __call__(self, obj): 
    27         """Parse subject object""" 
     26        """Parse target child element object 
     27         
     28        @param obj: input object to parse 
     29        @type obj: ElementTree Element, or stream object 
     30        @return: new XACML expression instance 
     31        @rtype: ndg.xacml.core.TargetChildBase derived type  
     32        @raise XMLParseError: error reading element                
     33        """ 
    2834        elem = super(TargetChildReader, self)._parse(obj) 
    2935         
  • TI12-security/trunk/ndg_xacml/ndg/xacml/parsers/etree/targetreader.py

    r7087 r7109  
    2525     
    2626    @cvar TYPE: XACML type to instantiate from parsed object 
    27     @type string: type""" 
     27    @type TYPE: type 
     28    """ 
    2829    TYPE = Target 
    2930     
    3031    def __call__(self, obj): 
     32        """Parse Target object 
     33         
     34        @param obj: input object to parse 
     35        @type obj: ElementTree Element, or stream object 
     36        @return: new XACML expression instance 
     37        @rtype: ndg.xacml.core.target.Target derived type  
     38        @raise XMLParseError: error reading element                
     39        """ 
    3140        elem = super(TargetReader, self)._parse(obj) 
    3241         
     
    6776                                    "recognised" % localName) 
    6877                 
    69         return target  
     78        return target 
Note: See TracChangeset for help on using the changeset viewer.