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)
34 def name_value(auth_success, attrs):
35 etree.SubElement(auth_success, CAS + 'attribute', name=u'attraStyle', value=u'Name-Value')
36 for name, value in attrs.items():
37 if isinstance(value, list):
39 etree.SubElement(auth_success, CAS + 'attribute', name=name, value=e)
41 etree.SubElement(auth_success, CAS + 'attribute', name=name, value=value)