4 CAS_URI = 'http://www.yale.edu/tp/cas'
5 NSMAP = {'cas': CAS_URI}
9 def jasig(auth_success, attrs):
10 attributes = etree.SubElement(auth_success, CAS + 'attributes')
11 style = etree.SubElement(attributes, CAS + 'attraStyle')
13 for name, value in attrs.items():
14 if isinstance(value, collections.Iterable) and not isinstance(value, basestring):
16 element = etree.SubElement(attributes, CAS + name)
19 element = etree.SubElement(attributes, CAS + name)
23 def ruby_cas(auth_success, attrs):
24 style = etree.SubElement(auth_success, CAS + 'attraStyle')
25 style.text = u'RubyCAS'
26 for name, value in attrs.items():
27 if isinstance(value, collections.Iterable) and not isinstance(value, basestring):
29 element = etree.SubElement(auth_success, CAS + name)
32 element = etree.SubElement(auth_success, CAS + name)
36 def name_value(auth_success, attrs):
37 etree.SubElement(auth_success, CAS + 'attribute', name=u'attraStyle', value=u'Name-Value')
38 for name, value in attrs.items():
39 if isinstance(value, collections.Iterable) and not isinstance(value, basestring):
41 etree.SubElement(auth_success, CAS + 'attribute', name=name, value=e)
43 etree.SubElement(auth_success, CAS + 'attribute', name=name, value=value)