hobo-deploy: reuse existing wcs secret (#28304)

This commit is contained in:
Frédéric Péters 2018-11-25 08:29:10 +01:00
parent 4f6895a7b1
commit 15c3fa4696
1 changed files with 7 additions and 4 deletions

View File

@ -385,10 +385,13 @@ class CmdCheckHobos(Command):
domain = urlparse.urlparse(service_url).netloc.split(':')[0]
if service is current_service:
# custom key calcultation for "self", as the shared_secret code
# would do secret_key ^ secret_key = 0.
api_secrets[domain] = self.shared_secret(current_service.get('secret_key'),
str(random.SystemRandom().random()))
if config.has_option('api-secrets', domain):
api_secrets[domain] = config.get('api-secrets', domain)
else:
# custom key calcultation for "self", as the shared_secret code
# would do secret_key ^ secret_key = 0.
api_secrets[domain] = self.shared_secret(current_service.get('secret_key'),
str(random.SystemRandom().random()))
continue
api_secrets[domain] = self.shared_secret(current_service.get('secret_key'), service.get('secret_key'))