Skip to content

Commit 2fd48eb

Browse files
committed
Add namespace prefixes to all tests
sed -i 's/ns1/saml/g' $(git grep -l 'xmlns:ns1="urn:oasis:names:tc:SAML:2.0:assertion"') sed -i 's/ns2/saml/g' $(git grep -l 'xmlns:ns2="urn:oasis:names:tc:SAML:2.0:assertion"') sed -i 's/ns4/saml/g' $(git grep -l 'xmlns:ns4="urn:oasis:names:tc:SAML:2.0:assertion"') sed -i 's/ns2/xsi/g' $(git grep -l 'xmlns:ns2="http://www.w3.org/2001/XMLSchema-instance"') sed -i 's/ns3/xsi/g' $(git grep -l 'xmlns:ns3="http://www.w3.org/2001/XMLSchema-instance"') sed -i 's/ns3/samlp/g' $(git grep -l 'xmlns:ns3="urn:oasis:names:tc:SAML:2.0:protocol"') sed -i 's/ns1/ds/g' $(git grep -l 'xmlns:ns1="http://www.w3.org/2000/09/xmldsig#"') sed -i 's/ns2/ds/g' $(git grep -l 'xmlns:ns2="http://www.w3.org/2000/09/xmldsig#"') sed -i 's/ns3/ds/g' $(git grep -l 'xmlns:ns3="http://www.w3.org/2000/09/xmldsig#"') sed -i 's/ns5/ds/g' $(git grep -l 'xmlns:ns5="http://www.w3.org/2000/09/xmldsig#"') sed -i 's/ns0/md/g' $(git grep -l 'xmlns:ns0="urn:oasis:names:tc:SAML:2.0:metadata"') sed -i 's/ns0/saml/g' $(git grep -l 'xmlns:ns0="urn:oasis:names:tc:SAML:2.0:assertion"') sed -i 's/ns0/samlp/g' $(git grep -l 'xmlns:ns0="urn:oasis:names:tc:SAML:2.0:protocol"') sed -i 's/ns0/xenc/g' $(git grep -l 'xmlns:ns0="http://www.w3.org/2001/04/xmlenc#"' sed -i 's/ns1/xenc/g' $(git grep -l 'xmlns:ns1="http://www.w3.org/2001/04/xmlenc#"') sed -i 's/ns1/mdattr/g' $(git grep -l 'xmlns:ns1="urn:oasis:names:tc:SAML:metadata:attribute"') sed -i 's/ns4/idpdisc/g' $(git grep -l 'xmlns:ns4="urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol"') sed -i 's/ns1/idpdisc/g' $(git grep -l 'xmlns:ns1="urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol"') sed -i 's/ns2/mdui/g' $(git grep -l 'xmlns:ns2="urn:oasis:names:tc:SAML:metadata:ui"') sed -i 's/ns2/ecp/g' $(git grep -l 'xmlns:ns2="urn:oasis:names:tc:SAML:2.0:profiles:SSO:ecp"') important: don't modify tests/swamid-2.0.xml
1 parent e06dc29 commit 2fd48eb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1452
-1452
lines changed

tests/attribute_statement_data.py

Lines changed: 93 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -4,74 +4,74 @@
44
"""Testdata for attribute converters """
55

66
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>"""
7575

7676

7777
STATEMENT2 = """<?xml version="1.0" encoding="utf-8"?>
@@ -129,34 +129,34 @@
129129
</saml2:AttributeStatement>"""
130130

131131
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"
140140
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>"""
150150

151151
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>"""
160160

161161
STATEMENT_MIXED = """<?xml version="1.0" encoding="utf-8"?>
162162
<saml2:AttributeStatement xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion">

tests/ecp_soap.xml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
<ns0:Envelope xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/"
22
xmlns:ns1="urn:liberty:paos:2003-08"
3-
xmlns:ns2="urn:oasis:names:tc:SAML:2.0:profiles:SSO:ecp"
4-
xmlns:ns3="urn:oasis:names:tc:SAML:2.0:protocol"
5-
xmlns:ns4="urn:oasis:names:tc:SAML:2.0:assertion">
3+
xmlns:ecp="urn:oasis:names:tc:SAML:2.0:profiles:SSO:ecp"
4+
xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
5+
xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">
66
<ns0:Header>
77
<ns1:Request responseConsumerURL="https://sp.example.org/PAOSConsumer"
88
service="urn:oasis:names:tc:SAML:2.0:profiles:SSO:ecp"
99
ns0:actor="http://schemas.xmlsoap.org/soap/actor/next"
1010
ns0:mustUnderstand="1"/>
11-
<ns2:Request ProviderName="Example Service Provider"
11+
<ecp:Request ProviderName="Example Service Provider"
1212
ns0:actor="http://schemas.xmlsoap.org/soap/actor/next"
1313
ns0:mustUnderstand="1">
14-
<ns3:IDPList>
15-
<ns3:IDPEntry Loc="https://idp.example.org/saml2/sso"
14+
<samlp:IDPList>
15+
<samlp:IDPEntry Loc="https://idp.example.org/saml2/sso"
1616
Name="Example identity provider"
1717
ProviderID="https://idp.example.org/entity"/>
18-
</ns3:IDPList>
19-
<ns4:Issuer>https://sp.example.org/entity</ns4:Issuer>
20-
</ns2:Request>
21-
<ns2:RelayState ns0:actor="http://schemas.xmlsoap.org/soap/actor/next"
18+
</samlp:IDPList>
19+
<saml:Issuer>https://sp.example.org/entity</saml:Issuer>
20+
</ecp:Request>
21+
<ecp:RelayState ns0:actor="http://schemas.xmlsoap.org/soap/actor/next"
2222
ns0:mustUnderstand="1">ABCDEFGHI01234567
23-
</ns2:RelayState>
23+
</ecp:RelayState>
2424
</ns0:Header>
2525
<ns0:Body>
26-
<ns3:AuthnRequest/>
26+
<samlp:AuthnRequest/>
2727
</ns0:Body>
2828
</ns0:Envelope>

tests/enc_tmpl.xml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
<?xml version='1.0' encoding='UTF-8'?>
2-
<ns0:EncryptedData xmlns:ns0="http://www.w3.org/2001/04/xmlenc#"
3-
xmlns:ns1="http://www.w3.org/2000/09/xmldsig#" Id="ED"
2+
<xenc:EncryptedData xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"
3+
xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="ED"
44
Type="http://www.w3.org/2001/04/xmlenc#Element">
5-
<ns0:EncryptionMethod
5+
<xenc:EncryptionMethod
66
Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/>
7-
<ns1:KeyInfo>
8-
<ns0:EncryptedKey Id="EK">
9-
<ns0:EncryptionMethod
7+
<ds:KeyInfo>
8+
<xenc:EncryptedKey Id="EK">
9+
<xenc:EncryptionMethod
1010
Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5"/>
11-
<ns1:KeyInfo>
12-
<ns1:KeyName>my-rsa-key</ns1:KeyName>
13-
</ns1:KeyInfo>
14-
<ns0:CipherData>
15-
<ns0:CipherValue/>
16-
</ns0:CipherData>
17-
</ns0:EncryptedKey>
18-
</ns1:KeyInfo>
19-
<ns0:CipherData>
20-
<ns0:CipherValue/>
21-
</ns0:CipherData>
22-
</ns0:EncryptedData>
11+
<ds:KeyInfo>
12+
<ds:KeyName>my-rsa-key</ds:KeyName>
13+
</ds:KeyInfo>
14+
<xenc:CipherData>
15+
<xenc:CipherValue/>
16+
</xenc:CipherData>
17+
</xenc:EncryptedKey>
18+
</ds:KeyInfo>
19+
<xenc:CipherData>
20+
<xenc:CipherValue/>
21+
</xenc:CipherData>
22+
</xenc:EncryptedData>

0 commit comments

Comments
 (0)