Skip to content

Commit 48287ea

Browse files
committed
chore(controller): change manager auth
1 parent 21bf3af commit 48287ea

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

rootfs/api/manager.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import base64
12
import requests
23
from typing import List, Dict
34
from requests_toolbelt import user_agent
@@ -8,10 +9,14 @@
89
class ManagerAPI(object):
910

1011
def __init__(self):
12+
token = base64.b85encode(b"%s:%s" % (
13+
settings.WORKFLOW_MANAGER_ACCESS_KEY.encode("utf8"),
14+
settings.WORKFLOW_MANAGER_SECRET_KEY.encode("utf8"),
15+
)).decode("utf8")
1116
self.headers = {
12-
'Content-Type': 'application/json',
13-
'Authorization': 'token %s' % settings.WORKFLOW_MANAGER_TOKEN,
14-
'User-Agent': user_agent('Drycc Controller ', drycc_version)
17+
'Content-Type': 'application/json',
18+
'Authorization': 'token %s' % token,
19+
'User-Agent': user_agent('Drycc Controller ', drycc_version)
1520
}
1621

1722
def requests(self, method, url, **kwargs):

rootfs/api/settings/production.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,4 +477,5 @@
477477

478478
# Workflow-manager Configuration Options
479479
WORKFLOW_MANAGER_URL = os.environ.get('DRYCC_WORKFLOW_MANAGER_URL', None)
480-
WORKFLOW_MANAGER_TOKEN = os.environ.get('DRYCC_WORKFLOW_MANAGER_TOKEN', None)
480+
WORKFLOW_MANAGER_ACCESS_KEY = os.environ.get('WORKFLOW_MANAGER_ACCESS_KEY', None)
481+
WORKFLOW_MANAGER_SECRET_KEY = os.environ.get('WORKFLOW_MANAGER_SECRET_KEY', None)

0 commit comments

Comments
 (0)