Compare commits

..

12 commits

Author SHA1 Message Date
mwiegand
071bc8cc8d wip 2022-08-17 23:47:11 +02:00
mwiegand
a9c0e91ea8 wip 2022-08-16 23:22:47 +02:00
mwiegand
dbcf21d807 wip 2022-08-16 22:39:42 +02:00
mwiegand
4c5db6abcf wip 2022-08-16 22:27:46 +02:00
mwiegand
d524734aa9 wip 2022-08-16 22:23:02 +02:00
mwiegand
3dbcf919b1 wip 2022-08-16 19:14:39 +02:00
mwiegand
cd7981cf86 wip 2022-08-13 15:35:41 +02:00
mwiegand
b478677221 wip 2022-08-13 15:35:41 +02:00
mwiegand
2904f62b41 wip 2022-08-13 15:35:41 +02:00
mwiegand
dd28bfee7b wip 2022-08-13 15:35:41 +02:00
mwiegand
9d28cf2e8e wip 2022-08-13 15:35:41 +02:00
mwiegand
01f3606f3d wip 2022-08-13 15:35:41 +02:00

View file

@ -1,6 +1,5 @@
from os import walk
from os.path import join, basename, splitext
from re import search
converters = {
'32_random_bytes_as_base64_for': lambda x: vault.random_bytes_as_base64_for(x, length=32),
@ -11,10 +10,9 @@ converters = {
def demagify(data):
if isinstance(data, str):
match = search(r'^\!([0-9a-zA-Z_-]{,255})\:(.*)$', data)
if match:
magicstring, content = match.groups()
return converters[magicstring](content)
for name, converter in converters.items():
if data.startswith(f'!{name}:'):
return converter(data[len(name) + 2:])
else:
return data
elif isinstance(data, dict):