From a4ff484ef8f05657491ec11e5e0a692e64893d1b Mon Sep 17 00:00:00 2001 From: bom Date: Fri, 18 Oct 2024 16:11:17 +0200 Subject: [PATCH] Add credential-rotation skeleton --- src/dda/backup/cred_rot.clj | 22 ++++++++++++++++++++++ src/dda/backup/cred_rot/domain.clj | 18 ++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 src/dda/backup/cred_rot.clj create mode 100644 src/dda/backup/cred_rot/domain.clj diff --git a/src/dda/backup/cred_rot.clj b/src/dda/backup/cred_rot.clj new file mode 100644 index 0000000..761def0 --- /dev/null +++ b/src/dda/backup/cred_rot.clj @@ -0,0 +1,22 @@ +(ns dda.backup.cred-rot + (:require + [orchestra.core :refer [defn-spec]] + [clojure.spec.alpha :as s] + [dda.backup.cred-rot.domain :as domain])) + +(s/def ::new-password-file string?) + +(s/def ::cred-rot + (s/keys :req-un [] + :opt-un [::new-password-file])) + +; Refer to "docs/CredentialRotation.md" for specifics + +(defn-spec maybe-add-new! nil? + [config ::cred-rot] + (when-let [{:keys [new-password-file]} config] + (domain/add-new-password! new-password-file))) + +(defn-spec replace-old-password! nil? + [] + ) diff --git a/src/dda/backup/cred_rot/domain.clj b/src/dda/backup/cred_rot/domain.clj new file mode 100644 index 0000000..f05ce35 --- /dev/null +++ b/src/dda/backup/cred_rot/domain.clj @@ -0,0 +1,18 @@ +(ns dda.backup.cred-rot.domain + (:require + [orchestra.core :refer [defn-spec]] + [clojure.spec.alpha :as s])) + +(s/def ::new-password-file string?) + +; Refer to "docs/CredentialRotation.md" for specifics + +(defn-spec add-new-password! nil? + [new-password-file ::new-password-file] + ; TODO +) + +(defn-spec replace-old-password! nil? + [] + ; TODO +) \ No newline at end of file