Add credential-rotation skeleton
This commit is contained in:
parent
7076f44014
commit
a4ff484ef8
2 changed files with 40 additions and 0 deletions
22
src/dda/backup/cred_rot.clj
Normal file
22
src/dda/backup/cred_rot.clj
Normal 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?
|
||||||
|
[]
|
||||||
|
)
|
18
src/dda/backup/cred_rot/domain.clj
Normal file
18
src/dda/backup/cred_rot/domain.clj
Normal 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
|
||||||
|
)
|
Loading…
Reference in a new issue