benoit sigoure lwzbplrdeepitafr news mention change buildbotstatuswebauthenticationpy ldapauth new class docsbuildbottexinfo webstatus configuration parameters document new feature signedoffby benoit sigoure news 3 buildbotstatuswebauthenticationpy 100 docsbuildbottexinfo 9 3 files changed 110 insertions 2 deletions diff git anews bnews index 9ef04a4d687e2a 100644 anews bnews 117 118 user visible changes buildbot outline webstatus constructor take instance iauth statuswebauthentication class basicauth accepts userpass keyword argument pretty much way try_userpass class htpasswdauth authenticate users htpasswdstyle file htpasswdauth authenticate users htpasswdstyle file class ldapauth authenticate users ldap directory requires pythonldap users valid loginpassword forcestop builds webstatus diff git abuildbotstatuswebauthenticationpy bbuildbotstatuswebauthenticationpy index a7e8527f48fef7 100644 abuildbotstatuswebauthenticationpy bbuildbotstatuswebauthenticationpy 883 88103 class htpasswdauthauthbase else selferr invalid password return res class ldapauthauthbase implementsiauth implement synchronous authentication ldap directory basedn base dn distinguished name root ldap directory tree eg oupeopledcsubdomaindccompanydccom binddn bind dn user external ldap server permitted search ldap directory leave empty passwd password required query ldap server leave empty query server without password host hostname ldap server search template string use search user trying login ldap directory def __init__self host basedn binddn passwd searchuids authenticate users ldap server chost arguments documented selfhost host selfbasedn basedn selfbinddn binddn selfpasswd passwd selfsearch search selfsearch_conn none selfconnect def connectself setup connections ldap server import ldap close existing connections selfsearch_conn selfsearch_connunbind connection used locate users ldap db selfsearch_conn ldapopenselfhost selfsearch_connbind_sselfbinddn selfpasswd ldapauth_simple def authenticateself login password authenticate clogin cpassword ldap server pythonldap raises sorts exceptions express various failures lets catch assume anything goes wrong authentication failed try res self_authenticatelogin password res selferr return res except ldapldaperror e selferr ldap error stre return false except selferr unknown error return false def _authenticateself login password import ldap search login ldap db try result selfsearch_connsearch_sselfbasedn ldapscope_subtree selfsearch login objectclass 1 except ldapserver_down selferr ldap server seems try reconnect selfconnect fixme check cant lead infinite recursion return selfauthenticatelogin password make sure found single user ldap db result lenresult 1 selferr user found ldap db return false connection used authenticate users ldap db auth_conn ldapopenselfhost dn associated user ldap_dn result00 logmsgusing ldap_dn ldap_dn authenticate user try auth_connbind_sldap_dn password ldapauth_simple except ldapinvalid_credentials selferr invalid credentials return false auth_connunbind return true diff git adocsbuildbottexinfo bdocsbuildbottexinfo index 098ab63301941b 100644 adocsbuildbottexinfo bdocsbuildbottexinfo 60717 60719 current builds case pass instance class codebasicauth implements basic authentication mechanism using list loginpassword pairs provided configuration file class codehtpasswdauth implements authentication filehtpasswdstyle file filehtpasswdstyle file class codeldapauth authenticates users ldap database requires urefhttppythonldapsourceforgenet pythonldap example buildbotstatushtml import webstatus 60826 608411 cstatusappendwebstatushttp_port8080 authbasicauthusers buildbotstatuswebauthentication import htpasswdauth file pathtofile cstatusappendwebstatushttp_port8080 authhtpasswdauthfile buildbotstatuswebauthentication import ldapauth cstatusappendwebstatushttp_port8080 authldapauthldapservercompanycom oupeopledccompanydccom end example 1535756gc887a fri 08 aug 2008 131731 0100 buildbotdevel patch v2 1212 implement ldap based authentication webstatus