3 CAS_URI = 'http://www.yale.edu/tp/cas'
4 NSMAP = {'cas': CAS_URI}
8 def jasig(auth_success, attrs):
9 attributes = etree.SubElement(auth_success, CAS + 'attributes')
10 style = etree.SubElement(attributes, CAS + 'attraStyle')
12 for name, value in attrs.items():
13 if isinstance(value, list):
15 element = etree.SubElement(attributes, CAS + name)
18 element = etree.SubElement(attributes, CAS + name)
22 def ruby_cas(auth_success, attrs):
23 style = etree.SubElement(auth_success, CAS + 'attraStyle')
24 style.text = u'RubyCAS'
25 for name, value in attrs.items():
26 if isinstance(value, list):
28 element = etree.SubElement(auth_success, CAS + name)
31 element = etree.SubElement(auth_success, CAS + name)
35 def name_value(auth_success, attrs):
36 etree.SubElement(auth_success, CAS + 'attribute', name=u'attraStyle', value=u'Name-Value')
37 for name, value in attrs.items():
38 if isinstance(value, list):
40 etree.SubElement(auth_success, CAS + 'attribute', name=name, value=e)
42 etree.SubElement(auth_success, CAS + 'attribute', name=name, value=value)