GitLab oppdateres til siste versjon den 21.08.2019 ifra 08:00/08:30. Oppdatering estimert til å ta omtrent 20/30+ minutter.

Create library release 0.1.0

Signed-off-by: Snorre Magnus Davøen's avatarSnorre Magnus Davøen <snorre.davoen@nsd.no>
parent 622f7d8e
Pipeline #13788 passed with stage
in 29 seconds
# Change Log
All notable changes to this project will be documented in this file. This change log follows the conventions of [keepachangelog.com](http://keepachangelog.com/).
## [Unreleased]
### Changed
- Add a new arity to `make-widget-async` to provide a different widget shape.
## [0.1.1] - 2018-09-12
### Changed
- Documentation on how to make the widgets.
### Removed
- `make-widget-sync` - we're all async, all the time.
### Fixed
- Fixed widget maker to keep working when daylight savings switches over.
## 0.1.0 - 2018-09-12
## 0.1.0 - 2018-09-18
### Added
- Files from the new template.
- Widget maker public API - `make-widget-sync`.
- Initial implementation of clj-jwt library.
- 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://github.com/your-name/clj-jwt/compare/0.1.1...HEAD
[0.1.1]: https://github.com/your-name/clj-jwt/compare/0.1.0...0.1.1
[Unreleased]: https://gitlab.nsd.no/clojure/clj-jwt/compare/0.1.0...HEAD
......@@ -4,6 +4,10 @@
A Clojure library to handle validation of JWTs.
```clojure
[no.nsd/clj-jwt "0.1.0"]
```
The library exposes functions to handle validation of JSON web tokens. It wraps
some of [Buddy's](https://funcool.github.io/buddy-sign/latest/) jwt signature
handling functions and uses a JWKS endpoint to fetch the public keys to use for
......@@ -11,7 +15,28 @@ signature validation.
## Usage
TBD
You can use the `unsign` function which wraps buddy-sign's own unsign function:
```clojure
(require '[no.nsd.clj-jwt :as clj-jwt])
(clj-jwt/unsign "https://sso-stage.nsd.no/.well-known/jwks.json" "<your-token-here>")
```
Or you can use the `resolve-key` function with the jws backend from
buddy-auth:
```clojure
(require '[buddy.auth.backends :as backends])
(require '[no.nsd.clj-jwt :as clj-jwt])
(def auth-backend
(backends/jws {:secret (partial clj-jwt/resolve-key "https://sso-stage.nsd.no/.well-known/jwks.json")
:token-name "Bearer"
:authfn (fn [claims] claims)
:on-error (fn [request err] nil)
:options {:alg :rs256}}))
```
## License
......
(defproject no.nsd/clj-jwt "0.1.0-SNAPSHOT"
(defproject no.nsd/clj-jwt "0.1.0"
: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"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:middleware [lein-tools-deps.plugin/resolve-dependencies-with-deps-edn]
:plugins [[lein-tools-deps "0.4.1"]]
:lein-tools-deps/config {:config-files [:project]})
:lein-tools-deps/config {:config-files [:project]}
:repositories [["snapshots" {:url "https://nexus.nsd.no/repository/maven-snapshots/"
:creds :gpg}]
["releases" {:url "https://nexus.nsd.no/repository/maven-releases/"
:creds :gpg}]])
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