Fork me on GitHub
#reitit
<
2019-09-18
>
ikitommi05:09:22

@jake142 using reitit-ring? you could recreate the ring- handler for each request (fn [] (ring/ring-handler ...)) so it gets fresh references for each run and the bindings should kick in.

ccann22:09:02

I’m trying to make a key :authorize required on all my routes. my middleware looks like:

{:name ::authorization
 :spec (s/keys :req-un [::authorize])
 :compile ...
and my ring router is configured:
:validate reitit.ring.spec/validate
            :spec (s/merge ::reitit.spec/default-data
                           (s/keys :opt-un [::description
                                            ::tags
                                            ::summary
                                            ::no-diffs
                                            ::middleware
                                            ::swagger]))
            :reitit.spec/wrap spell/closed

ccann22:09:23

but the router compiles when routes don’t specify :authorize

ccann22:09:34

does this only work with :wrap middleware?