gowalk-cicd 1.0.134 → 1.0.135

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CLAUDE.md CHANGED
@@ -142,6 +142,9 @@ node /path/to/gowalk-cicd/bin/cli.mjs
142
142
  and HTTPS_PROXY variables also name the credential-free loopback relay because
143
143
  Crashlytics Buildtools reads them first and rejects authenticated proxy URLs. HTTPS is tunneled
144
144
  without TLS interception; no upstream failure may fall back to the destination.
145
+ Java bypasses the relay only for exact `localhost`, `127.0.0.1` and `[::1]`
146
+ targets so owned HTTP test fixtures remain local. Never widen that host list;
147
+ external requests and environment-first clients retain the assigned relay.
145
148
  The wrapper disables Gradle daemons and closes its relay when the command ends.
146
149
  The relay's idle deadline covers the whole tunnel: traffic in either direction
147
150
  keeps downloads/uploads alive. An idle direction alone must never end a transfer.
package/README.md CHANGED
@@ -517,6 +517,10 @@ The relay authenticates to that exit without putting credentials in JVM options;
517
517
  HTTPS remains an end-to-end TLS tunnel. An unavailable proxy fails the request,
518
518
  and the relay shuts down with its child command. Gradle daemons are disabled for
519
519
  these commands so they cannot retain an expired relay port.
520
+ Java requests to exact `localhost`, `127.0.0.1` and `[::1]` targets stay local for
521
+ HTTP test fixtures. All other Java hosts, including lookalike names such as
522
+ `localhost.example.com`, retain the assigned proxy; environment-first clients
523
+ continue to use the relay.
520
524
 
521
525
  ### Private git dependencies (Flutter)
522
526
 
@@ -1 +1 @@
1
- 1.0.134
1
+ 1.0.135
@@ -1 +1 @@
1
- 1.0.134
1
+ 1.0.135
@@ -149,7 +149,7 @@ def running(proxy: str):
149
149
 
150
150
  def environment(env: dict, port: int) -> dict:
151
151
  # Crashlytics Buildtools prefers HTTP_PROXY to JVM options and rejects URLs
152
- # with userinfo. All child clients use the same owned relay; authentication
152
+ # with userinfo. External child requests use the same owned relay; authentication
153
153
  # is added only on its connection to the configured account exit.
154
154
  local = f"http://127.0.0.1:{port}"
155
155
  for name in ("HTTP_PROXY", "HTTPS_PROXY", "http_proxy", "https_proxy"):
@@ -157,7 +157,8 @@ def environment(env: dict, port: int) -> dict:
157
157
  env.update(NO_PROXY="", no_proxy="")
158
158
  options = (f"-Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort={port} "
159
159
  f"-Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort={port} "
160
- "-Dhttp.nonProxyHosts= -Dhttps.nonProxyHosts= -Djava.net.useSystemProxies=false")
160
+ "-Dhttp.nonProxyHosts=localhost|127.0.0.1|[::1] "
161
+ "-Dhttps.nonProxyHosts=localhost|127.0.0.1|[::1] -Djava.net.useSystemProxies=false")
161
162
  # Java prints these options at startup; they contain no proxy credentials.
162
163
  for name in ("JAVA_TOOL_OPTIONS", "JDK_JAVA_OPTIONS", "_JAVA_OPTIONS", "GRADLE_OPTS"):
163
164
  env[name] = (env.get(name, "") + " " + options).strip()
