[patches] temporary patch for authentic

handle XML attributes (elementree)
This commit is contained in:
Thomas NOËL 2011-09-28 20:02:10 +02:00
parent b413cdc993
commit ae935e3b1b
5 changed files with 2425 additions and 1 deletions

View File

@ -3,7 +3,7 @@ DIFFDIR = ../copy_overlay/usr/src/univnautes-patches
all: test
diff: test
diff:
for f in `grep -v "^#" list`; \
do \
echo "diff `basename $$f`.diff"; \

View File

@ -27,3 +27,6 @@
# snmp : UCD module
/etc/inc/services.inc
/usr/local/www/services_snmp.php
# temporary patch
/usr/local/authentic/authentic2/idp/saml/saml2_endpoints.py

View File

@ -0,0 +1,39 @@
--- orig/saml2_endpoints.py 2011-09-28 20:00:41.884083980 +0200
+++ new/saml2_endpoints.py 2011-09-28 16:40:17.264414127 +0200
@@ -1,6 +1,7 @@
import datetime
import logging
import urllib
+from xml.etree.ElementTree import tostring as etree_tostring
import lasso
from django.conf.urls.defaults import patterns
@@ -168,15 +169,20 @@
attribute_statement.attribute = list(attribute_statement.attribute) + [ attribute ]
attribute_value_list = list(attribute.attributeValue)
for value in values:
- if value is True:
- value = u'true'
- elif value is False:
- value = u'false'
+ if hasattr(value, 'tag'):
+ # value seems to be a XML element
+ value = etree_tostring(value)
+ text_node = lasso.MiscTextNode.newWithXmlNode(value)
else:
- value = smart_unicode(value)
- value = value.encode('utf-8')
- text_node = lasso.MiscTextNode.newWithString(value)
- text_node.textChild = True
+ if value is True:
+ value = u'true'
+ elif value is False:
+ value = u'false'
+ else:
+ value = smart_unicode(value)
+ value = value.encode('utf-8')
+ text_node = lasso.MiscTextNode.newWithString(value)
+ text_node.textChild = True
attribute_value = lasso.Saml2AttributeValue()
attribute_value.any = [ text_node ]
attribute_value_list.append(attribute_value)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff