add secret api for machines/users/secrets

This commit is contained in:
Jörg Thalheim
2023-08-09 14:10:04 +02:00
parent 2483e29819
commit c535cf78a1
4 changed files with 35 additions and 12 deletions

View File

@@ -24,12 +24,14 @@ sops_machines_folder = gen_sops_subfolder("machines")
sops_groups_folder = gen_sops_subfolder("groups")
def list_objects(path: Path, is_valid: Callable[[str], bool]) -> None:
def list_objects(path: Path, is_valid: Callable[[str], bool]) -> list[str]:
objs: list[str] = []
if not path.exists():
return
return objs
for f in os.listdir(path):
if is_valid(f):
print(f)
objs.append(f)
return objs
def remove_object(path: Path, name: str) -> None: