From owner-svn-ports-all@freebsd.org Tue Mar 28 22:41:04 2017 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4712D23BCE; Tue, 28 Mar 2017 22:41:04 +0000 (UTC) (envelope-from grembo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ACE37E5D; Tue, 28 Mar 2017 22:41:04 +0000 (UTC) (envelope-from grembo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2SMf3DN024675; Tue, 28 Mar 2017 22:41:03 GMT (envelope-from grembo@FreeBSD.org) Received: (from grembo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2SMf2Qv024660; Tue, 28 Mar 2017 22:41:02 GMT (envelope-from grembo@FreeBSD.org) Message-Id: <201703282241.v2SMf2Qv024660@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grembo set sender to grembo@FreeBSD.org using -f From: Michael Gmelin Date: Tue, 28 Mar 2017 22:41:02 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r437171 - in head/devel: buildbot buildbot-console-view buildbot-pkg buildbot-waterfall-view buildbot-worker buildbot-www buildbot/files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 22:41:05 -0000 Author: grembo Date: Tue Mar 28 22:41:02 2017 New Revision: 437171 URL: https://svnweb.freebsd.org/changeset/ports/437171 Log: Update devel/buildbot* to 0.9.5 This includes missing files and fixes that are pending upstream. Also change to using PORTVERSION in dependencies, as all parts of buildbot need to be the same version anyway. Reported by: rodrigc Differential Revision: https://reviews.freebsd.org/D10162 Added: head/devel/buildbot/files/patch-buildbot-secrets (contents, props changed) head/devel/buildbot/files/patch-setup.py (contents, props changed) Modified: head/devel/buildbot-console-view/Makefile head/devel/buildbot-console-view/distinfo head/devel/buildbot-pkg/Makefile head/devel/buildbot-pkg/distinfo head/devel/buildbot-waterfall-view/Makefile head/devel/buildbot-waterfall-view/distinfo head/devel/buildbot-worker/Makefile head/devel/buildbot-worker/distinfo head/devel/buildbot-www/Makefile head/devel/buildbot-www/distinfo head/devel/buildbot/Makefile head/devel/buildbot/distinfo Modified: head/devel/buildbot-console-view/Makefile ============================================================================== --- head/devel/buildbot-console-view/Makefile Tue Mar 28 22:20:29 2017 (r437170) +++ head/devel/buildbot-console-view/Makefile Tue Mar 28 22:41:02 2017 (r437171) @@ -2,7 +2,7 @@ # $FreeBSD$ PORTNAME= buildbot-console-view -PORTVERSION= 0.9.4 +PORTVERSION= 0.9.5 CATEGORIES= devel python MASTER_SITES= CHEESESHOP @@ -11,11 +11,11 @@ COMMENT= Continuous Integration Framewor LICENSE= GPLv2 -MY_DEPENDS= buildbot-pkg>=0.9.4:devel/buildbot-pkg +MY_DEPENDS= buildbot-pkg>=${PORTVERSION}:devel/buildbot-pkg BUILD_DEPENDS= ${MY_DEPENDS} RUN_DEPENDS= ${MY_DEPENDS} TEST_DEPENDS= trial:devel/py-twisted \ - buildbot-worker>=0.9.4:devel/buildbot-worker \ + buildbot-worker>=${PORTVERSION}:devel/buildbot-worker \ ${PYTHON_PKGNAMEPREFIX}mock>0.8.0:devel/py-mock \ ${PYTHON_PKGNAMEPREFIX}boto3>0:www/py-boto3 \ ${PYTHON_PKGNAMEPREFIX}service_identity>=16.0.0:security/py-service_identity \ Modified: head/devel/buildbot-console-view/distinfo ============================================================================== --- head/devel/buildbot-console-view/distinfo Tue Mar 28 22:20:29 2017 (r437170) +++ head/devel/buildbot-console-view/distinfo Tue Mar 28 22:41:02 2017 (r437171) @@ -1,3 +1,3 @@ -TIMESTAMP = 1488906561 -SHA256 (buildbot-console-view-0.9.4.tar.gz) = 16d1ab8801439d50d712883ab155530840588d4d77ab600299ead0ef23da5bf0 -SIZE (buildbot-console-view-0.9.4.tar.gz) = 631510 +TIMESTAMP = 1490709809 +SHA256 (buildbot-console-view-0.9.5.tar.gz) = 0b0ecc2dda50975837d0c55f6154f5829fb69618aa87b5e1994fb75212dfd5e8 +SIZE (buildbot-console-view-0.9.5.tar.gz) = 631548 Modified: head/devel/buildbot-pkg/Makefile ============================================================================== --- head/devel/buildbot-pkg/Makefile Tue Mar 28 22:20:29 2017 (r437170) +++ head/devel/buildbot-pkg/Makefile Tue Mar 28 22:41:02 2017 (r437171) @@ -2,7 +2,7 @@ # $FreeBSD$ PORTNAME= buildbot-pkg -PORTVERSION= 0.9.4 +PORTVERSION= 0.9.5 CATEGORIES= devel python MASTER_SITES= CHEESESHOP @@ -11,11 +11,11 @@ COMMENT= Continuous Integration Framewor LICENSE= GPLv2 -MY_DEPENDS= buildbot>=0.9.4:devel/buildbot +MY_DEPENDS= buildbot>=${PORTVERSION}:devel/buildbot BUILD_DEPENDS= ${MY_DEPENDS} RUN_DEPENDS= ${MY_DEPENDS} TEST_DEPENDS= trial:devel/py-twisted \ - buildbot-worker>=0.9.4:devel/buildbot-worker \ + buildbot-worker>=${PORTVERSION}:devel/buildbot-worker \ ${PYTHON_PKGNAMEPREFIX}mock>0.8.0:devel/py-mock \ ${PYTHON_PKGNAMEPREFIX}boto3>0:www/py-boto3 \ ${PYTHON_PKGNAMEPREFIX}service_identity>=16.0.0:security/py-service_identity \ Modified: head/devel/buildbot-pkg/distinfo ============================================================================== --- head/devel/buildbot-pkg/distinfo Tue Mar 28 22:20:29 2017 (r437170) +++ head/devel/buildbot-pkg/distinfo Tue Mar 28 22:41:02 2017 (r437171) @@ -1,3 +1,3 @@ -TIMESTAMP = 1488904370 -SHA256 (buildbot-pkg-0.9.4.tar.gz) = 968f252f0700fbbcc6cac9f3fcf66d06bd577db5bf793fb3d7c84158f4f64325 -SIZE (buildbot-pkg-0.9.4.tar.gz) = 3830 +TIMESTAMP = 1490709810 +SHA256 (buildbot-pkg-0.9.5.tar.gz) = 21566eff98d76792c39e237ea437fd8ba9abdb6e05e95aeb3de91b460127f1f6 +SIZE (buildbot-pkg-0.9.5.tar.gz) = 3867 Modified: head/devel/buildbot-waterfall-view/Makefile ============================================================================== --- head/devel/buildbot-waterfall-view/Makefile Tue Mar 28 22:20:29 2017 (r437170) +++ head/devel/buildbot-waterfall-view/Makefile Tue Mar 28 22:41:02 2017 (r437171) @@ -2,7 +2,7 @@ # $FreeBSD$ PORTNAME= buildbot-waterfall-view -PORTVERSION= 0.9.4 +PORTVERSION= 0.9.5 CATEGORIES= devel python MASTER_SITES= CHEESESHOP @@ -11,11 +11,11 @@ COMMENT= Continuous Integration Framewor LICENSE= GPLv2 -MY_DEPENDS= buildbot-pkg>=0.9.4:devel/buildbot-pkg +MY_DEPENDS= buildbot-pkg>=${PORTVERSION}:devel/buildbot-pkg BUILD_DEPENDS= ${MY_DEPENDS} RUN_DEPENDS= ${MY_DEPENDS} TEST_DEPENDS= trial:devel/py-twisted \ - buildbot-worker>=0.9.4:devel/buildbot-worker \ + buildbot-worker>=${PORTVERSION}:devel/buildbot-worker \ ${PYTHON_PKGNAMEPREFIX}mock>0.8.0:devel/py-mock \ ${PYTHON_PKGNAMEPREFIX}boto3>0:www/py-boto3 \ ${PYTHON_PKGNAMEPREFIX}service_identity>=16.0.0:security/py-service_identity \ Modified: head/devel/buildbot-waterfall-view/distinfo ============================================================================== --- head/devel/buildbot-waterfall-view/distinfo Tue Mar 28 22:20:29 2017 (r437170) +++ head/devel/buildbot-waterfall-view/distinfo Tue Mar 28 22:41:02 2017 (r437171) @@ -1,3 +1,3 @@ -TIMESTAMP = 1488906879 -SHA256 (buildbot-waterfall-view-0.9.4.tar.gz) = 4e8e8d85a77a95fb6ec6e9b0eaa4a774f80cbc6f3a6568f8525d4c90f336b69f -SIZE (buildbot-waterfall-view-0.9.4.tar.gz) = 705483 +TIMESTAMP = 1490709811 +SHA256 (buildbot-waterfall-view-0.9.5.tar.gz) = f398fceed508b885f5260bfe3d0e28da327c3d25103874fe0a971f949a21c884 +SIZE (buildbot-waterfall-view-0.9.5.tar.gz) = 705508 Modified: head/devel/buildbot-worker/Makefile ============================================================================== --- head/devel/buildbot-worker/Makefile Tue Mar 28 22:20:29 2017 (r437170) +++ head/devel/buildbot-worker/Makefile Tue Mar 28 22:41:02 2017 (r437171) @@ -2,8 +2,7 @@ # $FreeBSD$ PORTNAME= buildbot-worker -PORTVERSION= 0.9.4 -PORTREVISION= 3 +PORTVERSION= 0.9.5 CATEGORIES= devel python MASTER_SITES= CHEESESHOP Modified: head/devel/buildbot-worker/distinfo ============================================================================== --- head/devel/buildbot-worker/distinfo Tue Mar 28 22:20:29 2017 (r437170) +++ head/devel/buildbot-worker/distinfo Tue Mar 28 22:41:02 2017 (r437171) @@ -1,3 +1,3 @@ -TIMESTAMP = 1488896679 -SHA256 (buildbot-worker-0.9.4.tar.gz) = 129e0d3fa9ee34f0f227487b6d1645820d2d4853099a1b0aed56587d3acab965 -SIZE (buildbot-worker-0.9.4.tar.gz) = 100889 +TIMESTAMP = 1490709812 +SHA256 (buildbot-worker-0.9.5.tar.gz) = be89dbbd64ac4d10c8b43ea0fd8378803170247493c8ae023a4e8732aa9287aa +SIZE (buildbot-worker-0.9.5.tar.gz) = 94674 Modified: head/devel/buildbot-www/Makefile ============================================================================== --- head/devel/buildbot-www/Makefile Tue Mar 28 22:20:29 2017 (r437170) +++ head/devel/buildbot-www/Makefile Tue Mar 28 22:41:02 2017 (r437171) @@ -2,7 +2,7 @@ # $FreeBSD$ PORTNAME= buildbot-www -PORTVERSION= 0.9.4 +PORTVERSION= 0.9.5 CATEGORIES= devel python MASTER_SITES= CHEESESHOP @@ -11,15 +11,15 @@ COMMENT= Continuous Integration Framewor LICENSE= GPLv2 -MY_DEPENDS= buildbot>=0.9.4:devel/buildbot \ - buildbot-pkg>=0.9.4:devel/buildbot-pkg \ +MY_DEPENDS= buildbot>=${PORTVERSION}:devel/buildbot \ + buildbot-pkg>=${PORTVERSION}:devel/buildbot-pkg \ ${PYTHON_PKGNAMEPREFIX}mock>0.8.0:devel/py-mock BUILD_DEPENDS= ${MY_DEPENDS} RUN_DEPENDS= ${MY_DEPENDS} \ - buildbot-console-view>=0.9.4:devel/buildbot-console-view \ - buildbot-waterfall-view>=0.9.4:devel/buildbot-waterfall-view + buildbot-console-view>=${PORTVERSION}:devel/buildbot-console-view \ + buildbot-waterfall-view>=${PORTVERSION}:devel/buildbot-waterfall-view TEST_DEPENDS= trial:devel/py-twisted \ - buildbot-worker>=0.9.4:devel/buildbot-worker \ + buildbot-worker>=${PORTVERSION}:devel/buildbot-worker \ ${PYTHON_PKGNAMEPREFIX}mock>0.8.0:devel/py-mock \ ${PYTHON_PKGNAMEPREFIX}boto3>0:www/py-boto3 \ ${PYTHON_PKGNAMEPREFIX}service_identity>=16.0.0:security/py-service_identity \ Modified: head/devel/buildbot-www/distinfo ============================================================================== --- head/devel/buildbot-www/distinfo Tue Mar 28 22:20:29 2017 (r437170) +++ head/devel/buildbot-www/distinfo Tue Mar 28 22:41:02 2017 (r437171) @@ -1,3 +1,3 @@ -TIMESTAMP = 1488902698 -SHA256 (buildbot-www-0.9.4.tar.gz) = eb2f48aabee5e840aa8a4fce1f95f2fe4e2ae98045f9465d275ee5e263ae04b3 -SIZE (buildbot-www-0.9.4.tar.gz) = 691706 +TIMESTAMP = 1490709814 +SHA256 (buildbot-www-0.9.5.tar.gz) = 42c07fea15c352f3e4bf778d148715eeb76141b55519de1358cf06ad73d233d9 +SIZE (buildbot-www-0.9.5.tar.gz) = 691886 Modified: head/devel/buildbot/Makefile ============================================================================== --- head/devel/buildbot/Makefile Tue Mar 28 22:20:29 2017 (r437170) +++ head/devel/buildbot/Makefile Tue Mar 28 22:41:02 2017 (r437171) @@ -2,7 +2,7 @@ # $FreeBSD$ PORTNAME= buildbot -PORTVERSION= 0.9.4 +PORTVERSION= 0.9.5 CATEGORIES= devel python MASTER_SITES= CHEESESHOP @@ -17,13 +17,14 @@ RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}twis ${PYTHON_PKGNAMEPREFIX}autobahn>=0.16.0:www/py-autobahn \ ${PYTHON_PKGNAMEPREFIX}dateutil>=2.1:devel/py-dateutil \ ${PYTHON_PKGNAMEPREFIX}future>=0.15.2:devel/py-future \ + ${PYTHON_PKGNAMEPREFIX}lz4>=0:archivers/py-lz4 \ ${PYTHON_PKGNAMEPREFIX}pyjwt>=1.4.0:www/py-pyjwt \ ${PYTHON_PKGNAMEPREFIX}ramlfications>0:devel/py-ramlfications \ ${PYTHON_PKGNAMEPREFIX}sqlalchemy-migrate>=0.7:databases/py-sqlalchemy-migrate \ ${PYTHON_PKGNAMEPREFIX}sqlalchemy10>=0.6:databases/py-sqlalchemy10 \ ${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3 TEST_DEPENDS= trial:devel/py-twisted \ - buildbot-worker>=0.9.4:devel/buildbot-worker \ + buildbot-worker>=${PORTVERSION}:devel/buildbot-worker \ ${PYTHON_PKGNAMEPREFIX}mock>0.8.0:devel/py-mock \ ${PYTHON_PKGNAMEPREFIX}boto3>0:www/py-boto3 \ ${PYTHON_PKGNAMEPREFIX}txrequests>0:www/py-txrequests Modified: head/devel/buildbot/distinfo ============================================================================== --- head/devel/buildbot/distinfo Tue Mar 28 22:20:29 2017 (r437170) +++ head/devel/buildbot/distinfo Tue Mar 28 22:41:02 2017 (r437171) @@ -1,5 +1,3 @@ -TIMESTAMP = 1488903232 -SHA256 (buildbot-0.9.4.tar.gz) = 068161cd9ada10b87f40117c768a37ce796ebf5e7bf08f224f4c7ded88cd7472 -SIZE (buildbot-0.9.4.tar.gz) = 3020851 -SHA256 (buildbot-www-0.9.4.tar.gz) = eb2f48aabee5e840aa8a4fce1f95f2fe4e2ae98045f9465d275ee5e263ae04b3 -SIZE (buildbot-www-0.9.4.tar.gz) = 691706 +TIMESTAMP = 1490709808 +SHA256 (buildbot-0.9.5.tar.gz) = c6408c5abe78f17e92750e1e462d4cfc8a79558dcc7354ea4dea2058ed282587 +SIZE (buildbot-0.9.5.tar.gz) = 3071500 Added: head/devel/buildbot/files/patch-buildbot-secrets ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/buildbot/files/patch-buildbot-secrets Tue Mar 28 22:41:02 2017 (r437171) @@ -0,0 +1,214 @@ +diff -rNu buildbot/secrets.orig/providers/__init__.py buildbot/secrets/providers/__init__.py +--- buildbot/secrets.orig/providers/__init__.py 1970-01-01 01:00:00.000000000 +0100 ++++ buildbot/secrets/providers/__init__.py 2017-03-28 21:52:03.947803965 +0200 +@@ -0,0 +1,14 @@ ++# This file is part of Buildbot. Buildbot is free software: you can ++# redistribute it and/or modify it under the terms of the GNU General Public ++# License as published by the Free Software Foundation, version 2. ++# ++# This program is distributed in the hope that it will be useful, but WITHOUT ++# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS ++# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more ++# details. ++# ++# You should have received a copy of the GNU General Public License along with ++# this program; if not, write to the Free Software Foundation, Inc., 51 ++# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++# ++# Copyright Buildbot Team Members +diff -rNu buildbot/secrets.orig/providers/base.py buildbot/secrets/providers/base.py +--- buildbot/secrets.orig/providers/base.py 1970-01-01 01:00:00.000000000 +0100 ++++ buildbot/secrets/providers/base.py 2017-03-28 21:52:03.947803965 +0200 +@@ -0,0 +1,35 @@ ++# This file is part of Buildbot. Buildbot is free software: you can ++# redistribute it and/or modify it under the terms of the GNU General Public ++# License as published by the Free Software Foundation, version 2. ++# ++# This program is distributed in the hope that it will be useful, but WITHOUT ++# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS ++# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more ++# details. ++# ++# You should have received a copy of the GNU General Public License along with ++# this program; if not, write to the Free Software Foundation, Inc., 51 ++# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++# ++# Copyright Buildbot Team Members ++""" ++secret provider interface ++""" ++from __future__ import absolute_import ++from __future__ import print_function ++ ++import abc ++ ++from buildbot.util.service import BuildbotService ++ ++ ++class SecretProviderBase(BuildbotService): ++ """ ++ Secret provider base ++ """ ++ ++ @abc.abstractmethod ++ def get(self, *args, **kwargs): ++ """ ++ this should be an abstract method ++ """ +diff -rNu buildbot/secrets.orig/providers/file.py buildbot/secrets/providers/file.py +--- buildbot/secrets.orig/providers/file.py 1970-01-01 01:00:00.000000000 +0100 ++++ buildbot/secrets/providers/file.py 2017-03-28 21:52:03.947803965 +0200 +@@ -0,0 +1,82 @@ ++# This file is part of Buildbot. Buildbot is free software: you can ++# redistribute it and/or modify it under the terms of the GNU General Public ++# License as published by the Free Software Foundation, version 2. ++# ++# This program is distributed in the hope that it will be useful, but WITHOUT ++# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS ++# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more ++# details. ++# ++# You should have received a copy of the GNU General Public License along with ++# this program; if not, write to the Free Software Foundation, Inc., 51 ++# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++# ++# Copyright Buildbot Team Members ++""" ++file based provider ++""" ++from __future__ import absolute_import ++from __future__ import print_function ++ ++import os ++import stat ++ ++from buildbot import config ++from buildbot.secrets.providers.base import SecretProviderBase ++ ++ ++class SecretInAFile(SecretProviderBase): ++ """ ++ secret is stored in a separate file under the given directory name ++ """ ++ name = "SecretInAFile" ++ ++ def checkFileIsReadOnly(self, dirname, secretfile): ++ filepath = os.path.join(dirname, secretfile) ++ obs_stat = stat.S_IMODE(os.stat(filepath).st_mode) ++ if (obs_stat & 0o77) != 0 and os.name == "posix": ++ config.error("Permissions %s on file %s are too open." ++ " It is required that your secret files are NOT" ++ " accessible by others!" % (oct(obs_stat), ++ secretfile)) ++ ++ def checkSecretDirectoryIsAvailableAndReadable(self, dirname, suffixes): ++ if not os.access(dirname, os.F_OK): ++ config.error("directory %s does not exists" % dirname) ++ for secretfile in os.listdir(dirname): ++ for suffix in suffixes: ++ if secretfile.endswith(suffix): ++ self.checkFileIsReadOnly(dirname, secretfile) ++ ++ def loadSecrets(self, dirname, suffixes): ++ secrets = {} ++ for secretfile in os.listdir(dirname): ++ secretvalue = None ++ for suffix in suffixes: ++ if secretfile.endswith(suffix): ++ with open(os.path.join(dirname, secretfile)) as source: ++ secretvalue = source.read() ++ if suffix: ++ secretfile = secretfile[:-len(suffix)] ++ secrets[secretfile] = secretvalue ++ return secrets ++ ++ def checkConfig(self, dirname, suffixes=None): ++ self._dirname = dirname ++ if suffixes is None: ++ suffixes = [""] ++ self.checkSecretDirectoryIsAvailableAndReadable(dirname, ++ suffixes=suffixes) ++ ++ def reconfigService(self, dirname, suffixes=None): ++ self._dirname = dirname ++ self.secrets = {} ++ if suffixes is None: ++ suffixes = [""] ++ self.secrets = self.loadSecrets(self._dirname, suffixes=suffixes) ++ ++ def get(self, entry): ++ """ ++ get the value from the file identified by 'entry' ++ """ ++ return self.secrets.get(entry) +diff -rNu buildbot/secrets.orig/providers/vault.py buildbot/secrets/providers/vault.py +--- buildbot/secrets.orig/providers/vault.py 1970-01-01 01:00:00.000000000 +0100 ++++ buildbot/secrets/providers/vault.py 2017-03-28 21:52:03.947803965 +0200 +@@ -0,0 +1,67 @@ ++# This file is part of Buildbot. Buildbot is free software: you can ++# redistribute it and/or modify it under the terms of the GNU General Public ++# License as published by the Free Software Foundation, version 2. ++# ++# This program is distributed in the hope that it will be useful, but WITHOUT ++# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS ++# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more ++# details. ++# ++# You should have received a copy of the GNU General Public License along with ++# this program; if not, write to the Free Software Foundation, Inc., 51 ++# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++# ++# Copyright Buildbot Team Members ++""" ++vault based providers ++""" ++ ++from __future__ import absolute_import ++from __future__ import print_function ++ ++from twisted.internet import defer ++ ++from buildbot import config ++from buildbot.secrets.providers.base import SecretProviderBase ++from buildbot.util import httpclientservice ++ ++ ++class HashiCorpVaultSecretProvider(SecretProviderBase): ++ """ ++ basic provider where each secret is stored in Vault ++ """ ++ ++ name = 'SecretInVault' ++ ++ def checkConfig(self, vaultServer=None, vaultToken=None, secretsmount=None): ++ if not isinstance(vaultServer, str): ++ config.error("vaultServer must be a string while it is %s" % (type(vaultServer,))) ++ if not isinstance(vaultToken, str): ++ config.error("vaultToken must be a string while it is %s" % (type(vaultToken,))) ++ ++ @defer.inlineCallbacks ++ def reconfigService(self, vaultServer=None, vaultToken=None, secretsmount=None): ++ if secretsmount is None: ++ self.secretsmount = "secret" ++ else: ++ self.secretsmount = secretsmount ++ self.vaultServer = vaultServer ++ self.vaultToken = vaultToken ++ if vaultServer.endswith('/'): ++ vaultServer = vaultServer[:-1] ++ self._http = yield httpclientservice.HTTPClientService.getService( ++ self.master, self.vaultServer, headers={'X-Vault-Token': self.vaultToken}) ++ ++ @defer.inlineCallbacks ++ def get(self, entry): ++ """ ++ get the value from vault secret backend ++ """ ++ path = self.secretsmount + '/' + entry ++ proj = yield self._http.get('/v1/{0}'.format(path)) ++ code = yield proj.code ++ if code != 200: ++ raise KeyError("The key %s does not exist in Vault provider: request" ++ " return code:%d." % (entry, code)) ++ json = yield proj.json() ++ defer.returnValue(json.get(u'data', {}).get('value')) Added: head/devel/buildbot/files/patch-setup.py ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/buildbot/files/patch-setup.py Tue Mar 28 22:41:02 2017 (r437171) @@ -0,0 +1,18 @@ +--- setup.py~ 2017-03-28 21:19:34.000000000 +0000 ++++ setup.py 2017-03-28 21:19:39.875072000 +0000 +@@ -180,6 +180,7 @@ + "buildbot.schedulers", + "buildbot.scripts", + "buildbot.secrets", ++ "buildbot.secrets.providers", + "buildbot.statistics", + "buildbot.statistics.storage_backends", + "buildbot.status", +@@ -453,7 +453,6 @@ + 'txaio ' + txaio_ver, + 'autobahn ' + autobahn_ver, + 'PyJWT', +- 'distro' + ] + + # Unit test dependencies.