Projet

Général

Profil

0001-compute-service-api-key-from-its-orig-and-destinatio.patch

Serghei Mihai (congés, retour 15/05), 09 octobre 2015 14:54

Télécharger (1,37 ko)

Voir les différences:

Subject: [PATCH] compute service api key from its orig and destination service
 key (#8580)

 hobo/multitenant/settings_loaders.py | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
hobo/multitenant/settings_loaders.py
40 40
        with file(path) as f:
41 41
            hobo_json = json.load(f)
42 42
        services = hobo_json.get('services')
43
        base_url, secret = [(s.get('base_url'), s.get('secret_key'))
44
                            for s in services if s.get('this')][0]
43
        base_url = [s.get('base_url') for s in services if s.get('this')][0]
45 44
        orig = urlparse.urlparse(base_url).netloc.split(':')[0]
46
        secret = hashlib.sha1(orig+secret).hexdigest()
47 45

  
48 46
        for service in services:
49 47
            service_id = service.get('service-id')
50

  
48
            secret = hashlib.sha1(orig+service.get('secret_key')).hexdigest()
51 49
            service_data = {
52 50
                'url': service.get('base_url'),
53 51
                'backoffice-menu-url': service.get('backoffice-menu-url'),
54
-