You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/04/22 23:57:00 UTC

[GitHub] [airflow] tooptoop4 commented on issue #8179: Airflow LDAP authentication with RBAC features

tooptoop4 commented on issue #8179:
URL: https://github.com/apache/airflow/issues/8179#issuecomment-618098691


   @xpyct600 thanks for this, i got it to work.
   but had to fix to 2 lines:
   user_list = [sam_account_name.get(appbuilder.sm.auth_ldap_uid_field)[0].decode('utf-8') for sam_account_name in [user[1] for user in users if user[0]]]
   group_list = [cn.get(ldap_sync_config['group_name_attr'])[0].decode('utf-8') for cn in [group[1] for group in groups if group[0]]]
   
   otherwise it complained about :
   
     File "ldap_sync.py", line 65, in <listcomp>
       user_list = [sam_account_name.get(appbuilder.sm.auth_ldap_uid_field)[0].decode('utf-8') for sam_account_name in [user[1] for user in users]]
   AttributeError: 'list' object has no attribute 'get'
   
   users had diff entries like:
   ('CN=uuu,OU=l,OU=r-n,DC=b,DC=c,DC=d,DC=com', {'sAMAccountName': [b'uuu']})
   (None, ['ldaps://xx/DC=a,DC=b,DC=c,DC=d,DC=com'])


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org