This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-02-22
Channels
- # aws-lambda (2)
- # beginners (195)
- # boot (47)
- # capetown (14)
- # cljs-dev (7)
- # cljsjs (1)
- # cljsrn (1)
- # clojure (103)
- # clojure-berlin (28)
- # clojure-dev (92)
- # clojure-dusseldorf (3)
- # clojure-finland (2)
- # clojure-germany (3)
- # clojure-italy (4)
- # clojure-russia (37)
- # clojure-spec (104)
- # clojure-uk (52)
- # clojured (2)
- # clojurescript (124)
- # community-development (7)
- # core-async (6)
- # cursive (41)
- # datomic (53)
- # dirac (2)
- # emacs (16)
- # hoplon (5)
- # jobs (3)
- # juxt (12)
- # lein-figwheel (6)
- # leiningen (15)
- # luminus (3)
- # off-topic (49)
- # om (5)
- # onyx (13)
- # overtone (27)
- # re-frame (7)
- # reagent (46)
- # ring (3)
- # ring-swagger (11)
- # spacemacs (2)
- # specter (40)
- # sql (6)
- # untangled (149)
- # vim (14)
hi, i’m having a weird problem with compojure-api I have a simple route/api def
(GET "/authenticated" []
:header-params [Authorization :- String]
:auth-rules authenticated?
:current-user user
(ok ))
I’m sending a test request via swagger with a value filled in for Authorization in the form. But I’m getting a 400 and
{
"errors": {
"Authorization": "missing-required-key"
}
}
in the body. The header (with a JWS) is going over, it gets properly processed by buddy, but compojure-api seems to think my request is malformed or something
curl -X GET --header 'Accept: application/json' --header 'Authorization: Token eyJhbGciOiJSU….
does auth-rules dissoc the request map prior to compojure-api destructuring for the header-params?
FYI, something I just ran into using cloverage and custom metadata handlers. Easy to get wrong I think: https://github.com/cloverage/cloverage/issues/164
the header-params got that resolved via github issue. Ring lower-cases all header-keys.
hello everyone, is there a way to enable route-specific middleware? or at least api specific?
@plins there is. here's an example of adding to a single endpoint: https://github.com/metosin/compojure-api/blob/master/examples/thingie/src/examples/thingie.clj#L194
and i think you can also use the :middleware
param in a (context ...
form to apply it to a set of endpoints