[devel at bb.net] Custom authentication

Pierre Tardy tardyp at gmail.com
Thu Oct 5 08:02:56 UTC 2017


Hi Maciek,

For login/password auth, buildbot uses twisted authentication framework.
You should not derive AuthBase, but rather something like this:
class HTPasswdAuth(TwistedICredAuthBase):

def __init__(self, **kwargs):
TwistedICredAuthBase.__init__(
self,
[DigestCredentialFactory(b"md5", b"buildbot"),
BasicCredentialFactory(b"buildbot")],
[MyCredentialChecker()],
**kwargs)

and MyCredentialChecker should be a ICredentialsChecker like this reference
implementation:
https://github.com/twisted/twisted/blob/trunk/src/twisted/cred/checkers.py#L105

More info on twisted cred framework:
http://twistedmatrix.com/documents/current/core/howto/cred.html#the-credentialchecker


On Wed, Oct 4, 2017 at 11:46 AM Maciek Dems <macdems at gmail.com> wrote:

> Hello,
>
> I need to write a authentication module for Buildbot WWW using external
> database. I have no access to the plain-text passwords, however, I have got
> a callable:
>
> check_password(user, pass) -> bool
>
> that checks if the provided password is correct.
>
> The problem is, I don't know how to integrate it with the Buildbot auth
> infrastructure. I understand that I need to derive
> buildbot.www.auth.AuthBase
> and write custom getLoginResource method. However, this is the point where
> I'm
> stuck. I don't understand what this login resource actually is.
>
> Actually I think, it would be beneficial to provide an AuthBase subclass
> that
> gets a password-checking callable as an argument. I can do this and share
> the
> patch if someone explains me how.
>
> Thanks and regards,
> Maciek
>
> --
> Maciek Dems                             http://dems.art.pl/
> _______________________________________________
> devel mailing list
> devel at buildbot.net
> https://lists.buildbot.net/mailman/listinfo/devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.buildbot.net/pipermail/devel/attachments/20171005/e4ef63d6/attachment.html>


More information about the devel mailing list