summaryrefslogtreecommitdiff
path: root/tests/attribute_statement_data.py
blob: dae085f1090f389d3fa56e1106b85a7c2bd882e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""Testdata for attribute converters """

STATEMENT1 = """<?xml version="1.0" encoding="utf-8"?>
<ns1:AttributeStatement xmlns:ns1="urn:oasis:names:tc:SAML:2.0:assertion">
    <ns1:Attribute Name="urn:mace:dir:attribute-def:eduPersonPrincipalName"
        NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
        <ns1:AttributeValue>rohe0002@umu.se</ns1:AttributeValue>
    </ns1:Attribute>
    <ns1:Attribute Name="urn:mace:dir:attribute-def:eduPersonTargetedID"
        NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
        <ns1:AttributeValue>a139b2116ad1dd7b91c129a32a242fcc5fd9e821</ns1:AttributeValue>
    </ns1:Attribute>
    <ns1:Attribute Name="urn:mace:dir:attribute-def:displayName" 
        NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
        <ns1:AttributeValue>Hedberg, Roland</ns1:AttributeValue>
    </ns1:Attribute>
    <ns1:Attribute Name="urn:mace:dir:attribute-def:uid" 
        NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
        <ns1:AttributeValue>rohe0002</ns1:AttributeValue>
    </ns1:Attribute>
    <ns1:Attribute Name="urn:mace:dir:attribute-def:eduPersonNickname" 
        NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
        <ns1:AttributeValue>rohe0002</ns1:AttributeValue>
    </ns1:Attribute>
    <ns1:Attribute Name="urn:mace:dir:attribute-def:cn" 
        NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
        <ns1:AttributeValue>Roland Hedberg</ns1:AttributeValue>
    </ns1:Attribute>
    <ns1:Attribute Name="urn:mace:dir:attribute-def:eduPersonAffiliation" 
        NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
        <ns1:AttributeValue>member</ns1:AttributeValue>
        <ns1:AttributeValue>employee</ns1:AttributeValue>
        <ns1:AttributeValue>staff</ns1:AttributeValue>
    </ns1:Attribute>
    <ns1:Attribute Name="urn:mace:dir:attribute-def:street" 
        NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
        <ns1:AttributeValue>Umeå universitet</ns1:AttributeValue>
    </ns1:Attribute>
    <ns1:Attribute Name="urn:mace:dir:attribute-def:postalCode" 
        NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
        <ns1:AttributeValue>901 87</ns1:AttributeValue>
    </ns1:Attribute>
    <ns1:Attribute Name="urn:mace:dir:attribute-def:eduPersonScopedAffiliation" 
        NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
        <ns1:AttributeValue>employee@umu.se</ns1:AttributeValue>
        <ns1:AttributeValue>staff@umu.se</ns1:AttributeValue>
        <ns1:AttributeValue>member@umu.se</ns1:AttributeValue>
    </ns1:Attribute>
    <ns1:Attribute Name="urn:mace:dir:attribute-def:physicalDeliveryOfficeName" 
        NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
        <ns1:AttributeValue>Västra flygeln, plan 4</ns1:AttributeValue>
    </ns1:Attribute>
    <ns1:Attribute Name="urn:mace:dir:attribute-def:employeeType" 
        NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
        <ns1:AttributeValue>IT-arkitekt</ns1:AttributeValue>
        <ns1:AttributeValue>övrig/annan befattning</ns1:AttributeValue>
    </ns1:Attribute>
    <ns1:Attribute Name="urn:mace:dir:attribute-def:ou" 
        NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
        <ns1:AttributeValue>Ladokenheten</ns1:AttributeValue>
        <ns1:AttributeValue>IT-enheten</ns1:AttributeValue>
    </ns1:Attribute>
    <ns1:Attribute Name="urn:mace:dir:attribute-def:givenName" 
        NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
        <ns1:AttributeValue>Roland</ns1:AttributeValue>
    </ns1:Attribute>
    <ns1:Attribute Name="urn:mace:dir:attribute-def:sn" 
        NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
        <ns1:AttributeValue>Hedberg</ns1:AttributeValue>
    </ns1:Attribute>
