This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-02-20
Channels
- # aleph (19)
- # aws-lambda (8)
- # bangalore-clj (1)
- # beginners (13)
- # boot (179)
- # cljs-dev (12)
- # cljsjs (2)
- # cljsrn (6)
- # clojure (174)
- # clojure-italy (14)
- # clojure-nl (2)
- # clojure-russia (172)
- # clojure-spec (29)
- # clojure-uk (22)
- # clojurebridge (10)
- # clojureremote (1)
- # clojurescript (79)
- # cursive (46)
- # data-science (1)
- # datascript (8)
- # datomic (18)
- # defnpodcast (2)
- # emacs (9)
- # events (6)
- # hoplon (11)
- # klipse (13)
- # lein-figwheel (1)
- # leiningen (1)
- # luminus (1)
- # lumo (88)
- # numerical-computing (1)
- # off-topic (24)
- # om (33)
- # onyx (58)
- # protorepl (8)
- # re-frame (10)
- # reagent (26)
- # ring (8)
- # ring-swagger (7)
- # rum (22)
- # spacemacs (25)
- # specter (5)
- # uncomplicate (37)
- # untangled (75)
- # vim (17)
- # yada (3)
Follow-up to my body-params question earlier: where do body-params
get merged with the request? My dummied tests ran fine but I've discovered that using the Swagger UI causes a validation error.
@mrchance I use Buddy access rules, which pattern-match the request path. That could straightforwardly block unauth'd access to the entire API.
@daveliepmann Thanks for the reply, I ended up writing it myself since we already have all the rest of the infrastructure in place, but the solution is similar to how buddy seems to handle it
I suspect it is happening somewhere in the thicket of middleware, which I'd turned off for other reasons.
@mrchance hi, about the mw order. You could set your mw inside the api. with 1.2.0-alpha3
, there is the :mw
key in api, e.g. (api {:mw [my-auth-verifier]} …)
. It would not see coercion errors as they are thrown from handlers and caught my the api-middleware, so a 400 would be returned if the data was ill.
@daveliepmann to read the body-params, you should have some http-body-formatting library installed (which reads the body-stream and populates the body-params out of it). The api-middleware
uses Muuntaja to do this. If you disable the api-middleware, you have to put a formatting middleware into the mw-chain yourself. There is the https://github.com/ngrunwald/ring-middleware-format (used by pre 1.2.0) and https://github.com/metosin/muuntaja (1.2.0+).