summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Kanakarakis <ivan.kanak@gmail.com>2018-10-23 18:01:43 +0300
committerGitHub <noreply@github.com>2018-10-23 18:01:43 +0300
commitab2c644c74c2590939bcdd92e65e3389bbc44dd6 (patch)
treed55ba1393c8b749fc0b14c552475f626251e0134
parent691e981b0ddca9b7d75fa468ef31f494e80c0268 (diff)
parent692bc8e1ea4ff28b3f6c3496846018d2b0bb7985 (diff)
downloadpysaml2-ab2c644c74c2590939bcdd92e65e3389bbc44dd6.tar.gz
Merge pull request #553 from johanlundberg/non_ascii_ava_encryption_decryption
AuthnResponse should store member xmlstr in correct type
-rw-r--r--src/saml2/response.py13
-rw-r--r--tests/test_65_authn_query.py5
2 files changed, 7 insertions, 11 deletions
diff --git a/src/saml2/response.py b/src/saml2/response.py
index a8024fef..39d8e33d 100644
--- a/src/saml2/response.py
+++ b/src/saml2/response.py
@@ -319,7 +319,10 @@ class StatusResponse(object):
def _loads(self, xmldata, decode=True, origxml=None):
# own copy
- self.xmlstr = xmldata[:]
+ if isinstance(xmldata, six.binary_type):
+ self.xmlstr = xmldata[:].decode('utf-8')
+ else:
+ self.xmlstr = xmldata[:]
logger.debug("xmlstr: %s", self.xmlstr)
if origxml:
self.origxml = origxml
@@ -1082,15 +1085,13 @@ class AuthnResponse(StatusResponse):
"session_index": authn_statement.session_index}
def __str__(self):
- if isinstance(self.xmlstr, six.string_types):
- return self.xmlstr
- return str(self.xmlstr)
+ return self.xmlstr
def verify_recipient(self, recipient):
"""
Verify that I'm the recipient of the assertion
-
- :param recipient: A URI specifying the entity or location to which an
+
+ :param recipient: A URI specifying the entity or location to which an
attesting entity can present the assertion.
:return: True/False
"""
diff --git a/tests/test_65_authn_query.py b/tests/test_65_authn_query.py
index 77ccaa9e..e11da2aa 100644
--- a/tests/test_65_authn_query.py
+++ b/tests/test_65_authn_query.py
@@ -65,11 +65,6 @@ def test_flow():
with closing(Server(config_file="idp_all_conf")) as idp:
relay_state = "FOO"
- # -- dummy request ---
- orig_req = AuthnRequest(
- issuer=sp._issuer(),
- name_id_policy=NameIDPolicy(allow_create="true",
- format=NAMEID_FORMAT_TRANSIENT))
# == Create an AuthnRequest response