@@ -0,0 +1,91 @@
1
+ """Local HTTP fixtures stay local while every external Java request keeps the assigned relay."""
2
+ from contextlib import contextmanager
3
+ from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
4
+ import os
5
+ from pathlib import Path
6
+ import shutil
7
+ import socket
8
+ import subprocess
9
+ import tempfile
10
+ import threading
11
+ import unittest
12
+
13
+ import jvm_proxy_relay as relay
14
+ from test_jvm_proxy_relay import upstream
15
+
16
+
17
+ @contextmanager
18
+ def fixture(ipv6=False):
19
+ seen = []
20
+
21
+ class Handler(BaseHTTPRequestHandler):
22
+ def do_GET(self):
23
+ seen.append(self.path)
24
+ self.send_response(200)
25
+ self.end_headers()
26
+ self.wfile.write(b"owned local fixture")
27
+
28
+ def log_message(self, *_):
29
+ pass
30
+
31
+ class Server(ThreadingHTTPServer):
32
+ address_family = socket.AF_INET6 if ipv6 else socket.AF_INET
33
+
34
+ server = Server(("::1" if ipv6 else "127.0.0.1", 0), Handler)
35
+ thread = threading.Thread(target=server.serve_forever, daemon=True)
36
+ thread.start()
37
+ try:
38
+ yield server.server_port, seen
39
+ finally:
40
+ server.shutdown()
41
+ server.server_close()
42
+ thread.join(timeout=5)
43
+
44
+
45
+ def java_probe(port, urls):
46
+ source = '''import java.net.*;
47
+ public class Probe {
48
+ public static void main(String[] args) throws Exception {
49
+ for (var url : args) {
50
+ var connection = URI.create(url).toURL().openConnection();
51
+ connection.setConnectTimeout(3000); connection.setReadTimeout(3000);
52
+ System.out.println(new String(connection.getInputStream().readAllBytes()));
53
+ }
54
+ }
55
+ }'''
56
+ with tempfile.TemporaryDirectory() as directory:
57
+ path = Path(directory) / "Probe.java"
58
+ path.write_text(source)
59
+ env = relay.environment({**os.environ, "JAVA_TOOL_OPTIONS": "-Dhttp.nonProxyHosts=*"}, port)
60
+ return subprocess.run(["java", str(path), *urls], env=env, capture_output=True, text=True, timeout=20)
61
+
62
+
63
+ @unittest.skipUnless(shutil.which("java"), "Java runtime unavailable")
64
+ class LoopbackTests(unittest.TestCase):
65
+ def test_ipv4_and_localhost_fixtures_bypass_only_the_owned_relay(self):
66
+ with fixture() as (local, requests), upstream() as (proxy, seen), relay.running(proxy) as port:
67
+ result = java_probe(port, [f"http://127.0.0.1:{local}/literal", f"http://localhost:{local}/hostname",
68
+ "http://unresolvable.invalid/provider", "http://localhost.invalid/provider"])
69
+ self.assertEqual(result.returncode, 0, result.stderr)
70
+ self.assertEqual(result.stdout.splitlines(), ["owned local fixture", "owned local fixture",
71
+ "through pinned proxy", "through pinned proxy"])
72
+ self.assertEqual(requests, ["/literal", "/hostname"])
73
+ self.assertEqual([row[1] for row in seen], ["http://unresolvable.invalid/provider",
74
+ "http://localhost.invalid/provider"])
75
+ self.assertTrue(all(row[2].startswith("Basic ") for row in seen))
76
+ self.assertNotIn("fixture-pass", result.stderr)
77
+
78
+ def test_ipv6_loopback_fixture_remains_local(self):
79
+ try:
80
+ with fixture(ipv6=True) as (local, requests), upstream() as (proxy, seen), relay.running(proxy) as port:
81
+ result = java_probe(port, [f"http://[::1]:{local}/ipv6", "http://unresolvable.invalid/provider"])
82
+ except OSError as exc:
83
+ self.skipTest(f"IPv6 fixture unavailable: {exc.errno}")
84
+ self.assertEqual(result.returncode, 0, result.stderr)
85
+ self.assertEqual(result.stdout.splitlines(), ["owned local fixture", "through pinned proxy"])
86
+ self.assertEqual(requests, ["/ipv6"])
87
+ self.assertEqual([row[1] for row in seen], ["http://unresolvable.invalid/provider"])
88
+
89
+
90
+ if __name__ == "__main__":
91
+ unittest.main()
@@ -1 +1 @@
1
- 1.0.134
1
+ 1.0.135
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gowalk-cicd",
3
- "version": "1.0.134",
3
+ "version": "1.0.135",
4
4
  "description": "Zero-config GitHub Actions delivery for iOS TestFlight and Android Google Play.",
5
5
  "type": "module",
6
6
  "bin": {