Prepare release 0.4.6

parent 347c8f1a
Pipeline #28619 passed with stage
in 43 seconds
......@@ -3,6 +3,11 @@ All notable changes to this project will be documented in this file. This change
## [Unreleased]
## [v0.4.6] - 2020-01-16
### Changed
- Library should stay silent (DEBUG level) by default
- Log error level on failure
## [v0.4.5] - 2020-01-09
### Changed
- Bugfix signing function: Include kid in header by default.
......@@ -63,7 +68,8 @@ All notable changes to this project will be documented in this file. This change
- Function `resolve-key` that fetches jwks keys and returns a PublicKey given the kid in the jwt header.
- Function `unsign` which tries to validate a jwt given a jwks URL and a jwt.
[Unreleased]: https://gitlab.nsd.no/clojure/clj-jwt/compare/v0.4.5...HEAD
[Unreleased]: https://gitlab.nsd.no/clojure/clj-jwt/compare/v0.4.6...HEAD
[v0.4.6]: https://gitlab.nsd.no/clojure/clj-jwt/compare/v0.4.5...v0.4.6
[v0.4.5]: https://gitlab.nsd.no/clojure/clj-jwt/compare/v0.4.4...v0.4.5
[v0.4.4]: https://gitlab.nsd.no/clojure/clj-jwt/compare/v0.4.3...v0.4.4
[v0.4.3]: https://gitlab.nsd.no/clojure/clj-jwt/compare/v0.4.2...v0.4.3
......
(defproject no.nsd/clj-jwt "0.4.5"
(defproject no.nsd/clj-jwt "0.4.6"
: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"
......
......@@ -110,7 +110,7 @@
"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"
[jwks-url]
(log/info "Fetching keys from jwks-url" jwks-url)
(log/debug "Fetching keys from jwks-url" jwks-url)
(try (->> jwks-url
slurp
(#(json/read-str % :key-fn keyword))
......@@ -134,13 +134,13 @@
(let [key-fn (fn [] (get-in @keystore [jwks-url (:kid jwt-header) key-type]))]
(if-let [key (key-fn)]
key
(do (log/info "Fetch and resolve key" jwt-header "from" jwks-url)
(do (log/debug "Fetch and resolve key" jwt-header "from" jwks-url)
(when-let [new-keys (fetch-keys jwks-url)]
(swap! keystore #(update % jwks-url merge new-keys)))
(if-let [key (key-fn)]
key
(do
(log/info "Could not locate public key corresponding to jwt header's kid:" (:kid jwt-header) "for url:" jwks-url)
(log/error "Could not locate public key corresponding to jwt header's kid:" (:kid jwt-header) "for url:" jwks-url)
(throw (ex-info (str "Could not locate key corresponding to jwt header's kid: " (:kid jwt-header) " for url: " jwks-url)
{:type :validation :cause :unknown-key}))))))))
......
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