From: Joshua Watt <jpewhacker@gmail.com>
To: bitbake-devel@lists.openembedded.org
Cc: Joshua Watt <JPEWhacker@gmail.com>
Subject: [bitbake-devel][PATCH] siggen: Add support for hashserve credentials
Date: Fri, 22 Mar 2024 07:50:35 -0600 [thread overview]
Message-ID: <20240322135035.1113817-1-JPEWhacker@gmail.com> (raw)
Adds support for hashserver credentials to be specified in the
SignatureGenerator
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
bitbake/lib/bb/siggen.py | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py
index 3ab8431a089..2a0ecf57e16 100644
--- a/bitbake/lib/bb/siggen.py
+++ b/bitbake/lib/bb/siggen.py
@@ -535,23 +535,34 @@ class SignatureGeneratorUniHashMixIn(object):
# hashes to appear over time, but much less likely for them to
# disappear
self.unihash_exists_cache = set()
+ self.username = None
+ self.password = None
super().__init__(data)
def get_taskdata(self):
- return (self.server, self.method, self.extramethod, self.max_parallel) + super().get_taskdata()
+ return (self.server, self.method, self.extramethod, self.max_parallel, self.username, self.password) + super().get_taskdata()
def set_taskdata(self, data):
- self.server, self.method, self.extramethod, self.max_parallel = data[:4]
- super().set_taskdata(data[4:])
+ self.server, self.method, self.extramethod, self.max_parallel, self.username, self.password = data[:6]
+ super().set_taskdata(data[6:])
+
+ def get_hashserv_creds(self):
+ if self.username and self.password:
+ return {
+ "username": self.username,
+ "password": self.password,
+ }
+
+ return {}
def client(self):
if getattr(self, '_client', None) is None:
- self._client = hashserv.create_client(self.server)
+ self._client = hashserv.create_client(self.server, **self.get_hashserv_creds())
return self._client
def client_pool(self):
if getattr(self, '_client_pool', None) is None:
- self._client_pool = hashserv.client.ClientPool(self.server, self.max_parallel)
+ self._client_pool = hashserv.client.ClientPool(self.server, self.max_parallel, **self.get_hashserv_creds())
return self._client_pool
def reset(self, data):
--
2.34.1
reply other threads:[~2024-03-22 13:50 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240322135035.1113817-1-JPEWhacker@gmail.com \
--to=jpewhacker@gmail.com \
--cc=bitbake-devel@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).