commit 96c7bd02c0ecb5c168a4c05229e157a384344e2c
parent 192d5e0f0c9861ee0ab0446e5dc2f24269bb592d
Author: Marcello Stanisci <stanisci.m@gmail.com>
Date: Fri, 30 Nov 2018 23:08:29 +0100
BB auth.
Adding simple mechanism to check user+pass
against logging-in users.
Diffstat:
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/buildbot/master.cfg b/buildbot/master.cfg
@@ -454,13 +454,32 @@ c["titleURL"] = "https://taler.net"
# We use nginx to expose the BB under this URL.
c["buildbotURL"] = "https://buildbot.taler.net/"
+PASSWORD_FILE_JSON = "/home/containers/buildbot/credentials.json"
+
+class FileAuth(util.CustomAuth):
+
+ def check_credentials(self, user, password):
+ data = open(PASSWORD_FILE_JSON)
+ d = json.load(data)
+ # if user+password matches, then True, else False.
+ pass = d.get(user)
+ if not pass:
+ print("User %s not found" % user)
+ return False
+ # User exists, check password now.
+ if not pass == password:
+ print("Wrong password given")
+ return False
+ return True
+
# minimalistic config to activate new web UI
c["www"] = {
"port": 8010,
"plugins" : {
"waterfall_view": {},
"console_view":{}},
- "allowed_origins": ["https://*.taler.net"]}
+ "allowed_origins": ["https://*.taler.net"],
+ "auth": FileAuth()}
####### DB URL