summaryrefslogtreecommitdiff
path: root/src/saml2/pack.py
diff options
context:
space:
mode:
authorRoland Hedberg <roland.hedberg@adm.umu.se>2013-02-09 18:57:26 +0100
committerRoland Hedberg <roland.hedberg@adm.umu.se>2013-02-09 18:57:26 +0100
commitf295e06ab790c5454c164255328ebba4a0c4f2da (patch)
treef7b29dd6acb2515cd0afbec4a33a82bc812c2b37 /src/saml2/pack.py
parent71246a38292f2f598163ce4b69a3c298f95d04c2 (diff)
downloadpysaml2-f295e06ab790c5454c164255328ebba4a0c4f2da.tar.gz
Rewrote to use NameID instances every where where I previously used just the text part of the instance.
Diffstat (limited to 'src/saml2/pack.py')
-rw-r--r--src/saml2/pack.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/saml2/pack.py b/src/saml2/pack.py
index d758ce9e..a985e7a4 100644
--- a/src/saml2/pack.py
+++ b/src/saml2/pack.py
@@ -154,9 +154,11 @@ def make_soap_enveloped_saml_thingy(thingy, header_parts=None):
if isinstance(thingy, basestring):
# remove the first XML version/encoding line
+ logger.debug("thingy0: %s" % thingy)
_part = thingy.split("\n")
- thingy = _part[1]
+ thingy = "".join(_part[1:])
thingy = thingy.replace(PREFIX, "")
+ logger.debug("thingy: %s" % thingy)
_child = ElementTree.Element('')
_child.tag = '{%s}FuddleMuddle' % DUMMY_NAMESPACE
body.append(_child)
@@ -165,12 +167,12 @@ def make_soap_enveloped_saml_thingy(thingy, header_parts=None):
# find an remove the namespace definition
i = _str.find(DUMMY_NAMESPACE)
j = _str.rfind("xmlns:", 0, i)
- cut1 = _str[j:i+len(DUMMY_NAMESPACE)+1]
+ cut1 = _str[j:i + len(DUMMY_NAMESPACE) + 1]
_str = _str.replace(cut1, "")
first = _str.find("<%s:FuddleMuddle" % (cut1[6:9],))
last = _str.find(">", first+14)
cut2 = _str[first:last+1]
- return _str.replace(cut2,thingy)
+ return _str.replace(cut2, thingy)
else:
thingy.become_child_element_of(body)
return ElementTree.tostring(envelope, encoding="UTF-8")