Add credential-rotation skeleton

This commit is contained in:
bom 2024-10-18 16:11:17 +02:00
parent 7076f44014
commit a4ff484ef8
2 changed files with 40 additions and 0 deletions

View file

@ -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?
[]
)

View file

@ -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
)