simplesamlphp / simplesamlphp-module-ldap

Module that provides authentication against LDAP stores
GNU Lesser General Public License v2.1
4 stars 8 forks source link

fix warning when an attribute is empty #13

Closed ghost closed 4 years ago

codecov[bot] commented 4 years ago

Codecov Report

Merging #13 into master will not change coverage. The diff coverage is 0%.

@@           Coverage Diff            @@
##             master     #13   +/-   ##
========================================
  Coverage      1.37%   1.37%           
- Complexity      242     244    +2     
========================================
  Files             8       8           
  Lines           798     798           
========================================
  Hits             11      11           
  Misses          787     787
tvdijen commented 4 years ago

I'm just wondering... In what situation would you get no value? I can imagine an unset attribute, but I would expect [NULL] to be returned in that case.. Not [ ]

ghost commented 4 years ago

I'm just wondering... In what situation would you get no value? I can imagine an unset attribute, but I would expect [NULL] to be returned in that case.. Not [ ]

For empty lists like eduPersonEntitlement I am setting value to [] (which results in an empty <saml:Attribute> in the SAML assertion), because some SPs are checking that they are receiving all attributes. With null I get the same result (empty <saml:Attribute>), but an empty array seems more appropriate and probably breaks fewer auth proc filters. But I can add a check for null.