Comment 4 for bug 363180

Revision history for this message
Damien Baty (damien-baty) wrote :

I have the same concerns as the original poster. I ended up with the attached patch, defining the attributes that may be flattened (i.e. converted from a one-value list to a string) in a "who.ini". I think this may be a safer way, rather than doing it for any attribute (especially considering that already deployed applications may expect the current behaviour). With the attached patch, the current behaviour is not changed, unless the application is configured otherwise.

For example, in a who.ini, I have this::

  [plugin:ldap_attributes]
  use = repoze.who.plugins.ldap:LDAPAttributesPlugin
  ldap_connection = ldap://localhost
  attributes = cn,uid
  flatten_attributes = cn,uid

... because I happen to know that all users have only one common name and UID.

If this idea is accepted, I'll write tests for it, too.