diff options
author | Hans Hörberg <hans.horberg@umu.se> | 2015-03-16 16:44:00 +0100 |
---|---|---|
committer | Hans Hörberg <hans.horberg@umu.se> | 2015-03-16 16:44:00 +0100 |
commit | 15119f04dc49eea0bc91c7d43224843ab9b25899 (patch) | |
tree | 27c7f78428e2f0bc71a77a748f1bc63b22d7f971 /src/saml2/__init__.py | |
parent | 6e0acc8997b8290ee7a03fbb3aa5a19ce1158e03 (diff) | |
download | pysaml2-15119f04dc49eea0bc91c7d43224843ab9b25899.tar.gz |
Updated pysaml2 to support PEFIM.
Added encrypted assertions with self contained namespaces in the advice element.
Diffstat (limited to 'src/saml2/__init__.py')
-rw-r--r-- | src/saml2/__init__.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/saml2/__init__.py b/src/saml2/__init__.py index 0197d917..925480db 100644 --- a/src/saml2/__init__.py +++ b/src/saml2/__init__.py @@ -587,7 +587,19 @@ class SamlBase(ExtensionContainer): prefix_map["encas%d" % len(prefix_map)] = uri return prefix_map - def get_xml_string_with_self_contained__assertion_within_encrypted_assertion(self, assertion_tag): + def get_xml_string_with_self_contained_assertion_within_advice_encrypted_assertion(self, assertion_tag, advice_tag): + for tmp_encrypted_assertion in self.assertion.advice.encrypted_assertion: + prefix_map = self.get_prefix_map([tmp_encrypted_assertion._to_element_tree(). + find(assertion_tag)]) + + tree = self._to_element_tree() + + self.set_prefixes(tree.find(assertion_tag).find(advice_tag).find(tmp_encrypted_assertion._to_element_tree() + .tag).find(assertion_tag), prefix_map) + + return ElementTree.tostring(tree, encoding="UTF-8") + + def get_xml_string_with_self_contained_assertion_within_encrypted_assertion(self, assertion_tag): prefix_map = self.get_prefix_map([self.encrypted_assertion._to_element_tree().find(assertion_tag)]) tree = self._to_element_tree() |