Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Hvornum <anton.feeds@gmail.com>2021-02-17 14:54:45 +0100
committerAnton Hvornum <anton.feeds@gmail.com>2021-02-17 14:54:45 +0100
commita9ce3e539028b2484991d21528a09cc3f41210de (patch)
tree8f64ba9bbd67da9438493c73a8209e19eabb9e1a
parent930fc994d94132fc7676f4297465a2ad90487b75 (diff)
Testing auto-filter in the JSON encoder based on ! points markering sensitive data.
-rw-r--r--archinstall/lib/general.py5
-rw-r--r--examples/guided.py6
2 files changed, 7 insertions, 4 deletions
diff --git a/archinstall/lib/general.py b/archinstall/lib/general.py
index dc94b063..97ad1565 100644
--- a/archinstall/lib/general.py
+++ b/archinstall/lib/general.py
@@ -45,7 +45,10 @@ class JSON_Encoder:
else:
val = JSON_Encoder._encode(val)
del(obj[key])
- obj[JSON_Encoder._encode(key)] = val
+ if type(key) == str and key[0] == '!':
+ obj[JSON_Encoder._encode(key)] = '******'
+ else:
+ obj[JSON_Encoder._encode(key)] = val
return obj
elif hasattr(obj, 'json'):
return obj.json()
diff --git a/examples/guided.py b/examples/guided.py
index 5fdc318b..cf7c3ef3 100644
--- a/examples/guided.py
+++ b/examples/guided.py
@@ -150,9 +150,9 @@ if archinstall.arguments['harddrive'].has_partitions():
archinstall.arguments['harddrive'].keep_partitions = False
# Get disk encryption password (or skip if blank)
-if not archinstall.arguments.get('encryption-password', None):
- archinstall.arguments['encryption-password'] = archinstall.get_password(prompt='Enter disk encryption password (leave blank for no encryption): ')
-archinstall.arguments['harddrive'].encryption_password = archinstall.arguments['encryption-password']
+if not archinstall.arguments.get('!encryption-password', None):
+ archinstall.arguments['!encryption-password'] = archinstall.get_password(prompt='Enter disk encryption password (leave blank for no encryption): ')
+archinstall.arguments['harddrive'].encryption_password = archinstall.arguments['!encryption-password']
# Get the hostname for the machine
if not archinstall.arguments.get('hostname', None):