diff --git a/package.json b/package.json index 13f9eaa..52ea437 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "keycloak", "k8s", "c4k", - "deplyoment", + "deployment", "yaml", "convention4kubernetes" ], diff --git a/project.clj b/project.clj index 7a94a64..c66dd5b 100644 --- a/project.clj +++ b/project.clj @@ -5,10 +5,7 @@ :url "https://www.apache.org/licenses/LICENSE-2.0.html"} :dependencies [[org.clojure/clojure "1.10.3"] [org.clojure/tools.reader "1.3.4"] - [aero "1.1.6"] - [orchestra "2021.01.01-1"] - [expound "0.8.9"] - [clj-commons/clj-yaml "0.7.106"]] + [org.domaindrivenarchitecture/c4k-common-clj "0.1.0-SNAPSHOT"]] :target-path "target/%s/" :source-paths ["src/main/cljc" "src/main/clj"] diff --git a/shadow-cljs.edn b/shadow-cljs.edn index 01d9c40..9f78033 100644 --- a/shadow-cljs.edn +++ b/shadow-cljs.edn @@ -3,9 +3,7 @@ "src/main/resources" "src/test/cljc" "src/test/resources"] - :dependencies [[aero "1.1.6"] - [orchestra "2021.01.01-1"] - [expound "0.8.9"]] + :dependencies [[org.domaindrivenarchitecture/c4k-common-cljs "0.1.0-SNAPSHOT"]] :dev-http {8080 "public"} :builds {:frontend {:target :browser :modules {:main {:init-fn dda.c4k-keycloak.browser/init}} diff --git a/src/main/clj/dda/c4k_keycloak/base64.clj b/src/main/clj/dda/c4k_keycloak/base64.clj deleted file mode 100644 index 4f9bb50..0000000 --- a/src/main/clj/dda/c4k_keycloak/base64.clj +++ /dev/null @@ -1,14 +0,0 @@ -(ns dda.c4k-keycloak.base64 - (:import (java.util Base64))) - -(defn encode - [string] - (.encodeToString - (Base64/getEncoder) - (.getBytes string "UTF-8"))) - -(defn decode - [string] - (String. - (.decode (Base64/getDecoder) string) - "UTF-8")) \ No newline at end of file diff --git a/src/main/cljc/dda/c4k_keycloak/common.cljc b/src/main/cljc/dda/c4k_keycloak/common.cljc deleted file mode 100644 index 7beee60..0000000 --- a/src/main/cljc/dda/c4k_keycloak/common.cljc +++ /dev/null @@ -1,41 +0,0 @@ -(ns dda.c4k-keycloak.common - (:require - [clojure.walk])) - -(defn bash-env-string? - [input] - (and (string? input) - (not (re-matches #".*['\"\$]+.*" input)))) - -(defn fqdn-string? - [input] - (and (string? input) - (some? (re-matches #"(?=^.{4,253}$)(^((?!-)[a-zA-Z0-9-]{0,62}[a-zA-Z0-9]\.)+[a-zA-Z]{2,63}$)" input)))) - -(defn letsencrypt-issuer? - [input] - (contains? #{:prod :staging} input)) - -(defn replace-named-value - [coll name value] - (clojure.walk/postwalk #(if (and (map? %) - (= name (:name %))) - {:name name :value value} - %) - coll)) - -(defn replace-key-value - [coll key value] - (clojure.walk/postwalk #(if (and (map? %) - (contains? % key)) - (assoc % key value) - %) - coll)) - -(defn replace-all-matching-values-by-new-value - [coll value-to-match value-to-replace] - (clojure.walk/postwalk #(if (and (= (type value-to-match) (type %)) - (= value-to-match %)) - value-to-replace - %) - coll)) diff --git a/src/main/cljc/dda/c4k_keycloak/keycloak.cljc b/src/main/cljc/dda/c4k_keycloak/keycloak.cljc index 02dccb0..245d610 100644 --- a/src/main/cljc/dda/c4k_keycloak/keycloak.cljc +++ b/src/main/cljc/dda/c4k_keycloak/keycloak.cljc @@ -2,8 +2,8 @@ (:require [clojure.spec.alpha :as s] [dda.c4k-keycloak.yaml :as yaml] - [dda.c4k-keycloak.base64 :as b64] - [dda.c4k-keycloak.common :as cm])) + [dda.c4k-common.base64 :as b64] + [dda.c4k-common.common :as cm])) (s/def ::keycloak-admin-user cm/bash-env-string?) (s/def ::keycloak-admin-password cm/bash-env-string?) diff --git a/src/main/cljc/dda/c4k_keycloak/postgres.cljc b/src/main/cljc/dda/c4k_keycloak/postgres.cljc index b3846ea..01681bf 100644 --- a/src/main/cljc/dda/c4k_keycloak/postgres.cljc +++ b/src/main/cljc/dda/c4k_keycloak/postgres.cljc @@ -2,8 +2,8 @@ (:require [clojure.spec.alpha :as s] [dda.c4k-keycloak.yaml :as yaml] - [dda.c4k-keycloak.base64 :as b64] - [dda.c4k-keycloak.common :as cm])) + [dda.c4k-common.base64 :as b64] + [dda.c4k-common.common :as cm])) (s/def ::postgres-db-user cm/bash-env-string?) (s/def ::postgres-db-password cm/bash-env-string?) diff --git a/src/main/cljs/dda/c4k_keycloak/base64.cljs b/src/main/cljs/dda/c4k_keycloak/base64.cljs deleted file mode 100644 index 8c1caa0..0000000 --- a/src/main/cljs/dda/c4k_keycloak/base64.cljs +++ /dev/null @@ -1,11 +0,0 @@ -(ns dda.c4k-keycloak.base64 - (:require - ["js-base64" :as b64])) - -(defn encode - [string] - (.encode b64/Base64 string)) - -(defn decode - [string] - (.decode b64/Base64 string))