Skip to content

Commit 1553bc6

Browse files
author
Roland Hedberg
committed
Fixed test data and added new set.
1 parent e1aa578 commit 1553bc6

File tree

1 file changed

+45
-29
lines changed

1 file changed

+45
-29
lines changed

tests/attribute_statement_data.py

Lines changed: 45 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55

66
STATEMENT1 = """<?xml version="1.0" encoding="utf-8"?>
77
<ns1:AttributeStatement xmlns:ns1="urn:oasis:names:tc:SAML:2.0:assertion">
8-
<ns1:Attribute Name="eduPersonPrincipalName"
8+
<ns1:Attribute Name="urn:mace:dir:attribute-def:eduPersonPrincipalName"
99
NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
1010
<ns1:AttributeValue>[email protected]</ns1:AttributeValue>
1111
</ns1:Attribute>
12-
<ns1:Attribute Name="eduPersonTargetedID"
12+
<ns1:Attribute Name="urn:mace:dir:attribute-def:eduPersonTargetedID"
1313
NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
1414
<ns1:AttributeValue>a139b2116ad1dd7b91c129a32a242fcc5fd9e821</ns1:AttributeValue>
1515
</ns1:Attribute>
@@ -82,15 +82,7 @@
8282
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
8383
xsi:type="xs:string">demouser</saml2:AttributeValue>
8484
</saml2:Attribute>
85-
<saml2:Attribute FriendlyName="swissEduPersonHomeOrganizationType"
86-
Name="urn:oid:2.16.756.1.2.5.1.1.5"
87-
NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
88-
<saml2:AttributeValue
89-
xmlns:xs="http://www.w3.org/2001/XMLSchema"
90-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
91-
xsi:type="xs:string">others</saml2:AttributeValue>
92-
</saml2:Attribute>
93-
<saml2:Attribute FriendlyName="surname"
85+
<saml2:Attribute FriendlyName="surname"
9486
Name="urn:oid:2.5.4.4"
9587
NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
9688
<saml2:AttributeValue
@@ -134,24 +126,6 @@
134126
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
135127
xsi:type="xs:string">[email protected]</saml2:AttributeValue>
136128
</saml2:Attribute>
137-
<saml2:Attribute
138-
FriendlyName="swissEduPersonUniqueID"
139-
Name="urn:oid:2.16.756.1.2.5.1.1.1"
140-
NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
141-
<saml2:AttributeValue
142-
xmlns:xs="http://www.w3.org/2001/XMLSchema"
143-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
144-
xsi:type="xs:string">[email protected]</saml2:AttributeValue>
145-
</saml2:Attribute>
146-
<saml2:Attribute
147-
FriendlyName="swissEduPersonHomeOrganization"
148-
Name="urn:oid:2.16.756.1.2.5.1.1.4"
149-
NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
150-
<saml2:AttributeValue
151-
xmlns:xs="http://www.w3.org/2001/XMLSchema"
152-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
153-
xsi:type="xs:string">example.org</saml2:AttributeValue>
154-
</saml2:Attribute>
155129
</saml2:AttributeStatement>"""
156130

157131
STATEMENT3 = """<?xml version='1.0' encoding='UTF-8'?>
@@ -183,3 +157,45 @@
183157
<ns0:AttributeValue xsi:type="xs:string">bobsnameagain</ns0:AttributeValue>
184158
</ns0:Attribute>
185159
</ns0:AttributeStatement>"""
160+
161+
STATEMENT_MIXED = """<?xml version="1.0" encoding="utf-8"?>
162+
<saml2:AttributeStatement xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion">
163+
<saml2:Attribute FriendlyName="uid" Name="urn:oid:0.9.2342.19200300.100.1.1"
164+
NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
165+
<saml2:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema"
166+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
167+
xsi:type="xs:string">demouser</saml2:AttributeValue>
168+
</saml2:Attribute>
169+
<saml2:Attribute FriendlyName="swissEduPersonHomeOrganizationType"
170+
Name="urn:oid:2.16.756.1.2.5.1.1.5"
171+
NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
172+
<saml2:AttributeValue
173+
xmlns:xs="http://www.w3.org/2001/XMLSchema"
174+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
175+
xsi:type="xs:string">others</saml2:AttributeValue>
176+
</saml2:Attribute>
177+
<saml2:Attribute Name="urn:mace:dir:attribute-def:givenName"
178+
NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
179+
<saml2:AttributeValue>Roland</saml2:AttributeValue>
180+
</saml2:Attribute>
181+
<saml2:Attribute Name="urn:mace:dir:attribute-def:sn"
182+
NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
183+
<saml2:AttributeValue>Hedberg</saml2:AttributeValue>
184+
</saml2:Attribute>
185+
<saml2:Attribute FriendlyName="eduPersonAffiliation"
186+
Name="urn:oid:1.3.6.1.4.1.5923.1.1.1.1"
187+
NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
188+
<saml2:AttributeValue
189+
xmlns:xs="http://www.w3.org/2001/XMLSchema"
190+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
191+
xsi:type="xs:string">staff</saml2:AttributeValue>
192+
</saml2:Attribute>
193+
<saml2:Attribute Name="urn:example:com:foo"
194+
NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:example">
195+
<saml2:AttributeValue>Thing</saml2:AttributeValue>
196+
</saml2:Attribute>
197+
<saml2:Attribute Name="user_id"
198+
NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified">
199+
<saml2:AttributeValue>bob</saml2:AttributeValue>
200+
</saml2:Attribute>
201+
</saml2:AttributeStatement>"""

0 commit comments

Comments
 (0)