Projet

Général

Profil

0001-hobo-deploy-reuse-existing-wcs-secret-28304.patch

Frédéric Péters, 25 novembre 2018 08:30

Télécharger (1,55 ko)

Voir les différences:

Subject: [PATCH] hobo-deploy: reuse existing wcs secret (#28304)

 wcs/ctl/check_hobos.py | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
wcs/ctl/check_hobos.py
385 385

  
386 386
            domain = urlparse.urlparse(service_url).netloc.split(':')[0]
387 387
            if service is current_service:
388
                # custom key calcultation for "self", as the shared_secret code
389
                # would do secret_key ^ secret_key = 0.
390
                api_secrets[domain] = self.shared_secret(current_service.get('secret_key'),
391
                        str(random.SystemRandom().random()))
388
                if config.has_option('api-secrets', domain):
389
                    api_secrets[domain] = config.get('api-secrets', domain)
390
                else:
391
                    # custom key calcultation for "self", as the shared_secret code
392
                    # would do secret_key ^ secret_key = 0.
393
                    api_secrets[domain] = self.shared_secret(current_service.get('secret_key'),
394
                            str(random.SystemRandom().random()))
392 395
                continue
393 396

  
394 397
            api_secrets[domain] = self.shared_secret(current_service.get('secret_key'), service.get('secret_key'))
395
-