|
4 | 4 | """Testdata for attribute converters """ |
5 | 5 |
|
6 | 6 | STATEMENT1 = """<?xml version="1.0" encoding="utf-8"?> |
7 | | -<ns1:AttributeStatement xmlns:ns1="urn:oasis:names:tc:SAML:2.0:assertion"> |
8 | | - <ns1:Attribute Name="urn:mace:dir:attribute-def:eduPersonPrincipalName" |
9 | | - NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"> |
10 | | - <ns1:AttributeValue>[email protected]</ns1:AttributeValue> |
11 | | - </ns1:Attribute> |
12 | | - <ns1:Attribute Name="urn:mace:dir:attribute-def:eduPersonTargetedID" |
13 | | - NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"> |
14 | | - <ns1:AttributeValue>a139b2116ad1dd7b91c129a32a242fcc5fd9e821</ns1:AttributeValue> |
15 | | - </ns1:Attribute> |
16 | | - <ns1:Attribute Name="urn:mace:dir:attribute-def:displayName" |
17 | | - NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"> |
18 | | - <ns1:AttributeValue>Hedberg, Roland</ns1:AttributeValue> |
19 | | - </ns1:Attribute> |
20 | | - <ns1:Attribute Name="urn:mace:dir:attribute-def:uid" |
21 | | - NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"> |
22 | | - <ns1:AttributeValue>rohe0002</ns1:AttributeValue> |
23 | | - </ns1:Attribute> |
24 | | - <ns1:Attribute Name="urn:mace:dir:attribute-def:eduPersonNickname" |
25 | | - NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"> |
26 | | - <ns1:AttributeValue>rohe0002</ns1:AttributeValue> |
27 | | - </ns1:Attribute> |
28 | | - <ns1:Attribute Name="urn:mace:dir:attribute-def:cn" |
29 | | - NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"> |
30 | | - <ns1:AttributeValue>Roland Hedberg</ns1:AttributeValue> |
31 | | - </ns1:Attribute> |
32 | | - <ns1:Attribute Name="urn:mace:dir:attribute-def:eduPersonAffiliation" |
33 | | - NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"> |
34 | | - <ns1:AttributeValue>member</ns1:AttributeValue> |
35 | | - <ns1:AttributeValue>employee</ns1:AttributeValue> |
36 | | - <ns1:AttributeValue>staff</ns1:AttributeValue> |
37 | | - </ns1:Attribute> |
38 | | - <ns1:Attribute Name="urn:mace:dir:attribute-def:street" |
39 | | - NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"> |
40 | | - <ns1:AttributeValue>Umeå universitet</ns1:AttributeValue> |
41 | | - </ns1:Attribute> |
42 | | - <ns1:Attribute Name="urn:mace:dir:attribute-def:postalCode" |
43 | | - NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"> |
44 | | - <ns1:AttributeValue>901 87</ns1:AttributeValue> |
45 | | - </ns1:Attribute> |
46 | | - <ns1:Attribute Name="urn:mace:dir:attribute-def:eduPersonScopedAffiliation" |
47 | | - NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"> |
48 | | - <ns1:AttributeValue>[email protected]</ns1:AttributeValue> |
49 | | - <ns1:AttributeValue>[email protected]</ns1:AttributeValue> |
50 | | - <ns1:AttributeValue>[email protected]</ns1:AttributeValue> |
51 | | - </ns1:Attribute> |
52 | | - <ns1:Attribute Name="urn:mace:dir:attribute-def:physicalDeliveryOfficeName" |
53 | | - NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"> |
54 | | - <ns1:AttributeValue>Västra flygeln, plan 4</ns1:AttributeValue> |
55 | | - </ns1:Attribute> |
56 | | - <ns1:Attribute Name="urn:mace:dir:attribute-def:employeeType" |
57 | | - NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"> |
58 | | - <ns1:AttributeValue>IT-arkitekt</ns1:AttributeValue> |
59 | | - <ns1:AttributeValue>övrig/annan befattning</ns1:AttributeValue> |
60 | | - </ns1:Attribute> |
61 | | - <ns1:Attribute Name="urn:mace:dir:attribute-def:ou" |
62 | | - NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"> |
63 | | - <ns1:AttributeValue>Ladokenheten</ns1:AttributeValue> |
64 | | - <ns1:AttributeValue>IT-enheten</ns1:AttributeValue> |
65 | | - </ns1:Attribute> |
66 | | - <ns1:Attribute Name="urn:mace:dir:attribute-def:givenName" |
67 | | - NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"> |
68 | | - <ns1:AttributeValue>Roland</ns1:AttributeValue> |
69 | | - </ns1:Attribute> |
70 | | - <ns1:Attribute Name="urn:mace:dir:attribute-def:sn" |
71 | | - NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"> |
72 | | - <ns1:AttributeValue>Hedberg</ns1:AttributeValue> |
73 | | - </ns1:Attribute> |
74 | | -</ns1:AttributeStatement>""" |
| 7 | +<saml:AttributeStatement xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"> |
| 8 | + <saml:Attribute Name="urn:mace:dir:attribute-def:eduPersonPrincipalName" |
| 9 | + NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"> |
| 10 | + <saml:AttributeValue>[email protected]</saml:AttributeValue> |
| 11 | + </saml:Attribute> |
| 12 | + <saml:Attribute Name="urn:mace:dir:attribute-def:eduPersonTargetedID" |
| 13 | + NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"> |
| 14 | + <saml:AttributeValue>a139b2116ad1dd7b91c129a32a242fcc5fd9e821</saml:AttributeValue> |
| 15 | + </saml:Attribute> |
| 16 | + <saml:Attribute Name="urn:mace:dir:attribute-def:displayName" |
| 17 | + NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"> |
| 18 | + <saml:AttributeValue>Hedberg, Roland</saml:AttributeValue> |
| 19 | + </saml:Attribute> |
| 20 | + <saml:Attribute Name="urn:mace:dir:attribute-def:uid" |
| 21 | + NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"> |
| 22 | + <saml:AttributeValue>rohe0002</saml:AttributeValue> |
| 23 | + </saml:Attribute> |
| 24 | + <saml:Attribute Name="urn:mace:dir:attribute-def:eduPersonNickname" |
| 25 | + NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"> |
| 26 | + <saml:AttributeValue>rohe0002</saml:AttributeValue> |
| 27 | + </saml:Attribute> |
| 28 | + <saml:Attribute Name="urn:mace:dir:attribute-def:cn" |
| 29 | + NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"> |
| 30 | + <saml:AttributeValue>Roland Hedberg</saml:AttributeValue> |
| 31 | + </saml:Attribute> |
| 32 | + <saml:Attribute Name="urn:mace:dir:attribute-def:eduPersonAffiliation" |
| 33 | + NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"> |
| 34 | + <saml:AttributeValue>member</saml:AttributeValue> |
| 35 | + <saml:AttributeValue>employee</saml:AttributeValue> |
| 36 | + <saml:AttributeValue>staff</saml:AttributeValue> |
| 37 | + </saml:Attribute> |
| 38 | + <saml:Attribute Name="urn:mace:dir:attribute-def:street" |
| 39 | + NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"> |
| 40 | + <saml:AttributeValue>Umeå universitet</saml:AttributeValue> |
| 41 | + </saml:Attribute> |
| 42 | + <saml:Attribute Name="urn:mace:dir:attribute-def:postalCode" |
| 43 | + NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"> |
| 44 | + <saml:AttributeValue>901 87</saml:AttributeValue> |
| 45 | + </saml:Attribute> |
| 46 | + <saml:Attribute Name="urn:mace:dir:attribute-def:eduPersonScopedAffiliation" |
| 47 | + NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"> |
| 48 | + <saml:AttributeValue>[email protected]</saml:AttributeValue> |
| 49 | + <saml:AttributeValue>[email protected]</saml:AttributeValue> |
| 50 | + <saml:AttributeValue>[email protected]</saml:AttributeValue> |
| 51 | + </saml:Attribute> |
| 52 | + <saml:Attribute Name="urn:mace:dir:attribute-def:physicalDeliveryOfficeName" |
| 53 | + NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"> |
| 54 | + <saml:AttributeValue>Västra flygeln, plan 4</saml:AttributeValue> |
| 55 | + </saml:Attribute> |
| 56 | + <saml:Attribute Name="urn:mace:dir:attribute-def:employeeType" |
| 57 | + NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"> |
| 58 | + <saml:AttributeValue>IT-arkitekt</saml:AttributeValue> |
| 59 | + <saml:AttributeValue>övrig/annan befattning</saml:AttributeValue> |
| 60 | + </saml:Attribute> |
| 61 | + <saml:Attribute Name="urn:mace:dir:attribute-def:ou" |
| 62 | + NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"> |
| 63 | + <saml:AttributeValue>Ladokenheten</saml:AttributeValue> |
| 64 | + <saml:AttributeValue>IT-enheten</saml:AttributeValue> |
| 65 | + </saml:Attribute> |
| 66 | + <saml:Attribute Name="urn:mace:dir:attribute-def:givenName" |
| 67 | + NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"> |
| 68 | + <saml:AttributeValue>Roland</saml:AttributeValue> |
| 69 | + </saml:Attribute> |
| 70 | + <saml:Attribute Name="urn:mace:dir:attribute-def:sn" |
| 71 | + NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"> |
| 72 | + <saml:AttributeValue>Hedberg</saml:AttributeValue> |
| 73 | + </saml:Attribute> |
| 74 | +</saml:AttributeStatement>""" |
75 | 75 |
|
76 | 76 |
|
77 | 77 | STATEMENT2 = """<?xml version="1.0" encoding="utf-8"?> |
|
129 | 129 | </saml2:AttributeStatement>""" |
130 | 130 |
|
131 | 131 | STATEMENT3 = """<?xml version='1.0' encoding='UTF-8'?> |
132 | | -<ns0:AttributeStatement xmlns:ns0="urn:oasis:names:tc:SAML:2.0:assertion"> |
133 | | - <ns0:Attribute Name="umuselin"> |
134 | | - <ns0:AttributeValue>1234567890</ns0:AttributeValue> |
135 | | - </ns0:Attribute> |
136 | | - <ns0:Attribute Name="edupersonaffiliation"> |
137 | | - <ns0:AttributeValue>staff</ns0:AttributeValue> |
138 | | - </ns0:Attribute> |
139 | | - <ns0:Attribute FriendlyName="surname" Name="urn:oid:2.5.4.4" |
| 132 | +<saml:AttributeStatement xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"> |
| 133 | + <saml:Attribute Name="umuselin"> |
| 134 | + <saml:AttributeValue>1234567890</saml:AttributeValue> |
| 135 | + </saml:Attribute> |
| 136 | + <saml:Attribute Name="edupersonaffiliation"> |
| 137 | + <saml:AttributeValue>staff</saml:AttributeValue> |
| 138 | + </saml:Attribute> |
| 139 | + <saml:Attribute FriendlyName="surname" Name="urn:oid:2.5.4.4" |
140 | 140 | NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri"> |
141 | | - <ns0:AttributeValue>Hedberg</ns0:AttributeValue> |
142 | | - </ns0:Attribute> |
143 | | - <ns0:Attribute Name="uid"> |
144 | | - <ns0:AttributeValue>roland</ns0:AttributeValue> |
145 | | - </ns0:Attribute> |
146 | | - <ns0:Attribute Name="givenname"> |
147 | | - <ns0:AttributeValue>Roland</ns0:AttributeValue> |
148 | | - </ns0:Attribute> |
149 | | -</ns0:AttributeStatement>""" |
| 141 | + <saml:AttributeValue>Hedberg</saml:AttributeValue> |
| 142 | + </saml:Attribute> |
| 143 | + <saml:Attribute Name="uid"> |
| 144 | + <saml:AttributeValue>roland</saml:AttributeValue> |
| 145 | + </saml:Attribute> |
| 146 | + <saml:Attribute Name="givenname"> |
| 147 | + <saml:AttributeValue>Roland</saml:AttributeValue> |
| 148 | + </saml:Attribute> |
| 149 | +</saml:AttributeStatement>""" |
150 | 150 |
|
151 | 151 | STATEMENT4 = """<?xml version='1.0' encoding='UTF-8'?> |
152 | | -<ns0:AttributeStatement xmlns:ns0="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> |
153 | | - <ns0:Attribute Name="user_id" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified"> |
154 | | - <ns0:AttributeValue xsi:type="xs:string">bob</ns0:AttributeValue> |
155 | | - </ns0:Attribute> |
156 | | - <ns0:Attribute Name="NameID" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified"> |
157 | | - <ns0:AttributeValue xsi:type="xs:string">bobsnameagain</ns0:AttributeValue> |
158 | | - </ns0:Attribute> |
159 | | -</ns0:AttributeStatement>""" |
| 152 | +<saml:AttributeStatement xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> |
| 153 | + <saml:Attribute Name="user_id" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified"> |
| 154 | + <saml:AttributeValue xsi:type="xs:string">bob</saml:AttributeValue> |
| 155 | + </saml:Attribute> |
| 156 | + <saml:Attribute Name="NameID" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified"> |
| 157 | + <saml:AttributeValue xsi:type="xs:string">bobsnameagain</saml:AttributeValue> |
| 158 | + </saml:Attribute> |
| 159 | +</saml:AttributeStatement>""" |
160 | 160 |
|
161 | 161 | STATEMENT_MIXED = """<?xml version="1.0" encoding="utf-8"?> |
162 | 162 | <saml2:AttributeStatement xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion"> |
|
0 commit comments