Skip to content

Commit f965e5b

Browse files
committed
Fix minor bug with AttributeConsumingService. Update Travis config to test python 2.7.6 and 2.7.12
1 parent 6415eca commit f965e5b

3 files changed

Lines changed: 8 additions & 6 deletions

File tree

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
language: python
22
python:
3-
- '2.7'
3+
- '2.7.6'
4+
- '2.7.12'
45

56
install:
67
- sudo apt-get update -qq

src/onelogin/saml2/metadata.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,13 @@ def builder(sp, authnsign=False, wsign=False, valid_until=None, cache_duration=N
9696
req_attr_isrequired_str = " isRequired=\"%s\"" % req_attribs['isRequired']
9797

9898
if 'attributeValue' in req_attribs.keys() and req_attribs['attributeValue']:
99-
req_attr_aux_str = ""
10099
if isinstance(req_attribs['attributeValue'], basestring):
101100
req_attribs['attributeValue'] = [req_attribs['attributeValue']]
101+
102+
req_attr_aux_str = ">"
102103
for attrValue in req_attribs['attributeValue']:
103104
req_attr_aux_str += """
104-
<saml:AttributeValue xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion>%(attributeValue)s</saml:AttributeValue>""" % \
105+
<saml:AttributeValue xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">%(attributeValue)s</saml:AttributeValue>""" % \
105106
{
106107
'attributeValue': attrValue
107108
}

tests/src/OneLogin/saml2_tests/metadata_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,9 @@ def testBuilderAttributeConsumingServiceWithMultipleAttributeValue(self):
180180
self.assertIn(""" <md:AttributeConsumingService index="1">
181181
<md:ServiceName xml:lang="en">Test Service</md:ServiceName>
182182
<md:ServiceDescription xml:lang="en">Test Service</md:ServiceDescription>
183-
<md:RequestedAttribute Name="userType" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"
184-
<saml:AttributeValue xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion>userType</saml:AttributeValue>
185-
<saml:AttributeValue xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion>admin</saml:AttributeValue>
183+
<md:RequestedAttribute Name="userType" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
184+
<saml:AttributeValue xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">userType</saml:AttributeValue>
185+
<saml:AttributeValue xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">admin</saml:AttributeValue>
186186
</md:RequestedAttribute>
187187
<md:RequestedAttribute Name="urn:oid:0.9.2342.19200300.100.1.1" FriendlyName="uid" />
188188
</md:AttributeConsumingService>""", metadata)

0 commit comments

Comments
 (0)