Dev api password (#244)

* fix: delete CI password data

* fix(api): update CI password to flush cache
This commit is contained in:
pycook 2023-10-29 11:42:07 +08:00 committed by GitHub
parent 89e492c1f3
commit 2db41dd992
2 changed files with 2 additions and 3 deletions

View File

@ -723,7 +723,6 @@ class CIManager(object):
def save_password(cls, ci_id, attr_id, value, record_id, type_id):
changed = None
encrypt_value = None
value_table = ValueTypeMap.table[ValueTypeEnum.PASSWORD]
if current_app.config.get('SECRETS_ENGINE') == 'inner':
if value:
@ -762,7 +761,7 @@ class CIManager(object):
current_app.logger.warning('delete password to vault failed: {}'.format(e))
if changed is not None:
AttributeValueManager.write_change2(changed, record_id)
return AttributeValueManager.write_change2(changed, record_id)
@classmethod
def load_password(cls, ci_id, attr_id):

View File

@ -69,7 +69,7 @@ class AttributeValueManager(object):
if attr.is_list:
res[field_name] = [ValueTypeMap.serialize[attr.value_type](i.value) for i in rs]
elif attr.is_password and rs:
res[field_name] = '******'
res[field_name] = '******' if rs[0].value else ''
else:
res[field_name] = ValueTypeMap.serialize[attr.value_type](rs[0].value) if rs else None