[users at bb.net] Fwd: Authorising users
honas grael
honasgraeymael at gmail.com
Thu Apr 7 20:35:44 UTC 2016
Hi just a follow up on my original question. I realised that I was looking
at the wrong documentation, the example I had copied was for a pre 0.9
version of Buildbot. The latest documentation
<http://docs.buildbot.net/latest/manual/cfg-www.html> put me on the right
path.
This worked for authentication(the most basic authentication) but I could
not get authorisation to work
Essentially I want to prevent non super-engineering users from being able
to force or stop a build.
RoleMatchers isn't working for me I keep getting the following errors
Well almost consider
from buildbot.plugins import *authz = util.Authz(
allowRules=[
util.StopBuildEndpointMatcher(role="admins"),
util.ForceBuildEndpointMatcher(role="admins"),
util.RebuildBuildEndpointMatcher(role="admins")
],
roleMatchers=[
util.RolesFromEmails(admins=["homer"])
])
When I had this in my master.cfg I got the error
unknown paramter :RolesFromEmails
I tried all the other roles, e.g RolesFromOwners but got similar errors
eventually I commented out the rolematchers lines
from buildbot.plugins import *authz = util.Authz(
allowRules=[
util.StopBuildEndpointMatcher(role="admins"),
util.ForceBuildEndpointMatcher(role="admins"),
util.RebuildBuildEndpointMatcher(role="admins")
], #roleMatchers=[
#util.RolesFromEmails(admins=["homer"])
])
But then when I tried to start the buildmaster. I got another error
self.authz.setMaster(self.master)
exceptions.attributeError: 'list' object has no attribute 'setmaster'
Essentially what is the right way to restrict users, from doing naughty
things
---------- Forwarded message ----------
From: honas grael <honasgraeymael at gmail.com>
Date: Wed, Apr 6, 2016 at 7:19 PM
Subject: Authorising users
To: users at buildbot.net
Hi guys, I'm trying to get authentication & authorization working,
nothing fancy just the basic stuff, so looking at
the online example I found:
c['status'] = []*
from buildbot.status import html
from buildbot.status.web import authz, auth*
authz_cfg=authz.Authz(
# change any of these to True to enable; see the manual for more
# options
auth=auth.BasicAuth([("pyflakes","pyflakes")]),
gracefulShutdown = False,
forceBuild = 'auth', # use this to test your worker once it is set up
forceAllBuilds = False,
pingBuilder = False,
stopBuild = False,
stopAllBuilds = False,
cancelPendingBuild =
False,)c['status'].append(html.WebStatus(http_port=8010,
authz=authz_cfg))
Now when I try this in my master.cfg I get python warnings along the lines of
could not find module web,
could not find module html
I am using buildbot 0.9.06b, So far I've managed to get it running
doing some basic builds and tests, so I am not sure why it
can't find these modules.
Any suggestions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.buildbot.net/pipermail/users/attachments/20160407/ac2d5574/attachment.html>
More information about the users
mailing list