Add based logs for key functions

Signed-off-by: Snorre Magnus Davøen's avatarSnorre Magnus Davøen <>
parent 542044f0
Pipeline #13785 passed with stage
in 30 seconds
......@@ -4,6 +4,7 @@
buddy/buddy-sign {:mvn/version "3.0.0"}
org.clojure/data.json {:mvn/version "0.2.6"}
org.clojure/algo.generic {:mvn/version "0.1.3"}
org.clojure/tools.logging {:mvn/version "0.4.1"}
invetica/uri {:mvn/version "0.5.0"}}
:aliases {:test {:extra-paths ["test" "test-resources"]
:extra-deps {com.cognitect/test-runner {:git/url ""
......@@ -7,6 +7,7 @@
[ :refer [resource]]
[clojure.spec.gen.alpha :as gen]
[clojure.spec.alpha :as s]
[ :as log]
[invetica.uri :as uri]))
......@@ -89,12 +90,13 @@
"Fetches the jwks from the supplied jwks-url and converts to java Keys.
Returns a map keyed on key-id where each value is a RSAPublicKey object"
(log/info "Fetching keys from jwks-url" jwks-url)
(try (->> jwks-url
(#(json/read-str % :key-fn keyword))
(catch Exception e false)))
(catch Exception e (do (log/error "Could not fetch jwks keys")
(def public-keys
"Atom to hold the public keys used for signature validation in memory for
......@@ -111,6 +113,7 @@
"Returns given jwks-url and :kid in jwt-header.
If no key is found refreshes"
[jwks-url jwt-header]
(log/info "Resolving key " jwt-header " from " jwks-url)
(let [key-fn (fn [] (get @public-keys (:kid jwt-header)))]
(if-let [key (key-fn)]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment