diff --git a/src/dda/backup/cred_rot.clj b/src/dda/backup/cred_rot.clj index 8f6e6f5..8213bd6 100644 --- a/src/dda/backup/cred_rot.clj +++ b/src/dda/backup/cred_rot.clj @@ -3,7 +3,8 @@ [orchestra.core :refer [defn-spec]] [clojure.spec.alpha :as s] [dda.backup.cred-rot.domain :as domain] - [dda.backup.infrastructure :as i])) + [dda.backup.infrastructure :as i] + [cheshire.core :as cc])) (s/def ::new-password-file string?) @@ -19,9 +20,13 @@ (if (not (nil? new-password-file)) (i/execute! (domain/add-password-command config) config)))) -(defn-spec list-passwords! nil? +(defn-spec list-passwords! map? [config ::cred-rot] - (i/execute! (domain/list-passwords-command config) config)) + (i/execute-out! (domain/list-passwords-command config) config)) + +(defn-spec parse-passwords! nil? + [config ::cred-rot] + (println (cc/parse-string (list-passwords! config)))) (defn-spec replace-old-password! nil? [] diff --git a/src/dda/backup/cred_rot/domain.clj b/src/dda/backup/cred_rot/domain.clj index 1d92599..462b127 100644 --- a/src/dda/backup/cred_rot/domain.clj +++ b/src/dda/backup/cred_rot/domain.clj @@ -57,7 +57,7 @@ (defn-spec list-passwords-command ::cd/command [config ::config] - [(base-command config ["key" "list" "--json"])]) + (base-command config ["key" "list" "--json"])) (defn-spec add-password-command ::cd/command [config ::config]