</ns1:AttributeStatement>"""


STATEMENT2 = """<?xml version="1.0" encoding="utf-8"?>
<saml2:AttributeStatement xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion">
    <saml2:Attribute FriendlyName="uid" Name="urn:oid:0.9.2342.19200300.100.1.1" 
        NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
        <saml2:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" 
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
            xsi:type="xs:string">demouser</saml2:AttributeValue>
    </saml2:Attribute>
    <saml2:Attribute FriendlyName="surname"
        Name="urn:oid:2.5.4.4" 
        NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
        <saml2:AttributeValue 
            xmlns:xs="http://www.w3.org/2001/XMLSchema" 
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
            xsi:type="xs:string">SWITCHaai</saml2:AttributeValue>
    </saml2:Attribute>
    <saml2:Attribute FriendlyName="givenName" 
        Name="urn:oid:2.5.4.42" 
        NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
        <saml2:AttributeValue 
            xmlns:xs="http://www.w3.org/2001/XMLSchema" 
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
            xsi:type="xs:string">Demouser</saml2:AttributeValue>
    </saml2:Attribute>
    <saml2:Attribute FriendlyName="eduPersonAffiliation" 
        Name="urn:oid:1.3.6.1.4.1.5923.1.1.1.1" 
        NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
        <saml2:AttributeValue 
            xmlns:xs="http://www.w3.org/2001/XMLSchema" 
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
            xsi:type="xs:string">staff</saml2:AttributeValue>
    </saml2:Attribute>
    <saml2:Attribute FriendlyName="eduPersonEntitlement" 
        Name="urn:oid:1.3.6.1.4.1.5923.1.1.1.7" 
        NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
        <saml2:AttributeValue 
            xmlns:xs="http://www.w3.org/2001/XMLSchema" 
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
            xsi:type="xs:string">http://example.org/res/99999</saml2:AttributeValue>
        <saml2:AttributeValue 
            xmlns:xs="http://www.w3.org/2001/XMLSchema" 
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
            xsi:type="xs:string">http://publisher-xy.com/e-journals</saml2:AttributeValue>
    </saml2:Attribute>
    <saml2:Attribute FriendlyName="mail" 
        Name="urn:oid:0.9.2342.19200300.100.1.3" 
        NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
        <saml2:AttributeValue 
            xmlns:xs="http://www.w3.org/2001/XMLSchema" 
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
            xsi:type="xs:string">demouser@example.org</saml2:AttributeValue>
    </saml2:Attribute>
</saml2:AttributeStatement>"""

STATEMENT3 = """<?xml version='1.0' encoding='UTF-8'?>
<ns0:AttributeStatement xmlns:ns0="urn:oasis:names:tc:SAML:2.0:assertion">
    <ns0:Attribute Name="umuselin">
        <ns0:AttributeValue>1234567890</ns0:AttributeValue>
    </ns0:Attribute>
    <ns0:Attribute Name="edupersonaffiliation">
        <ns0:AttributeValue>staff</ns0:AttributeValue>
    </ns0:Attribute>
    <ns0:Attribute FriendlyName="surname" Name="urn:oid:2.5.4.4" 
        NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
        <ns0:AttributeValue>Hedberg</ns0:AttributeValue>
    </ns0:Attribute>
    <ns0:Attribute Name="uid">
        <ns0:AttributeValue>roland</ns0:AttributeValue>
    </ns0:Attribute>
    <ns0:Attribute Name="givenname">
        <ns0:AttributeValue>Roland</ns0:AttributeValue>
    </ns0:Attribute>
</ns0:AttributeStatement>"""

STATEMENT4 = """<?xml version='1.0' encoding='UTF-8'?>
<ns0:AttributeStatement xmlns:ns0="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <ns0:Attribute Name="user_id" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified">
        <ns0:AttributeValue xsi:type="xs:string">bob</ns0:AttributeValue>
    </ns0:Attribute>
    <ns0:Attribute Name="NameID" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified">
        <ns0:AttributeValue xsi:type="xs:string">bobsnameagain</ns0:AttributeValue>
    </ns0:Attribute>
</ns0:AttributeStatement>"""

STATEMENT_MIXED = """<?xml version="1.0" encoding="utf-8"?>
<saml2:AttributeStatement xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion">
    <saml2:Attribute FriendlyName="uid" Name="urn:oid:0.9.2342.19200300.100.1.1"
        NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
        <saml2:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:type="xs:string">demouser</saml2:AttributeValue>
    </saml2:Attribute>
    <saml2:Attribute FriendlyName="swissEduPersonHomeOrganizationType"
        Name="urn:oid:2.16.756.1.2.5.1.1.5"
        NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
        <saml2:AttributeValue
            xmlns:xs="http://www.w3.org/2001/XMLSchema"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:type="xs:string">others</saml2:AttributeValue>
    </saml2:Attribute>
    <saml2:Attribute Name="urn:mace:dir:attribute-def:givenName"
        NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
        <saml2:AttributeValue>Roland</saml2:AttributeValue>
    </saml2:Attribute>
    <saml2:Attribute Name="urn:mace:dir:attribute-def:sn"
        NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
        <saml2:AttributeValue>Hedberg</saml2:AttributeValue>
    </saml2:Attribute>
    <saml2:Attribute FriendlyName="eduPersonAffiliation"
        Name="urn:oid:1.3.6.1.4.1.5923.1.1.1.1"
        NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
        <saml2:AttributeValue
            xmlns:xs="http://www.w3.org/2001/XMLSchema"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:type="xs:string">staff</saml2:AttributeValue>
    </saml2:Attribute>
    <saml2:Attribute Name="urn:example:com:foo"
        NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:example">
        <saml2:AttributeValue>Thing</saml2:AttributeValue>
    </saml2:Attribute>
    <saml2:Attribute Name="user_id"
        NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified">
        <saml2:AttributeValue>bob</saml2:AttributeValue>
    </saml2:Attribute>
</saml2:AttributeStatement>"""