Liking cljdoc? Tell your friends :D

ring-jwt

Duct/Integrant keys for wrapping the ring-jwt middleware.

Installation

[ovotech/duct.middleware.jwt "1.0.0"]

Usage

Both a duct module and, for more flexibility, an integrant key are provided. Both options take an option map that is the same as for ring-jwt itself.

As a duct module

The Duct module will configure the ring-jwt middleware AND will hook it into your :duct.handler/root. i.e.

{:duct.module/ring-jwt
  {:alg :HS256 :secret "somesecret"}} 

will merge in the following config to your Duct configuration:

{:duct.middleware/ring-jwt
 {:alg :HS256 :secret "somesecret"}
 
 :duct.handler/root
 {:middleware [(ig/ref :duct.middleware/ring-jwt)]}}

As an integrant key

{:duct.middleware/ring-jwt
  {:alg :HS256 :secret "somesecret"}

You will then need to hook it into a handler of your choice in your Duct configuration; e.g.:

{:duct.handler/root
 {:router     #ig/ref :duct.router/ataraxy
  :middleware [#ig/ref :duct.middleware/ring-jwt]}}

Can you improve this documentation?Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close