This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-11-12
Channels
- # announcements (1)
- # architecture (112)
- # asami (22)
- # babashka (74)
- # beginners (189)
- # chlorine-clover (4)
- # cider (105)
- # clj-kondo (21)
- # clojure (45)
- # clojure-australia (1)
- # clojure-europe (26)
- # clojure-losangeles (4)
- # clojure-nl (3)
- # clojure-spec (5)
- # clojure-uk (8)
- # clojurescript (16)
- # conjure (1)
- # cursive (29)
- # datascript (21)
- # datomic (35)
- # events (1)
- # fulcro (12)
- # graalvm (3)
- # graphql (31)
- # kaocha (13)
- # malli (14)
- # meander (3)
- # mount (3)
- # off-topic (73)
- # pathom (9)
- # pedestal (5)
- # portal (2)
- # re-frame (4)
- # reagent (8)
- # reitit (3)
- # rum (1)
- # shadow-cljs (26)
- # spacemacs (3)
- # sql (6)
{"Sec-WebSocket-Version" ["13"],
"Origin" [""],
"Sec-WebSocket-Extensions" ["permessage-deflate"],
"User-Agent"
["Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:82.0) Gecko/20100101 Firefox/82.0"],
"Accept-Encoding" ["gzip, deflate"],
"Cache-Control" ["no-cache"],
"Accept-Language" ["en-US,en;q=0.5"],
"Sec-WebSocket-Protocol" ["graphql-ws"],
"Connection" ["keep-alive, Upgrade"],
"Sec-WebSocket-Key" ["VrocNXrlymz9f3WWNd+Ifg=="],
"Upgrade" ["websocket"],
"Accept" ["*/*"],
"Pragma" ["no-cache"],
"Host" ["localhost:8000"]}
I configured graphiql to send an auth token, so that shouldn't be the issue (hopefully)
(if (config/non-production? config)
(set/union
#{["/api/v1/graphiql"
:get (lp/graphiql-ide-handler {:api-path "/api/v1/graphql"
:subscriptions-path "/api/v1/ws"
:ide-headers {"Authorization" "Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJqdGkiOiJjZjMxMjQwMDkxNmM0YmY5ODA4M2ExNTg4M2UzYjRhZiIsImV4cCI6MTYwNTI4MTE2Nn0.U8lKgjPl-NxWHMpCZwdUgQ6ceQsFtm8CQkpw4niMjEo"}}) ;; EDIT IN DEV
:route-name ::graphiql]}
(lp/graphiql-asset-routes "/assets/graphiql"))
#{}))))
Now i'm digging through old issues, but i'm still not there since the context def. does not have any request info
do you get anything when passing the same map to :ide-connection-params
rather than :ide-headers
? @emccue
😞 have you checked in ctx for the key :connection-params
or just headers?
right now my interceptors are looking for a :request and a "Authorization" in the request
(:query
:variables
:id
:shutdown-ch
:response-data-ch
:parsed-lacinia-query
:lacinia-app-context)
(:io.pedestal.interceptor.chain/terminators
:com.walmartlabs.lacinia.pedestal.subscriptions/values-chan-fn
:io.pedestal.interceptor.chain/queue)
(http/default-interceptors)
(update :io.pedestal.http/interceptors conj (interceptor/interceptor context-adder))
(update :io.pedestal.http/interceptors conj (interceptor/interceptor auth/user-from-jwt-interceptor))
I have this chain that adds an interceptor that should add the user to the request map of stuff
hmm, honestly I'm probably not going to be able to help much, I just remembered the connection-params things from the docs maybe in lacinia-app-context there will be the connection params
This https://github.com/walmartlabs/lacinia-pedestal/blob/master/src/com/walmartlabs/lacinia/pedestal/subscriptions.clj#L322 suggests to me that the map you get in looks something like
{:request {... the bit you posted}
:connection-params {the other stuff}}
since on context there it does both (get-in context [:request :lacinia-app-context])
and (:connection-params context)
basically I would say, wherever you are currently doing (get-in x [:request "Authorisation"])
in your interceptors just log out x
and see if it has anything that looks like your token