From af57b9dd2029c1e401074609587f9c1396ed0fce Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 21 May 2021 17:42:57 +0200 Subject: [PATCH] mob --- src/main/cljc/dda/k8s_keycloak/core.cljc | 12 ++++++------ valid-auth.edn | 3 ++- valid-config.edn | 2 -- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/main/cljc/dda/k8s_keycloak/core.cljc b/src/main/cljc/dda/k8s_keycloak/core.cljc index b39d53c..e743412 100644 --- a/src/main/cljc/dda/k8s_keycloak/core.cljc +++ b/src/main/cljc/dda/k8s_keycloak/core.cljc @@ -19,12 +19,12 @@ (s/def ::user-name bash-env-string?) (s/def ::user-password string?) (s/def ::fqdn fqdn-string?) +(s/def ::issuer #{:prod :staging}) -(def config? (s/keys :req-un [::user-name ::user-password ::fqdn] +(def config? (s/keys :req-un [::fqdn] :opt-un [::issuer])) -(def auth? any?) -(def config? config?) +(def auth? (s/keys :req-un [::user-name ::user-password])) (defn generate-config [my-config my-auth] (-> @@ -73,12 +73,12 @@ (yaml/from-string (yaml/load-resource "service.yaml"))) (defn-spec generate any? - [my-config string? - my-auth string?] + [my-config config? + my-auth auth?] (cs/join "\n" [(yaml/to-string (generate-config my-config my-auth)) "---" - (yaml/to-string (generate-config)) + (yaml/to-string (generate-certificate)) "---" (yaml/to-string (generate-ingress)) "---" diff --git a/valid-auth.edn b/valid-auth.edn index 9e26dfe..59c92f4 100644 --- a/valid-auth.edn +++ b/valid-auth.edn @@ -1 +1,2 @@ -{} \ No newline at end of file +{:user-name "testuser" + :user-password "test1234"} \ No newline at end of file diff --git a/valid-config.edn b/valid-config.edn index a408c23..40de098 100644 --- a/valid-config.edn +++ b/valid-config.edn @@ -1,4 +1,2 @@ {:fqdn "test.de" - :user-name "testuser" - :user-password "test1234" :issuer :prod} \ No newline at end of file