<div dir="ltr">Hi Sergio,<div><br></div><div>Your LdapAuth looks useful! would you like to contribute it? I think it hasn't been done yet because people are using oauth2 or the apache ldap plugin.</div><div>The implementation you shown uses ldap synchronous library. We try to avoid calling synchronous IO libraries from the main reactor thread. So we would have to modify your implementation lightly to call ldap from a thread with <a href="http://twistedmatrix.com/documents/current/api/twisted.internet.threads.deferToThread.html">http://twistedmatrix.com/documents/current/api/twisted.internet.threads.deferToThread.html</a></div><div><br></div><div><br></div><div>As per the try scheduler it will be a little bit more complicated to implement as the authentication for try scheduler is common with the authentication for worker due to implementation details with the perspective broker protocol.</div><div><br></div><div>Try scheduler is however mostly replaceable by the forcescheduler. Then you can run them from commandline using the REST api, and a more or less custom script. Did you consider this option?</div><div><br></div><div>Pierre</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Jan 5, 2018 at 9:46 AM Sergio Borghese <<a href="mailto:s.borghese@netresults.it">s.borghese@netresults.it</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-family:Courier New;font-size:12pt;color:#000000"><div>Hi All,</div><div><br></div><div>I was wondering if there is a way (a <em>workaround</em> really) to configure a try build scheduler using an external authentication class, similar to what you can do with the buildbot web view where you can configure an external authentication class that inherits from <strong>util.CustomAuth</strong></div><div>The current <strong>Try_UserPass</strong> method has the disadvantage or requesting to manage user's credentials in the buildbot configuration itself, that is a solution that does not scale very well.</div><div>On the other side: is there a reason (technical I mean) why the same CustomAuth mechanics has not been implemented in the try scheduler? Could it be possible to extend the try scheduler to support such type of authentication?</div><div><br></div><div>Just out of curiosity, here how I integrated the buildbot web view authentication with our Domain Server:</div><div><br></div><div> 95 import ldap<br> 96 class TestLdapAuth(util.CustomAuth):<br> 97   def check_credentials(self, user, password):<br> 98     conn = ldap.initialize('ldap://<my_domain_server_ip_address>')<br> 99     conn.protocol_version=3<br>100    conn.set_option(ldap.OPT_REFERRALS, 0)<br>101    try:<br>102      conn.simple_bind_s(user, password)<br>103      conn.unbind_s()<br>104      return True<br>105    except ldap.LDAPError:<br>106      print 'ldap bind failed'<br>107      return False<br>108 <br>109 # minimalistic config to activate new web UI<br>110 c['www'] = dict(port=8088,<br>111                 plugins=dict(waterfall_view={}, console_view={}, grid_view={}), <br>112                 auth=TestLdapAuth())<br>113 </div><div><br></div><div>now all the developers (that have their user/passwd recorded on the company domain server) can authenticate to the buildbot nine webpage without the need for a separate set of credentials.</div><div><br></div><div>Best Regards</div><div>Sergio</div><div><br></div><div>-- <br>Sergio Borghese<br>Senior Software Engineer<br>NetResults S.r.l. <br>Via Agostino Bassi 5, 56121 Ospedaletto (Pi), Italy<br>Tel.: <a href="tel:+39%20050%20316%203658" value="+390503163658" target="_blank">+39.050.316.3658</a><br>web: <a href="http://www.netresults.it" target="_blank">www.netresults.it</a></div></div></div>_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@buildbot.net" target="_blank">devel@buildbot.net</a><br>
<a href="https://lists.buildbot.net/mailman/listinfo/devel" rel="noreferrer" target="_blank">https://lists.buildbot.net/mailman/listinfo/devel</a></blockquote></div>