2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-26 03:19:48 +00:00

Support proper readback of crypted

crypted attributes should be
treated about the same as
passwords.
This commit is contained in:
Jarrod Johnson 2020-04-15 16:34:54 -04:00
parent 890793068c
commit e2aaa2afb4
2 changed files with 5 additions and 2 deletions

View File

@ -1802,6 +1802,9 @@ class CryptedAttributes(Attributes):
if kv[key] is not None and kv[key]['cryptvalue'] != '':
nkv[key] = {'isset': True}
nkv[key]['inheritedfrom'] = kv[key]['inheritedfrom']
elif kv[key] is not None and kv[key]['hashvalue'] != '':
nkv[key] = {'isset': True}
nkv[key]['inheritedfrom'] = kv[key]['inheritedfrom']
except KeyError:
pass
self.notnode = name is None

View File

@ -57,7 +57,7 @@ def retrieve_nodegroup(nodegroup, element, configmanager, inputdata):
val['desc'] = 'The noderange this group is expanded ' \
'to when used in noderange, exclusive with static ' \
'nodes'
if attribute.startswith('secret.'):
if attribute.startswith('secret.') or attribute.startswith('crypted.'):
yield msg.CryptedAttributes(
kv={attribute: val},
desc=allattributes.node[attribute]['description'])
@ -117,7 +117,7 @@ def retrieve_nodes(nodes, element, configmanager, inputdata):
val = []
else: # no setting, provide a blank
val = {'value': None}
if attribute.startswith('secret.'):
if attribute.startswith('secret.') or attribute.startswith('crypted.'):
yield msg.CryptedAttributes(
node, {attribute: val},
allattributes.node.get(