Fix handling attributes with multiple values (e.g. groups)
When handling attributes with more than one value provide a single saml:Attribute with multiple saml:AttributeValue's.
I.e.
group1 group2
Not:
This fixes handling of attributes with more than one value for pac4j based clients (Such as the Jenkins SAML plugin).
Why use the temporary variable val and not just append directly? Otherwise looks ok to me.
I tried to get it to append directly but something in the saml attribute class caused the list to be immutable when trying to append to it and I had to convert it back and forwards to a mutable type or use a temp var and the temp car seemed cleaner.
On Wednesday, April 20, 2016, pagure@pagure.io wrote:
rcritten commented on the pull-request: Fix handling attributes with multiple values (e.g. groups) that you are following: Why use the temporary variable val and not just append directly? Otherwise looks ok to me. To reply, visit the link belowor just reply to this email https://pagure.io/ipsilon/pull-request/86
rcritten commented on the pull-request: Fix handling attributes with multiple values (e.g. groups) that you are following: Why use the temporary variable val and not just append directly? Otherwise looks ok to me.
To reply, visit the link belowor just reply to this email https://pagure.io/ipsilon/pull-request/86
The ldap test is failing:
ERROR: ValueError('Expected [Test Group;Test Group 2], got [Test Group;Test Group 2;Test Group;Test Group 2]',)
You just need to move one line to make it work: please move ipsilon/providers/saml2/auth.py line 334 to line 338. That will make the adding of the attributes happen after building the full attribute object. If you could amend your commit and push the new one to your branch, I can apply your patch.
Also, it would be much appreciated if you add a Signed-off-by line to acknowledge you accept to publishing your patch under the license of Ipsilon (GPLv3).
This has now been merged. Thanks!
Pull-Request has been closed by puiterwijk