File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 1
1
from pathutils import full_path as expand_full_path
2
+
2
3
from pytest import mark
3
4
from pytest import raises
4
5
6
+ from saml2 import create_class_from_xml_string
7
+ from saml2 .saml import AttributeStatement
8
+ from saml2 .sigver import validate_doc_with_schema
5
9
from saml2 .xml .schema import XMLSchemaError
6
10
from saml2 .xml .schema import validate as validate_doc_with_schema
7
11
@@ -86,3 +90,20 @@ def test_valid_saml_partial_doc(doc):
86
90
def test_valid_eidas_saml_response_doc (doc ):
87
91
result = validate_doc_with_schema (expand_full_path (doc ))
88
92
assert result == None
93
+
94
+
95
+ def test_namespace_processing ():
96
+ elem = create_class_from_xml_string (
97
+ AttributeStatement ,
98
+ """
99
+ <saml:AttributeStatement xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema">
100
+ <saml:Attribute Name="urn:mace:dir:attribute-def:uid" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
101
+ <saml:AttributeValue xsi:type="xs:string">alum11</saml:AttributeValue>
102
+ </saml:Attribute>
103
+ <saml:Attribute Name="urn:mace:terena.org:attribute-def:schacHomeOrganization" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
104
+ <saml:AttributeValue xsi:type="xs:string"/>
105
+ </saml:Attribute>
106
+ </saml:AttributeStatement>
107
+ """ ,
108
+ )
109
+ validate_doc_with_schema (str (elem ))
You can’t perform that action at this time.
0 commit comments