Package ndg :: Package saml :: Package xml :: Module etree :: Class AttributeValueElementTreeFactory
[hide private]

Class AttributeValueElementTreeFactory

source code


Class factory for AttributeValue ElementTree classes. These classes are used to represent SAML Attribute value types

Instance Methods [hide private]
 
__init__(self, customToXMLTypeMap=None, customToSAMLTypeMap=None)
Set-up a SAML class to ElementTree mapping
source code
 
__call__(self, input)
Create an ElementTree object based on the Attribute class type passed in
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]
XSStringAttributeValueElementTree/None
xsstringMatch(elem)
Match function for xs:string type attribute.
source code
Class Variables [hide private]
dict toXMLTypeMap = {<class 'ndg.saml.saml2.core.XSStringAttributeV...
mapping between SAML AttributeValue class and its ElementTree handler class
dict toSAMLTypeMap = [xsstringMatch]
mapping between SAML AttributeValue string identifier and its ElementTree handler class
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

xsstringMatch(elem)
Static Method

source code 

Match function for xs:string type attribute.

Parameters:
  • elem (ElementTree.Element) - Attribute Value element to be checked
Returns: XSStringAttributeValueElementTree/None
Parsing class if this element is an xs:string Attribute Value, None otherwise.

__init__(self, customToXMLTypeMap=None, customToSAMLTypeMap=None)
(Constructor)

source code 

Set-up a SAML class to ElementTree mapping

Parameters:
  • customToXMLTypeMap (dict) - mapping for custom SAML AttributeValue classes to their respective ElementTree based representations. This appends to self.__toXMLTypeMap
  • customToSAMLTypeMap (dict) - string ID based mapping for custom SAML AttributeValue classes to their respective ElementTree based representations. As with customToXMLTypeMap, this appends to to the respective self.__toSAMLTypeMap
Overrides: object.__init__

__call__(self, input)
(Call operator)

source code 

Create an ElementTree object based on the Attribute class type passed in

Parameters:
  • input (saml.saml2.core.AttributeValue or basestring) - pass an AttributeValue derived type or a string. If an AttributeValue type, then self.__toXMLTypeMap is checked for a matching AttributeValue class entry, if a string is passed, self.__toSAMLTypeMap is checked for a matching string ID. In both cases, if a match is found an ElementTree class is returned which can render or parse the relevant AttributeValue class

Class Variable Details [hide private]

toXMLTypeMap

mapping between SAML AttributeValue class and its ElementTree handler class
Type:
dict
Value:
{<class 'ndg.saml.saml2.core.XSStringAttributeValue'>: <class 'ndg.sam\
l.xml.etree.XSStringAttributeValueElementTree'>}