Skip to content

Commit d79298a

Browse files
authored
Merge pull request #249 from ikappaki/feat/proxy-auth-simple2
Add basic proxy authentication support via HTTP[S]_PROXY
2 parents 3849344 + 9ba6cb5 commit d79298a

30 files changed

+2020
-103
lines changed

.github/workflows/test.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
strategy:
2525
fail-fast: false
2626
matrix:
27-
os: [ubuntu-22.04]
27+
os: [ubuntu-24.04]
2828
jdk: [24]
2929
include:
3030
- os: windows-latest
@@ -49,12 +49,13 @@ jobs:
4949

5050
- name: Run tests
5151
run: bb test
52+
5253
jvm-integration-test:
5354
runs-on: ${{matrix.os}}
5455
strategy:
5556
fail-fast: false
5657
matrix:
57-
os: [ubuntu-22.04]
58+
os: [ubuntu-24.04]
5859
jdk: [24]
5960
include:
6061
- os: windows-latest
@@ -84,14 +85,16 @@ jobs:
8485
# AccessDeniedException exception when renaming temp files
8586
# while downloading dependencies. Workaround: offload some
8687
# of the deps download to the clojure CLI tool.
88+
#
89+
# See https://clojure.atlassian.net/browse/TBUILD-47
8790
clojure -P
8891
bb prod-cli
8992
9093
- name: Run integration tests
9194
run: bb integration-test
9295

9396
graalvm-build:
94-
runs-on: ubuntu-22.04
97+
runs-on: ubuntu-24.04
9598
strategy:
9699
fail-fast: false
97100
steps:
@@ -130,7 +133,7 @@ jobs:
130133

131134
graalvm-integration-test:
132135
needs: graalvm-build
133-
runs-on: ubuntu-22.04
136+
runs-on: ubuntu-24.04
134137
strategy:
135138
fail-fast: false
136139
steps:
@@ -148,6 +151,11 @@ jobs:
148151
cli: '1.12.0.1530'
149152
bb: '1.12.200'
150153

154+
- name: Install tinyproxy
155+
run: |
156+
sudo apt-get update -y -qq
157+
sudo apt-get install -y -qq tinyproxy
158+
151159
- uses: actions/download-artifact@v4
152160
name: eca-native
153161

@@ -156,8 +164,8 @@ jobs:
156164
cp -rf eca-native/eca eca
157165
chmod +x eca
158166
159-
- name: Run integration tests
160-
run: bb integration-test
167+
- name: Run integration tests (via proxy)
168+
run: bb integration-test --proxy
161169

162170
nix-build:
163171
needs: unit-test

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@ docs/README.md
3636
docs/CHANGELOG.md
3737
docs/images/
3838

39-
integration-test/stderr.txt
39+
/integration-test/out/
4040
reachability-metadata.json

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Unreleased
44

55
- Support http MCP servers that require oauth. #51
6+
- Add basic username/password proxy authentication support and recognize lowercase http[s]_proxy env var alongside HTTP[S]_PROXY. #248
67

78
## 0.88.0
89

bb.edn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
tag make/tag
1818
get-last-changelog-entry make/get-last-changelog-entry
19+
;; run with -h to see the available options
1920
integration-test make/integration-test
2021

2122
local-webpage make/local-webpage}}

