benoit sigoure lwzbplrdeepitafr possible instantiate webstatus list loginpassword users valid loginpassword forcestop builds news mention new feature buildbotstatuswebauthenticationpy new file iauth new interface authbase new base class basicauth implement iauth buildbotstatuswebbasepy make_name_login_password_form new helper factor common code make_stop_form make_force_build_form use accept 2nd mandatory boolean argument htmlresourceisusingloginpassword htmlresourceauthuser new dispatch methods buildbotstatuswebbasewebpy onelineperbuildbody oneboxperbuilderbody adjust webstatus__init__ accept new auth keyword argument webstatusisusingloginpassword webstatusauthuser new buildbotstatuswebbuildpy statusresourcebuildbody adjust statusresourcebuildstop check credentials user needed buildbotstatuswebbuilderpy statusresourcebuilderbody statusresourcebuilderforce likewise docsbuildbottexinfo webstatus configuration parameters document new userpass argument webstatus signedoffby benoit sigoure news 8 buildbotstatuswebauthenticationpy 51 buildbotstatuswebbasepy 57 buildbotstatuswebbasewebpy 53 buildbotstatuswebbuildpy 7 buildbotstatuswebbuilderpy 20 docsbuildbottexinfo 16 7 files changed 184 insertions 28 deletions create mode 100644 buildbotstatuswebauthenticationpy diff git anews bnews index fcbe5024f3b499 100644 anews bnews 66 614 user visible changes buildbot outline builder names must start underscore _ password protected webstatus webstatus constructor take instance iauth statuswebauthentication class basicauth accepts userpass keyword argument pretty much way try_userpass users valid loginpassword forcestop builds webstatus release 076 30 sep 2007 things need know diff git abuildbotstatuswebauthenticationpy bbuildbotstatuswebauthenticationpy new file mode 100644 index 0000000f6e1b75 devnull bbuildbotstatuswebauthenticationpy 00 151 zopeinterface import interface implements class iauthinterface represent authentication method def authenticateself login password check whether clogin cpassword valid def errmsgself get last error message reason authentication failed class authbase base class authentication methods err last error def errmsgself get last error message reason authentication failed return selferr class basicauthauthbase implementsiauth implement basic authentication mechanism list userpassword userpass list couples user password def __init__self userpass cuserpass list user password user_pass_pair userpass assert isinstanceuser_pass_pair tuple login password user_pass_pair assert isinstancelogin str assert isinstancepassword str selfuserpass userpass def authenticateself login password check clogincpassword valid userpassword pair selfuserpass selferr invalid value selfuserpass return false l p selfuserpass login l password p selferr return true selferr invalid login password return false diff git abuildbotstatuswebbasepy bbuildbotstatuswebbasepy index 565a1354577767 100644 abuildbotstatuswebbasepy bbuildbotstatuswebbasepy 5330 5350 def make_rowlabel field label htmlescapelabel return row_template label label field field def make_stop_formstopurl data def make_name_login_password_formuseloginpassword helper function produces either one row form name text input cuseloginpassword cfalse two rows login password text input useloginpassword user_label login else user_label name data make_rowuser_label useloginpassword data make_rowyour password return data def make_stop_formstopurl useloginpassword create form whose submit button sends request cstopurl cuseloginpassword true form password field data stop build fill following fields click stop buttonn stopurl data make_rowyour name click stop buttonn stopurl data make_name_login_password_formuseloginpassword data make_rowreason stopping build data n return data def make_force_build_formforceurl def make_force_build_formforceurl useloginpassword create form whose submit button sends request cforceurl cuseloginpassword true form password field data force build fill following fields click force build button forceurl click force build button forceurl return data make_rowyour name make_name_login_password_formuseloginpassword make_rowreason build make_rowbranch build make_rowrevision build n colormap 2449 26420 class htmlresourceresourceresource def getstatusself request return requestsitebuildbot_servicegetstatus def getcontrolself request return requestsitebuildbot_servicegetcontrol def isusingloginpasswordself request return requestsitebuildbot_serviceisusingloginpassword def authuserself request login requestargsgetusername 0 password requestargsgetpasswd 0 login password return false return requestsitebuildbot_serviceauthuserlogin password def getchangemasterself request return requestsitebuildbot_serviceparentchange_svc diff git abuildbotstatuswebbasewebpy bbuildbotstatuswebbasewebpy index 1c5453aecfdda6 100644 abuildbotstatuswebbasewebpy bbuildbotstatuswebbasewebpy 196 197 buildbotstatuswebbuilder import buildersresource buildbotstatuswebslaves import buildslavesresource buildbotstatuswebxmlrpc import xmlrpcserver buildbotstatuswebabout import aboutbuildbot buildbotstatuswebauthentication import iauth class contains status services webstatus older waterfall put cstatus also contains resources 12310 12411 class onelineperbuildhtmlresource onelinemixin building stopurl builders_allstop data make_stop_formstopurl data make_stop_formstopurl selfisusingloginpasswordreq online forceurl builders_allforce data make_force_build_formforceurl data make_force_build_formforceurl selfisusingloginpasswordreq return data 23210 23411 class oneboxperbuilderhtmlresource building stopurl builders_allstop data make_stop_formstopurl data make_stop_formstopurl selfisusingloginpasswordreq online forceurl builders_allforce data make_force_build_formforceurl data make_force_build_formforceurl selfisusingloginpasswordreq return data 3507 3538 class webstatusservicemultiservice wed recursive traversal children discover changes def __init__self http_portnone distrib_portnone allowforcefalse def __init__self http_portnone distrib_portnone allowforcefalse authnone run web server provides buildbot status type http_port int ltwistedapplicationstrports string 3856 38912 class webstatusservicemultiservice strports parser param allowforce boolean true webserver allow visitors trigger cancel builds type auth lstatuswebauthenticationiauth cnone param auth object performs authentication restrain access callowforce features ignored callowforce true cauth cnone legacy behavior used people forcestop builds without auth servicemultiservice__init__self 3986 40814 class webstatusservicemultiservice distrib_port unixs distrib_port selfdistrib_port distrib_port selfallowforce allowforce allowforce auth assert iauthprovidedbyauth selfauth auth else auth logmsgwarning discarding authentication method must also set allowforce true use one selfauth none replaced weve attached parent thus basedir reference basedirpublic_html 4757 4937 class webstatusservicemultiservice selfsiteresource root def putchildself name child_resource behaves lot like rootputchild behaves lot like rootputchild selfchildrentobeaddedname child_resource def registerchannelself channel 49311 51134 class webstatusservicemultiservice def getstatusself return selfparentgetstatus def getcontrolself selfallowforce return icontrolselfparent return none def isusingloginpasswordself return boolean indicate whether webstatus uses list loginpasswords privileged actions selfauth return true return false def authuserself login password check loginpassword valid userpassword pair allowed perform privileged action webstatus password protected function returns false conservative approach mess function critical security webstatus selfisusingloginpassword return false selfauthauthenticatelogin password return true logmsgauthentication failed login selfautherrmsg return false def getportnumself benefit unit tests listself0 diff git abuildbotstatuswebbuildpy bbuildbotstatuswebbuildpy index 52b41abb2eed77 100644 abuildbotstatuswebbuildpy bbuildbotstatuswebbuildpy 487 487 class statusresourcebuildhtmlresource selfbuild_control none stopurl urllibquotereqchildlinkstop data make_stop_formstopurl data make_stop_formstopurl selfisusingloginpasswordreq bisfinished results bgetresults 1666 16611 class statusresourcebuildhtmlresource return data def stopself req selfisusingloginpasswordreq selfauthuserreq todo tell web user request denied return redirect b selfbuild_status c selfbuild_control logmsgweb stopbuild build ss diff git abuildbotstatuswebbuilderpy bbuildbotstatuswebbuilderpy index 4ea47cfe028c9d 100644 abuildbotstatuswebbuilderpy bbuildbotstatuswebbuilderpy 1037 1038 class statusresourcebuilderhtmlresource onelinemixin control none connected_slaves forceurl urllibquotereqchildlinkforce data make_force_build_formforceurl data make_force_build_formforceurl selfisusingloginpasswordreq elif control none data buildslaves appear offline possible 13113 13219 class statusresourcebuilderhtmlresource onelinemixin r webpage force build button pressed sn name reason logmsgweb forcebuild builder branchs revisions selfbuilder_statusgetname branch revision user selfbuilder_statusgetname branch revision name selfbuilder_control todo tell web user request denied logmsgbut builder control disabled return redirect selfisusingloginpasswordreq selfauthuserreq todo tell web user request denied return redirect keep weird stuff branch revision strings todo centralize somewhere rematchrw branch 1519 15812 class statusresourcebuilderhtmlresource onelinemixin revision revision none todo authenticate particular user clicked button use name instead none theyll informed results todo authenticate particular user clicked button could use name instead none theyll informed results problem must create buildbotchangeschangeschange instance doesnt really fit use case requires list changed files tedious compute stage sourcestampbranchbranch revisionrevision req buildrequestr selfbuilder_statusgetname try diff git adocsbuildbottexinfo bdocsbuildbottexinfo index c2779b58d8e0ef 100644 adocsbuildbottexinfo bdocsbuildbottexinfo 606310 606320 true web page provide force build button allows visitors manually trigger builds useful developers rerun builds failed intermittent problems test suite libraries installed time previous build may wish allow strangers cause build run case set false remove buttons default value false installed time previous build default value false may wish allow strangers cause build run stop current builds case pass instance codestatuswebauthenticationiauth codeauth keyword argument class codebasicauth implements basic authentication mechanism using list loginpassword pairs provided configuration file example buildbotstatushtml import webstatus buildbotstatuswebauthentication import basicauth users login password bob secretpass cstatusappendwebstatushttp_port8080 authbasicauthusers end example node buildbot web resources xmlrpc server webstatus configuration parameters webstatus 1535756gc887a fri 08 aug 2008 131604 0100 buildbotdevel patch v2 0912 add possibility passwordprotect forms webstatus