Add tests for scopes function

parent 0389a113
Pipeline #28242 passed with stage
in 52 seconds
......@@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. This change
## [Unreleased]
## [v0.4.4] - 2020-01-07
### Changed
- Be slightly more paranoid in scopes function.
## [v0.4.3] - 2020-01-07
### Added
- Add scopes function to extract jwt scopes from claims
......@@ -54,7 +58,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.3...HEAD
[Unreleased]: https://gitlab.nsd.no/clojure/clj-jwt/compare/v0.4.4...HEAD
[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
[v0.4.2]: https://gitlab.nsd.no/clojure/clj-jwt/compare/v0.4.1...v0.4.2
[v0.4.1]: https://gitlab.nsd.no/clojure/clj-jwt/compare/v0.4.0...v0.4.1
......
......@@ -5,7 +5,7 @@
A Clojure library to handle validation of JWTs and signing claims using JSON Web Keys.
```clojure
[no.nsd/clj-jwt "0.4.3"]
[no.nsd/clj-jwt "0.4.4"]
```
clj-jwt wraps some of [Buddy's](https://funcool.github.io/buddy-sign/latest/) functions for validating JWTs and signing claims.
......
(defproject no.nsd/clj-jwt "0.4.3"
(defproject no.nsd/clj-jwt "0.4.4"
: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"
......
......@@ -77,6 +77,9 @@ vLu9XxKFHYlWPccluz3pqDfaGNPO12968DAldwvAV6hTGgx7oMaNPu0UltgD/aaj
(is (= #{} (->> (buddy-jwt/sign {:sub "jalla" :scope ""} ec-privkey {:alg :rs256 :header {:kid "test-key"}})
(clj-jwt/unsign (resource "jwks.json"))
(clj-jwt/scopes))))
(is (= #{} (->> (buddy-jwt/sign {:sub "jalla" :scope " "} ec-privkey {:alg :rs256 :header {:kid "test-key"}})
(clj-jwt/unsign (resource "jwks.json"))
(clj-jwt/scopes))))
(is (= #{} (->> (buddy-jwt/sign {:sub "jalla"} ec-privkey {:alg :rs256 :header {:kid "test-key"}})
(clj-jwt/unsign (resource "jwks.json"))
(clj-jwt/scopes)))))
......
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