don't show passwords
This commit is contained in:
parent
9a9be54689
commit
f935afd1c2
1 changed files with 13 additions and 7 deletions
|
@ -662,8 +662,9 @@ class NextcloudHandler:
|
||||||
|
|
||||||
def exists_password(self, obj):
|
def exists_password(self, obj):
|
||||||
'''Test if a password exist with the same name'''
|
'''Test if a password exist with the same name'''
|
||||||
|
safer_obj = dict(obj, **{ 'password': '***' })
|
||||||
self.debug(
|
self.debug(
|
||||||
{ "action": "check_exists_password", "object": obj }
|
{ "action": "check_exists_password", "object": safer_obj }
|
||||||
)
|
)
|
||||||
all_passwords = self.list_passwords()
|
all_passwords = self.list_passwords()
|
||||||
if all_passwords:
|
if all_passwords:
|
||||||
|
@ -799,13 +800,15 @@ class NextcloudHandler:
|
||||||
def is_same_password(self, obj1, obj2):
|
def is_same_password(self, obj1, obj2):
|
||||||
'''Test if two password objects are the same or similar'''
|
'''Test if two password objects are the same or similar'''
|
||||||
if obj1 == obj2:
|
if obj1 == obj2:
|
||||||
|
safer_obj1 = dict(obj1, **{ 'password': '***' })
|
||||||
|
safer_obj2 = dict(obj2, **{ 'password': '***' })
|
||||||
self.debug(
|
self.debug(
|
||||||
{"action": "notify_exact_match", "object": { "obj1": obj1, "obj2": obj2 } }
|
{"action": "notify_exact_match", "object": { "obj1": safer_obj1, "obj2": safer_obj2 } }
|
||||||
)
|
)
|
||||||
return True
|
return True
|
||||||
if obj1['label'] == obj2['label']:
|
if obj1['label'] == obj2['label']:
|
||||||
self.debug(
|
self.debug(
|
||||||
{ "action": "notify_name_match", "object": { "obj1": obj1, "obj2": obj2 } }
|
{ "action": "notify_name_match", "object": { "obj1": safer_obj1, "obj2": safer_obj2 } }
|
||||||
)
|
)
|
||||||
if (
|
if (
|
||||||
self.is_same_key('username', obj1, obj2) and
|
self.is_same_key('username', obj1, obj2) and
|
||||||
|
@ -814,7 +817,7 @@ class NextcloudHandler:
|
||||||
self.is_same_key('folder', obj1, obj2)
|
self.is_same_key('folder', obj1, obj2)
|
||||||
):
|
):
|
||||||
self.debug(
|
self.debug(
|
||||||
{ "action": "notify_match", "object": { "obj1": obj1, "obj2": obj2 } }
|
{ "action": "notify_match", "object": { "obj1": safer_obj1, "obj2": safer_obj2 } }
|
||||||
)
|
)
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
@ -897,8 +900,9 @@ class NcPasswordClient:
|
||||||
|
|
||||||
def create_password(self, obj):
|
def create_password(self, obj):
|
||||||
'''Create a password with an object'''
|
'''Create a password with an object'''
|
||||||
|
safer_obj = dict(obj, **{ 'password': '***' })
|
||||||
self.debug(
|
self.debug(
|
||||||
{ "action": "create_password", "object": obj }
|
{ "action": "create_password", "object": safer_obj }
|
||||||
)
|
)
|
||||||
self.debug(
|
self.debug(
|
||||||
{
|
{
|
||||||
|
@ -911,8 +915,9 @@ class NcPasswordClient:
|
||||||
'''Delete a password'''
|
'''Delete a password'''
|
||||||
for password in self.nc.list_passwords():
|
for password in self.nc.list_passwords():
|
||||||
if password['label'] == name:
|
if password['label'] == name:
|
||||||
|
safer_obj = dict(password, **{ 'password': '***' })
|
||||||
self.debug(
|
self.debug(
|
||||||
{ "action": "delete_password", "object": password }
|
{ "action": "delete_password", "object": safer_obj }
|
||||||
)
|
)
|
||||||
self.debug(
|
self.debug(
|
||||||
{ "action": "deleted_password", "object": self.nc.delete_password(password)}
|
{ "action": "deleted_password", "object": self.nc.delete_password(password)}
|
||||||
|
@ -980,8 +985,9 @@ class NcPasswordClient:
|
||||||
)
|
)
|
||||||
return False
|
return False
|
||||||
for item in self.nc.list_passwords():
|
for item in self.nc.list_passwords():
|
||||||
|
safer_obj = dict(item, **{ 'password': '***' })
|
||||||
self.debug(
|
self.debug(
|
||||||
{ "action": "delete_all_passwords", "message": "Deleting password", "object": item }
|
{ "action": "delete_all_passwords", "message": "Deleting password", "object": safer_obj }
|
||||||
)
|
)
|
||||||
self.nc.delete_password(item)
|
self.nc.delete_password(item)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue