From 5c583fd72f0ebbc48aa53ef2e529888a43933235 Mon Sep 17 00:00:00 2001 From: bom Date: Fri, 25 Oct 2024 13:19:59 +0200 Subject: [PATCH] Add list passwords command --- src/dda/backup/cred_rot/domain.clj | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/dda/backup/cred_rot/domain.clj b/src/dda/backup/cred_rot/domain.clj index 1a1cec1..b8e846e 100644 --- a/src/dda/backup/cred_rot/domain.clj +++ b/src/dda/backup/cred_rot/domain.clj @@ -38,6 +38,21 @@ ; Refer to "docs/CredentialRotation.md" for specifics +(defn-spec list-passwords-command ::cd/command + [config ::config] + (let [{:keys [restic-repository password-file + certificate-file new-password-file]} config] + (into + [] + (concat ["restic" "-r" restic-repository "key" "list" "--json"] + (cond + (some? certificate-file) + ["--cacert" certificate-file] + (some? password-file) + ["--password-file" password-file] + :else + []))))) + (defn-spec add-new-password! nil? [new-password-file ::new-password-file] ; TODO