2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-23 01:53:28 +00:00

Change apikey to crypted

Since it will be crypted, makes sense
for it to be presented same way as rootpassword.
This commit is contained in:
Jarrod Johnson 2020-04-21 08:24:01 -04:00
parent 149e41c33c
commit 931c7f25d1
3 changed files with 4 additions and 4 deletions

View File

@ -101,7 +101,7 @@ node = {
'description': 'The password of the local root password. '
'This is stored as a non-recoverable hash.',
},
'deployment.apikey': {
'crypted.selfapikey': {
'description': ('Crypt of api key for self api requests by node'),
},
'deployment.apiarmed': {

View File

@ -69,7 +69,7 @@ class CredServer(object):
client.close()
return
echotoken = util.stringify(client.recv(tlv[1]))
cfgupdate = {nodename: {'deployment.apikey': echotoken, 'deployment.apiarmed': ''}}
cfgupdate = {nodename: {'crypted.selfapikey': echotoken, 'deployment.apiarmed': ''}}
if apiarmed == 'continuous':
del cfgupdate[nodename]['deployment.apiarmed']
self.cfm.set_node_attributes(cfgupdate)

View File

@ -27,8 +27,8 @@ def handle_request(env, start_response):
yield 'Unauthorized'
return
cfg = configmanager.ConfigManager(None)
eak = cfg.get_node_attributes(nodename, 'deployment.apikey').get(
nodename, {}).get('deployment.apikey', {}).get('value', None)
eak = cfg.get_node_attributes(nodename, 'crypted.selfapikey').get(
nodename, {}).get('crypted.selfapikey', {}).get('value', None)
if not eak:
start_response('401 Unauthorized', [])
yield 'Unauthorized'