Add city to info plugin, fetch correct attrs in SSSD
authorRob Crittenden <rcritten@redhat.com>
Mon, 31 Aug 2015 17:27:58 +0000 (13:27 -0400)
committerPatrick Uiterwijk <puiterwijk@redhat.com>
Mon, 31 Aug 2015 17:54:01 +0000 (19:54 +0200)
Add missing variable in the info plugins common list
for city.

Fix the mapping in the infosssd plugin where locality
was being passed in as state. It is now set as city
and st as state.

Care needs to be taken with LDAP attributes as Ipsilon
doesn't currently handle attribute aliases.

https://fedorahosted.org/ipsilon/ticket/161

Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
ipsilon/info/common.py
ipsilon/info/infosssd.py

index 4cd6663..6d2ea80 100644 (file)
@@ -30,6 +30,7 @@ class InfoMapping(Log):
             'gender': 'Gender',
             'postcode': 'Postal Code',
             'street': 'Street Address',
             'gender': 'Gender',
             'postcode': 'Postal Code',
             'street': 'Street Address',
+            'city': 'City',
             'state': 'State or Province',
             'country': 'Country',
             'phone': 'Telephone Number',
             'state': 'State or Province',
             'country': 'Country',
             'phone': 'Telephone Number',
index cb097ad..6b75965 100644 (file)
@@ -21,6 +21,7 @@ SSSD_CONF = '/etc/sssd/sssd.conf'
 SSSD_ATTRS = ['mail',
               'street',
               'locality',
 SSSD_ATTRS = ['mail',
               'street',
               'locality',
+              'st',
               'postalCode',
               'telephoneNumber',
               'givenname',
               'postalCode',
               'telephoneNumber',
               'givenname',
@@ -35,6 +36,7 @@ sssd_mapping = [
     ['REMOTE_USER_LASTNAME', 'surname'],
     ['REMOTE_USER_STREET', 'street'],
     ['REMOTE_USER_STATE', 'state'],
     ['REMOTE_USER_LASTNAME', 'surname'],
     ['REMOTE_USER_STREET', 'street'],
     ['REMOTE_USER_STATE', 'state'],
+    ['REMOTE_USER_CITY', 'city'],
     ['REMOTE_USER_POSTALCODE', 'postcode'],
     ['REMOTE_USER_TELEPHONENUMBER', 'phone'],
 ]
     ['REMOTE_USER_POSTALCODE', 'postcode'],
     ['REMOTE_USER_TELEPHONENUMBER', 'phone'],
 ]
@@ -104,7 +106,8 @@ LoadModule lookup_identity_module modules/mod_lookup_identity.so
 
 <Location /${instance}>
   LookupUserAttr sn REMOTE_USER_LASTNAME
 
 <Location /${instance}>
   LookupUserAttr sn REMOTE_USER_LASTNAME
-  LookupUserAttr locality REMOTE_USER_STATE
+  LookupUserAttr st REMOTE_USER_STATE
+  LookupUserAttr locality REMOTE_USER_CITY
   LookupUserAttr street REMOTE_USER_STREET
   LookupUserAttr telephoneNumber REMOTE_USER_TELEPHONENUMBER
   LookupUserAttr givenname REMOTE_USER_FIRSTNAME
   LookupUserAttr street REMOTE_USER_STREET
   LookupUserAttr telephoneNumber REMOTE_USER_TELEPHONENUMBER
   LookupUserAttr givenname REMOTE_USER_FIRSTNAME