Update logs to reflect cache usage

Signed-off-by: Snorre Magnus Davøen's avatarSnorre Magnus Davøen <snorre.davoen@nsd.no>
parent 36bbba7b
Pipeline #14941 passed with stage
in 1 minute and 1 second
(defproject no.nsd/clj-jwt "0.3.0"
(defproject no.nsd/clj-jwt "0.3.1"
:description "A Clojure library to fetch json web keys and validate json web tokens. Wraps Buddy."
:url "https://gitlab.nsd.no/clojure/clj-jwt"
:license {:name "Eclipse Public License"
......@@ -118,11 +118,11 @@
"Returns java.security.PublicKey given jwks-url and :kid in jwt-header.
If no key is found refreshes"
[jwks-url jwt-header]
(log/debug "Resolving key " jwt-header " from " jwks-url)
(log/debug "Resolving key" jwt-header "from jwk cache for" jwks-url)
(let [key-fn (fn [] (get @public-keys (:kid jwt-header)))]
(if-let [key (key-fn)]
(do (log/info "Retry resolve key " jwt-header " from " jwks-url)
(do (log/info "Fetch and resolve key" jwt-header "from" jwks-url)
(reset! public-keys (or (fetch-keys jwks-url) @public-keys))
(if-let [key (key-fn)]
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment