File tree Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -125,6 +125,18 @@ implementations to the `nrepl.core/url-connect` multimethod for
125
125
tool that uses `url-connect` will use `ring-client-transport` for
126
126
connecting to HTTP and HTTPS nREPL endpoints.
127
127
128
+ ==== Configuration
129
+
130
+ The client supports additional HTTP headers, which is useful e.g. for
131
+ using Bearer authorization to connect to the endpoint. The headers can
132
+ be set in the nREPL configuration. For example, create `.nrepl.edn` in
133
+ the working directory with the contents:
134
+
135
+ [source,clojure]
136
+ ----
137
+ {:drawbridge {:http-headers {:Authorization "Bearer <JWT token>"}}}
138
+ ----
139
+
128
140
== TODO
129
141
130
142
The biggest outstanding issues are around the semantics of how HTTP
Original file line number Diff line number Diff line change 1
- (defproject nrepl /drawbridge " 0.2.0 "
1
+ (defproject nrepl /drawbridge " 0.2.1 "
2
2
:description " HTTP transport support for Clojure's nREPL implemented as a Ring handler."
3
3
:url " http://github.com/nrepl/drawbridge"
4
4
:license {:name " Eclipse Public License"
Original file line number Diff line number Diff line change 3
3
[cheshire.core :as json]
4
4
[clojure.java.io :as io]
5
5
[clj-http.client :as http]
6
+ [nrepl.config]
6
7
[nrepl.core :as nrepl]
7
8
[nrepl.transport :as transport])
8
9
(:import
9
10
(java.util.concurrent LinkedBlockingQueue TimeUnit)))
10
11
12
+ (def ^:private http-headers (get-in nrepl.config/config [:drawbridge :http-headers ]))
13
+
11
14
(defn ring-client-transport
12
15
" Returns an nREPL client-side transport to connect to HTTP nREPL
13
16
endpoints implemented by `ring-handler`.
33
36
url
34
37
(merge {:as :stream
35
38
:cookies @session-cookies}
36
- (when msg {:form-params msg})))]
39
+ (when msg {:form-params msg})
40
+ (when http-headers {:headers http-headers})))]
37
41
(swap! session-cookies merge cookies)
38
42
(fill body)))]
39
43
(transport/->FnTransport
You can’t perform that action at this time.
0 commit comments