Fixed the identifier for base64 value type
This commit is contained in:
@@ -855,7 +855,7 @@ def _decode_attribute_value(typ, text):
|
||||
return str(float(text))
|
||||
if typ == XSD + "boolean":
|
||||
return "%s" % (text == "true")
|
||||
if typ == NS_SOAP_ENC + "base64":
|
||||
if typ == XSD + "base64Binary":
|
||||
import base64
|
||||
return base64.decodestring(text)
|
||||
raise ValueError("type %s not supported" % type)
|
||||
|
||||
@@ -168,7 +168,7 @@ def make_instance(klass, spec, base64encode=False):
|
||||
if base64encode:
|
||||
import base64
|
||||
val = base64.encodestring(val)
|
||||
setattr(klass_inst, "type", saml.NS_SOAP_ENC + "base64")
|
||||
setattr(klass_inst, "type", "xs:base64Binary")
|
||||
else:
|
||||
if isinstance(val, basestring):
|
||||
print "basestring"
|
||||
|
||||
@@ -400,7 +400,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"
|
||||
Name="FirstName">
|
||||
<AttributeValue
|
||||
xsi:type="http://schemas.xmlsoap.org/soap/encoding/base64">VU5JTkVUVA==</AttributeValue>
|
||||
xsi:type="xs:base64Binary">VU5JTkVUVA==</AttributeValue>
|
||||
</Attribute>"""
|
||||
|
||||
X500_AV = """<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
@@ -152,7 +152,7 @@ def test_attribute_base64():
|
||||
assert inst.name == "name"
|
||||
assert len(inst.attribute_value) == 1
|
||||
av = inst.attribute_value[0]
|
||||
assert av.type == "http://schemas.xmlsoap.org/soap/encoding/base64"
|
||||
assert av.type == "xs:base64Binary"
|
||||
assert av.text.strip() == "U2VsbWEgTGFnZXJsw7Zm"
|
||||
|
||||
def test_attribute_statement():
|
||||
|
||||
Reference in New Issue
Block a user