lightSAML / SpBundle

SAML2 SP Symfony Bundle based on LightSAML
https://www.lightsaml.com/SP-Bundle/
MIT License
66 stars 70 forks source link

Added a SimpleAttributeMapper #36

Closed denniscoorn closed 7 years ago

denniscoorn commented 7 years ago

I've created a SimpleAttributeMapper that maps all Attribute values from all AttributeStatement objects within all Assertion objects to a single array of attributes.

A new service lightsaml_sp.attribute_mapper.simple is defined and will be set as default value for the 'attribute_mapper' at the security configuration.

I've also added a SimpleAttributeMapperTest to guarantee the expected behavior of the mapper. This test also clearly demonstrate how the mapper handles/merges values when the name of an attribute already exists in the constructed attribute map.

Would like to know what you think of it!

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.08%) to 99.034% when pulling 0583369f188320a6e2ea3b9a40125fe78cc280d3 on denniscoorn:feature/simple-attribute-mapper into 4a62c9d939de20d998fcebcda24da239ffa8f1f1 on lightSAML:master.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.08%) to 99.034% when pulling ce1a4cf77bb5cb52684cd369cc4d4dbc5c4cd061 on denniscoorn:feature/simple-attribute-mapper into 4a62c9d939de20d998fcebcda24da239ffa8f1f1 on lightSAML:master.

tmilos commented 7 years ago

Guess having them all rather then none would be ok for most users as default behavior. Only problem I could see with some huge attribute values, but in that case users would have to make their own attribute mapper, or we eventually extend this simple one with exclude list. Thanks