mirror of
https://github.com/xcat2/confluent.git
synced 2024-11-22 17:43:14 +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:
parent
149e41c33c
commit
931c7f25d1
@ -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': {
|
||||
|
@ -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)
|
||||
|
@ -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'
|
||||
|
Loading…
Reference in New Issue
Block a user