deps-lock.json

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,26 @@
292292
"mvn-repo": "https://repo1.maven.org/maven2/",
293293
"hash": "sha256-K3q8dApBM5bzLK6nQPIYevjHqnKDN+E7THIyf0bhD3o="
294294
},
295+
{
296+
"mvn-path": "com/barchart/base/barchart-archon/2.5.10/barchart-archon-2.5.10.pom",
297+
"mvn-repo": "https://repo1.maven.org/maven2/",
298+
"hash": "sha256-ttNvNLKQMA1wTtCZlFYJd7VR6JFI2MdOGHlMpPGccvg="
299+
},
300+
{
301+
"mvn-path": "com/barchart/udt/barchart-udt-archon/2.3.0/barchart-udt-archon-2.3.0.pom",
302+
"mvn-repo": "https://repo1.maven.org/maven2/",
303+
"hash": "sha256-pYvFwljO3N6hn60O9/6o7QWcNuGOmYzk3U2PIB7v8TE="
304+
},
305+
{
306+
"mvn-path": "com/barchart/udt/barchart-udt-bundle/2.3.0/barchart-udt-bundle-2.3.0.jar",
307+
"mvn-repo": "https://repo1.maven.org/maven2/",
308+
"hash": "sha256-5/xl5m09UQOkrMgQ1HFcUHU1GzLGwvXe/UPFSYlhE60="
309+
},
310+
{
311+
"mvn-path": "com/barchart/udt/barchart-udt-bundle/2.3.0/barchart-udt-bundle-2.3.0.pom",
312+
"mvn-repo": "https://repo1.maven.org/maven2/",
313+
"hash": "sha256-/l5UPQXp1ogQxax0tEMr7MwiKyYSt73bMCaY/O82vUw="
314+
},
295315
{
296316
"mvn-path": "com/cognitect/aws/api/0.8.723/api-0.8.723.jar",
297317
"mvn-repo": "https://repo1.maven.org/maven2/",
@@ -767,6 +787,21 @@
767787
"mvn-repo": "https://repo1.maven.org/maven2/",
768788
"hash": "sha256-4J00XnPKP7yn8+BfMN63Tp053Wt5qT/ujFEfI0F7aCg="
769789
},
790+
{
791+
"mvn-path": "com/google/guava/guava-parent/20.0/guava-parent-20.0.pom",
792+
"mvn-repo": "https://repo1.maven.org/maven2/",
793+
"hash": "sha256-8SJv0H/HKvjWIyvfpwvzHYg6GgHLxUfyOnTpBmxpLfE="
794+
},
795+
{
796+
"mvn-path": "com/google/guava/guava/20.0/guava-20.0.jar",
797+
"mvn-repo": "https://repo1.maven.org/maven2/",
798+
"hash": "sha256-NqZm47ca5/Dw3KI2VLZ+CG5sk9GS9gul39VRnbbCiMg="
799+
},
800+
{
801+
"mvn-path": "com/google/guava/guava/20.0/guava-20.0.pom",
802+
"mvn-repo": "https://repo1.maven.org/maven2/",
803+
"hash": "sha256-NjzIN2e3YNelZNUwHglGfm1I/BwcFmSx4YxQgVzhkHY="
804+
},
770805
{
771806
"mvn-path": "com/google/inject/guice-parent/4.2.2/guice-parent-4.2.2.pom",
772807
"mvn-repo": "https://repo1.maven.org/maven2/",
@@ -1157,6 +1192,16 @@
11571192
"mvn-repo": "https://repo1.maven.org/maven2/",
11581193
"hash": "sha256-A0+cuKcLwC7X/0DCTkyNXaNXCedXic5/Q5/m4ipb/h0="
11591194
},
1195+
{
1196+
"mvn-path": "io/netty/netty-all/4.0.44.Final/netty-all-4.0.44.Final.jar",
1197+
"mvn-repo": "https://repo1.maven.org/maven2/",
1198+
"hash": "sha256-jCvFNQVsv2b5ZWucTpLbjSoXMlKCNGMc7oC8J7yR8hg="
1199+
},
1200+
{
1201+
"mvn-path": "io/netty/netty-all/4.0.44.Final/netty-all-4.0.44.Final.pom",
1202+
"mvn-repo": "https://repo1.maven.org/maven2/",
1203+
"hash": "sha256-/ZZHTGaIw7m2gboN8KEzeT7DZn/7k8TGrmnrmZAZV8w="
1204+
},
11601205
{
11611206
"mvn-path": "io/netty/netty-bom/4.2.0.Final/netty-bom-4.2.0.Final.pom",
11621207
"mvn-repo": "https://repo1.maven.org/maven2/",
@@ -1182,6 +1227,11 @@
11821227
"mvn-repo": "https://repo1.maven.org/maven2/",
11831228
"hash": "sha256-YBEweqaNRjZ99sUyr7NiemOh+krBYgPhnrFQWoDfOvo="
11841229
},
1230+
{
1231+
"mvn-path": "io/netty/netty-parent/4.0.44.Final/netty-parent-4.0.44.Final.pom",
1232+
"mvn-repo": "https://repo1.maven.org/maven2/",
1233+
"hash": "sha256-Zc9FQCl5Hav9RaeRz+Zf2ge0bkbV2sVx/DcsmNImTSU="
1234+
},
11851235
{
11861236
"mvn-path": "io/netty/netty-parent/4.1.30.Final/netty-parent-4.1.30.Final.pom",
11871237
"mvn-repo": "https://repo1.maven.org/maven2/",
@@ -1712,6 +1762,16 @@
17121762
"mvn-repo": "https://repo1.maven.org/maven2/",
17131763
"hash": "sha256-gtMfHcxFg+/9dE6XkWWxbaZL+GvKYj/F0bA+2U9FyFo="
17141764
},
1765+
{
1766+
"mvn-path": "org/apache/commons/commons-lang3/3.5/commons-lang3-3.5.jar",
1767+
"mvn-repo": "https://repo1.maven.org/maven2/",
1768+
"hash": "sha256-islvxoZRLXd/yoXhRPGWzXz+DArsIxJyKUl9Gjj/ZRw="
1769+
},
1770+
{
1771+
"mvn-path": "org/apache/commons/commons-lang3/3.5/commons-lang3-3.5.pom",
1772+
"mvn-repo": "https://repo1.maven.org/maven2/",
1773+
"hash": "sha256-Ref7ssIx25A6XVqtr8Y2oXOk1UVg94oR/0mAKO+eNF4="
1774+
},
17151775
{
17161776
"mvn-path": "org/apache/commons/commons-lang3/3.8.1/commons-lang3-3.8.1.pom",
17171777
"mvn-repo": "https://repo1.maven.org/maven2/",
@@ -1727,6 +1787,11 @@
17271787
"mvn-repo": "https://repo1.maven.org/maven2/",
17281788
"hash": "sha256-Oi5p0G1kHR87KTEm3J4uTqZWO/jDbIfgq2+kKS0Et5w="
17291789
},
1790+
{
1791+
"mvn-path": "org/apache/commons/commons-parent/41/commons-parent-41.pom",
1792+
"mvn-repo": "https://repo1.maven.org/maven2/",
1793+
"hash": "sha256-sod8gBb4sokkyOkN1a5AzRHzKNAqHemNgN4iV0qzbsc="
1794+
},
17301795
{
17311796
"mvn-path": "org/apache/commons/commons-parent/42/commons-parent-42.pom",
17321797
"mvn-repo": "https://repo1.maven.org/maven2/",
@@ -3207,6 +3272,16 @@
32073272
"mvn-repo": "https://repo1.maven.org/maven2/",
32083273
"hash": "sha256-C5sUo9YhBvr+jGinF7h7h60YaFiZRRt1PAT6QbaFd4Q="
32093274
},
3275+
{
3276+
"mvn-path": "org/littleshoot/littleproxy/1.1.2/littleproxy-1.1.2.jar",
3277+
"mvn-repo": "https://repo1.maven.org/maven2/",
3278+
"hash": "sha256-eWS9BW4UF5212m9Qv6j2AkGTVxrECCA0wTq/osNDWg8="
3279+
},
3280+
{
3281+
"mvn-path": "org/littleshoot/littleproxy/1.1.2/littleproxy-1.1.2.pom",
3282+
"mvn-repo": "https://repo1.maven.org/maven2/",
3283+
"hash": "sha256-PADML6MSw6aEKjeZR2JdEc0APvP6HimHnq/3lV5bk/I="
3284+
},
32103285
{
32113286
"mvn-path": "org/msgpack/msgpack/0.6.12/msgpack-0.6.12.jar",
32123287
"mvn-repo": "https://repo1.maven.org/maven2/",
@@ -3297,6 +3372,11 @@
32973372
"mvn-repo": "https://repo1.maven.org/maven2/",
32983373
"hash": "sha256-7WHEYf3Yy2lBLALnF28b953DPxKNXuuY9198rdT/fEM="
32993374
},
3375+
{
3376+
"mvn-path": "org/slf4j/slf4j-api/1.7.24/slf4j-api-1.7.24.pom",
3377+
"mvn-repo": "https://repo1.maven.org/maven2/",
3378+
"hash": "sha256-16FSZtIvrcHIG7w7YmN4AdEW5ITrbIMSF9w2xTe+SNI="
3379+
},
33003380
{
33013381
"mvn-path": "org/slf4j/slf4j-api/1.7.36/slf4j-api-1.7.36.pom",
33023382
"mvn-repo": "https://repo1.maven.org/maven2/",
@@ -3357,6 +3437,11 @@
33573437
"mvn-repo": "https://repo1.maven.org/maven2/",
33583438
"hash": "sha256-3qe7VIVu9pOIkiqtCiU4qfNd8nk/iUF5S8smUYp0CK8="
33593439
},
3440+
{
3441+
"mvn-path": "org/slf4j/slf4j-parent/1.7.24/slf4j-parent-1.7.24.pom",
3442+
"mvn-repo": "https://repo1.maven.org/maven2/",
3443+
"hash": "sha256-NjZ9EnpYbVArYL9U2y1zl+yUVzYg7/Ujhz7BKhLlSDk="
3444+
},
33603445
{
33613446
"mvn-path": "org/slf4j/slf4j-parent/1.7.36/slf4j-parent-1.7.36.pom",
33623447
"mvn-repo": "https://repo1.maven.org/maven2/",

deps.edn

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,22 @@
2424
:aliases
2525
{:dev {:extra-paths ["dev"]
2626
:extra-deps {cider/cider-nrepl {:mvn/version "0.53.2"}
27-
nrepl/nrepl {:mvn/version "1.3.0"}}}
27+
nrepl/nrepl {:mvn/version "1.3.0"}}
28+
;; Properties useful for low-level debugging
29+
;; :jvm-opts ["-Djdk.httpclient.HttpClient.log=headers,errors"
30+
;; "-Dclojure.storm.instrumentOnlyPrefixes=eca,hato"
31+
;; "-Dflowstorm.startRecording=true"]
32+
}
33+
2834
:test {:extra-deps {lambdaisland/kaocha {:mvn/version "1.91.1392"}
2935
org.clojure/test.check {:mvn/version "1.1.1"}
3036
nubank/matcher-combinators {:mvn/version "3.9.1"}
31-
http-kit/http-kit {:mvn/version "2.8.0"}}
32-
:jvm-opts ["-XX:-OmitStackTraceInFastThrow"]
37+
http-kit/http-kit {:mvn/version "2.8.0"}
38+
org.littleshoot/littleproxy {:mvn/version "1.1.2"}}
39+
:jvm-opts ["-XX:-OmitStackTraceInFastThrow"
40+
;; required for channeling https requirests via http
41+
;; proxy with basic authentication scheme.
42+
"-Djdk.http.auth.tunneling.disabledSchemes="]
3343
:extra-paths ["test"]
3444
:main-opts ["-m" "kaocha.runner"]}
3545
:build {:extra-paths ["resources"]
@@ -43,4 +53,4 @@
4353
"-Dborkdude.dynaload.aot=true"
4454
"-Dclojure.compiler.direct-linking=true"
4555
"-Dclojure.spec.skip-macros=true"]
46-
:extra-deps {com.github.clj-easy/graal-build-time {:mvn/version "1.0.5"}}}}}
56+
:extra-deps {com.github.clj-easy/graal-build-time {:mvn/version "1.0.5"}}}}}

docs/configuration.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,19 @@ It's possible to retrieve content of any configs with a string value using the `
5757
- `classpath`: `${classpath:path/to/eca/file}` to get a file content from [ECA's classpath](https://github.com/editor-code-assistant/eca/tree/master/resources)
5858
- `netrc`: Support Unix RC [credential files](./models.md#credential-file-authentication)
5959

60+
## Proxy Configuration
61+
62+
ECA supports proxies with basic cleartext authentication via the de-facto env vars:
63+
64+
```bash
65+
HTTP_PROXY="http://user:pass@host:port"
66+
HTTPS_PROXY="http://user:pass@host:port"
67+
http_proxy="http://user:pass@host:port"
68+
https_proxy="http://user:pass@host:port"
69+
```
70+
71+
Lowercase var wins if both are set. Credentials (if used) must match for HTTP and HTTPS.
72+
6073
## Providers / Models
6174

6275
For providers and models configuration check the [dedicated models section](./models.md#custom-providers).

flake.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
clojure
4141
clojure-lsp
4242
git
43+
tinyproxy
4344
];
4445

4546
env = {

0 commit comments

Comments
 (0)