open-in-editor-bridge 0.4.0 → 0.5.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eaaf6a230a717d29cee22bd54955b4602c9fef5779499808bdc8732b379de7fc
4
- data.tar.gz: 28e77df9eb6041a821ce65d784d30cb31cbd7a3a08c3e8f9e1695c8947a4d290
3
+ metadata.gz: f4c5a4d97eddd623771949a0d8f48010d3c246c3b54e42fc4d189d65186e0e10
4
+ data.tar.gz: 362dfa4623c2abcea425b112487c6810d4835e1d5905c753f5ccd65b77a5505f
5
5
  SHA512:
6
- metadata.gz: 23f9ee5e974031a4b05bfa1a47d15f85eac1748265e829879fcc322926062268f52503e08295d2b1d4d9034b93262662c336e079dcb3247800ba1214cea932af
7
- data.tar.gz: a441abf55c7ababc5061eaf7d9e8d2b5dec7497c623e478dd5fcd9f29f11919beaf9907c9d35f487a8f6a27bb8837a31b0c7d19949495f9dc14482ae960f84a8
6
+ metadata.gz: 12be17610397f8dfa726f0e0dd4f481116bcda2e7e5bb85e8e772a16b3e1997e27d6cb5092d20aa3b56e836fb0206b2f16b3bcf024af4479daab40cd899a5d91
7
+ data.tar.gz: 48a7c90292b04d7ba27dad224a14af34014cb4fad9b516757c718fb1eb79c33e2b0000f98881ad287339781ffb511c4dd29410a468f8d7d61143726ddecebece
data/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.5.0 — 2026-10-13
4
+
5
+ ### Changed
6
+
7
+ - The Docker Compose adapter defaults to `0.0.0.0` when no bind address is supplied, for both startup and teardown. Consumer wrappers no longer need the adapter's bind assignment.
8
+ - Explicit caller settings are preserved; Docker startup still rejects explicit loopback addresses. Selecting the default never mutates the caller's environment or process-global `ENV`.
9
+ - The retained Docker/Vite gate now exercises real editor invocation, concurrent checkout routing, and final cleanup with no bind override.
10
+
11
+ ### Security and Compatibility
12
+
13
+ - Selecting the Docker adapter now exposes the editor listener on all IPv4 interfaces by default. Use only on a trusted/firewalled development network, or explicitly choose a narrower Docker-reachable interface.
14
+ - Standalone CLI and low-level Ruby APIs retain the `127.0.0.1` default. Authentication, host-only control credentials, and lease behavior are unchanged.
15
+ - Clients sharing a broker must use the same bind address. An existing loopback broker is never widened; low-level CLI cleanup of a Docker registration requires its matching bind configuration.
16
+ - This is an intentional development-minor policy change, not an API freeze. Prefer `~> 0.5.0` for the tested release line.
17
+
3
18
  ## 0.4.0 — 2026-10-10
4
19
 
5
20
  ### Added
data/README.md CHANGED
@@ -5,7 +5,7 @@ A Ruby gem that runs a shared local HTTP bridge for opening container files in t
5
5
  ## Install
6
6
 
7
7
  ```ruby
8
- gem "open-in-editor-bridge", "~> 0.4.0"
8
+ gem "open-in-editor-bridge", "~> 0.5.0"
9
9
  ```
10
10
 
11
11
  ```sh
@@ -16,13 +16,13 @@ gem install open-in-editor-bridge
16
16
 
17
17
  Use the host-side Compose adapter and the gem's mounted Vite plugin. The library owns checkout identity transport, the host-gateway entry, and the editor proxy; **do not export a session variable or write a request rewrite**.
18
18
 
19
+ **Selecting the Docker adapter defaults the listener to `0.0.0.0` (all IPv4 interfaces), not just Docker. Use it only on a trusted development network with host firewall restrictions.** Set `OPEN_IN_EDITOR_BRIDGE_BIND_ADDRESS` to a narrower Docker-reachable host interface if needed. Explicit settings are preserved; explicit loopback startup is rejected. Standalone CLI and low-level Ruby use still default to `127.0.0.1`.
20
+
19
21
  Replace the development Compose startup/shutdown call:
20
22
 
21
23
  ```ruby
22
24
  require "open_in_editor_bridge"
23
25
 
24
- # Explicit network-exposure opt-in; use only on a trusted development network.
25
- ENV["OPEN_IN_EDITOR_BRIDGE_BIND_ADDRESS"] = "0.0.0.0"
26
26
  ENV["OPEN_IN_EDITOR_COMMAND"] = "code"
27
27
 
28
28
  OpenInEditorBridge.compose("up", service: "web")
@@ -54,7 +54,7 @@ Keep your application's existing plugins and other Vite settings. The variable-b
54
54
  - Select the Vite service (`service: "web"` by default); retain its image, command, source mounts, ports, and normal environment.
55
55
  - Select Compose files/project options when necessary, for example `compose_options: ["-f", "docker-compose.development.yaml", "-p", "my-checkout"]`. Pass subcommand options after `"up"` / `"down"`, not in `compose_options`.
56
56
  - Select checkout/container/host roots and the editor through the existing bridge configuration below. `project_root:` defaults to the current checkout; `env:` supplies bridge configuration and child-process environment overrides.
57
- - Explicitly select a Docker-reachable bind address. The adapter rejects loopback startup and never changes the default binding itself.
57
+ - Optionally select a narrower Docker-reachable bind address. Without an override, the adapter uses `0.0.0.0` for both startup and teardown without mutating `ENV` or the supplied environment.
58
58
 
59
59
  Compose itself resolves the original project configuration before the adapter adds its mounts: default file discovery, `.env` / `--env-file`, `COMPOSE_FILE` / `COMPOSE_PATH_SEPARATOR`, explicit multi-file inputs, project name, source-relative paths, interpolation, and active profiles remain Compose-owned. The adapter reuses Compose's canonical JSON model in a private host-only temporary file, preserving Compose's literal-dollar escaping instead of merging the original sources a second time. `compose_options` retains other global options, and the original subcommand arguments still select services. Compose runs in `project_root:` and inherits normal process input/output. Failures raise; successful commands return `true`.
60
60
 
@@ -66,9 +66,9 @@ All checkouts share the standard host port `3333`, bind address, and private run
66
66
 
67
67
  ### Adopting in ELCC
68
68
 
69
- After installing 0.4.0, ELCC can replace the editor lifecycle/Compose `up` and `down` path in `bin/dev` with `OpenInEditorBridge.compose`, passing its existing development/gateway `-f` options, project name, host user/group variables, and gateway hostname. Keep gateway lifecycle ownership and pipe-input handling for unrelated commands unchanged.
69
+ After installing 0.5.0, ELCC can replace the editor lifecycle/Compose `up` and `down` path in `bin/dev` with `OpenInEditorBridge.compose`, passing its existing development/gateway `-f` options, project name, host user/group variables, and gateway hostname. Keep gateway lifecycle ownership and pipe-input handling for unrelated commands unchanged.
70
70
 
71
- Remove the `OPEN_IN_EDITOR_SESSION_ID` export from `dynamic_environment_variables`, its web-service pass-through in `docker-compose.development.yaml`, and the handwritten `/__open-in-editor` target/rewrite in `web/vite.config.js`. Add the mounted plugin to the existing Vue/Vuetify/gateway plugin list under the development-only condition above. The adapter supplies the host-gateway entry, so an editor-only `extra_hosts` entry is no longer necessary. Keep the explicit trusted-network bind opt-in and existing root/editor settings. No consumer files are changed automatically.
71
+ Remove the `OPEN_IN_EDITOR_SESSION_ID` export from `dynamic_environment_variables`, its web-service pass-through in `docker-compose.development.yaml`, and the handwritten `/__open-in-editor` target/rewrite in `web/vite.config.js`. Add the mounted plugin to the existing Vue/Vuetify/gateway plugin list under the development-only condition above. The adapter supplies the host-gateway entry, so an editor-only `extra_hosts` entry is no longer necessary. The wrapper's `0.0.0.0` bind assignment is also unnecessary; keep any intentionally narrower interface and existing root/editor settings. No consumer files are changed automatically.
72
72
 
73
73
  ## Low-Level Ruby API
74
74
 
@@ -109,7 +109,7 @@ Custom integrations may use the same session protocol. With exactly one checkout
109
109
  | Variable | Default | Purpose |
110
110
  |---|---|---|
111
111
  | `OPEN_IN_EDITOR_BRIDGE_PORT` | `3333` | Shared host listener port |
112
- | `OPEN_IN_EDITOR_BRIDGE_BIND_ADDRESS` | `127.0.0.1` | Listener address; `0.0.0.0` allows Docker IPv4 access |
112
+ | `OPEN_IN_EDITOR_BRIDGE_BIND_ADDRESS` | Compose: `0.0.0.0`; standalone: `127.0.0.1` | Listener address; Docker's default exposes all IPv4 interfaces |
113
113
  | `OPEN_IN_EDITOR_PROJECT_ROOT` | Current directory | Checkout identity and default host mapping |
114
114
  | `OPEN_IN_EDITOR_CONTAINER_WEB_ROOT` | `/usr/src/web` | Container directory to translate |
115
115
  | `OPEN_IN_EDITOR_HOST_WEB_ROOT` | `<project-root>/web` | Corresponding host directory |
@@ -121,10 +121,12 @@ The editor command is required when registering a checkout, but not for `--sessi
121
121
 
122
122
  ## Security and Upgrade Notes
123
123
 
124
- Loopback binding is the default. `0.0.0.0` also exposes the listener to other reachable network peers, not only Docker. Use it only on a trusted development network with host firewall restrictions; a specific Docker-reachable host interface can narrow exposure. Editor requests are intentionally unauthenticated and health exposes checkout IDs: anyone who can reach the listener can invoke configured editors. Do not expose it on an untrusted network or forward it publicly.
124
+ Standalone CLI and low-level Ruby entrypoints default to loopback. **The Docker Compose adapter defaults to `0.0.0.0`, exposing the listener to other reachable network peers, not only Docker.** Use it only on a trusted development network with host firewall restrictions; an explicit Docker-reachable host interface can narrow exposure. Editor requests are intentionally unauthenticated and health exposes checkout IDs: anyone who can reach the listener can invoke configured editors. Do not expose it on an untrusted network or forward it publicly.
125
125
 
126
126
  Registration and release use nonce-bound HMAC signatures derived from a random control token held in the private host runtime directory; the token is never sent over HTTP. Clients authenticate health and control responses and verify broker protocol/PID against shared state. The broker rejects replayed control requests. Shutdown uses authenticated HTTP control, never signals a PID read from disk. Unknown listeners, old bridge versions, mismatched PIDs, and mismatched bind configurations are not reused.
127
127
 
128
+ All clients sharing a port/runtime directory must agree on the bind address. The Docker adapter never widens an existing loopback broker; release its sessions with their original configuration before switching. Prefer Compose `down` to release Docker registrations. If using the low-level CLI for Docker cleanup, explicitly supply the adapter's bind address (for example `OPEN_IN_EDITOR_BRIDGE_BIND_ADDRESS=0.0.0.0 open-in-editor-bridge --shutdown`), since standalone defaults remain loopback.
129
+
128
130
  A failed or timed-out health probe does not discard a still-listening broker's credentials. Lifecycle operations fail explicitly until its identity can be verified; retry after the listener becomes responsive.
129
131
 
130
132
  Version 0.2 replaces checkout-local PID/log files with shared runtime state. Stop any 0.1.x bridge using its original installed version before upgrading; it cannot share the new protocol. Sessions live in the broker's memory. After a broker crash or deliberate manual stop, rerun `--ensure-running` for detached applications. Abruptly killed foreground clients cannot execute `ensure`; stop that broker manually and re-register surviving checkouts if their leases become orphaned.
@@ -135,7 +137,7 @@ Supported entrypoints are the documented Ruby class methods `compose`, `with_run
135
137
 
136
138
  `Configuration`, `Client`, `Server`, `Docker`, raw lease methods, control-request signing, runtime file layout, generated Compose inputs, and proxy implementation details are internal, even where Ruby permits direct access. Do not build a consumer on those details or put control credentials in containers. HTTP error text, status-log wording, checkout-ID derivation details, and temporary filenames are not compatibility interfaces.
137
139
 
138
- This project follows [Semantic Versioning](https://semver.org/). **0.4.0 remains a development release, not a claim that the integration is frozen.** Use `~> 0.4.0` to stay within the tested minor release line; `~> 0.4` would permit future 0.x minor changes.
140
+ This project follows [Semantic Versioning](https://semver.org/). **0.5.0 remains a development release, not a claim that the integration is frozen.** Use `~> 0.5.0` to stay within the tested minor release line; `~> 0.5` would permit future 0.x minor changes. The Docker-only bind-default policy change is a minor release; standalone defaults and broker protocol are unchanged.
139
141
 
140
142
  **1.0 is a public-API compatibility commitment, not a feature-count milestone.** The Ruby lifecycle is already used by consumers, but the Compose/Vite path is recent and this cycle found configuration-selection and readiness-lifetime defects. Promotion should follow an explicit freeze of the supported API, platform/tool prerequisites, and upgrade policy after real consumer adoption confirms the integration shape and the retained installed-artifact gate passes. No additional feature backlog or arbitrary sequence through 0.5–0.9 is required; the next stable-contract release can go directly to 1.0.
141
143
 
@@ -163,18 +165,18 @@ Release changes on an issue-linked branch and pull request, including the versio
163
165
  bundle exec rake test:docker
164
166
  ```
165
167
 
166
- The opt-in gate creates isolated temporary Compose projects and requires host port 3333 to be free. It exercises two checkout mappings for each pinned Vite version, encoded paths/locations and hostile selectors, credential isolation, native configuration parity, readiness-based detached lifetime, foreground/error cleanup, ordinary commands, and production builds without editor mounts. It does not run as part of the fast `rake test` gate. Docker and npm registry access are required to prepare the Node/Vite fixture images; projects, leases, networks, and temporary directories are cleaned on exit. Images may be reused between QA runs.
168
+ The opt-in gate creates isolated temporary Compose projects and requires host port 3333 to be free. It exercises two checkout mappings for each pinned Vite version with no bind override, observes the Docker default, and records real editor invocations. It also covers encoded paths/locations and hostile selectors, credential isolation, native configuration parity, readiness-based detached lifetime, foreground/error cleanup, ordinary commands, and production builds without editor mounts. It does not run as part of the fast `rake test` gate. Docker and npm registry access are required to prepare the Node/Vite fixture images; projects, leases, networks, and temporary directories are cleaned on exit. Images may be reused between QA runs.
167
169
 
168
170
  To repeat it against the released gem while retaining the checkout's test tooling:
169
171
 
170
172
  ```sh
171
173
  release_home="$(mktemp -d)"
172
174
  GEM_HOME="$release_home" GEM_PATH="$release_home" \
173
- gem install open-in-editor-bridge --version 0.4.0 \
175
+ gem install open-in-editor-bridge --version 0.5.0 \
174
176
  --clear-sources --source https://rubygems.org --no-document
175
177
  GEM_HOME="$release_home" GEM_PATH="$release_home" \
176
178
  ruby -ropen_in_editor_bridge -e 'puts OpenInEditorBridge::VERSION'
177
- OPEN_IN_EDITOR_BRIDGE_TEST_LIB="$release_home/gems/open-in-editor-bridge-0.4.0/lib" \
179
+ OPEN_IN_EDITOR_BRIDGE_TEST_LIB="$release_home/gems/open-in-editor-bridge-0.5.0/lib" \
178
180
  bundle exec rake test:docker
179
181
  rm -rf "$release_home"
180
182
  ```
@@ -8,7 +8,8 @@ class OpenInEditorBridge
8
8
  CONTAINER_DIRECTORY = "/open-in-editor-bridge"
9
9
 
10
10
  def initialize(env:, project_root:, service:, compose_options:)
11
- @env = env.to_h
11
+ @env = env.to_h.dup
12
+ @env["OPEN_IN_EDITOR_BRIDGE_BIND_ADDRESS"] = @env.fetch("OPEN_IN_EDITOR_BRIDGE_BIND_ADDRESS", "0.0.0.0")
12
13
  @project_root = File.expand_path(project_root || @env.fetch("OPEN_IN_EDITOR_PROJECT_ROOT", Dir.pwd))
13
14
  @service = service
14
15
  @compose_options = compose_options
@@ -34,7 +35,7 @@ class OpenInEditorBridge
34
35
 
35
36
  def up(args)
36
37
  if %w[127.0.0.1 ::1 localhost].include?(configuration.bind_address)
37
- raise ArgumentError, "Docker editor access requires explicit OPEN_IN_EDITOR_BRIDGE_BIND_ADDRESS (for example 0.0.0.0 on a trusted network)."
38
+ raise ArgumentError, "Docker editor access requires a Docker-reachable OPEN_IN_EDITOR_BRIDGE_BIND_ADDRESS (for example 0.0.0.0 on a trusted network); loopback is not reachable from containers."
38
39
  end
39
40
  raise ArgumentError, "Select a Compose service for the Vite integration" if @service.to_s.empty?
40
41
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class OpenInEditorBridge
4
- VERSION = "0.4.0"
4
+ VERSION = "0.5.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: open-in-editor-bridge
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marlen Brunner
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-10-10 00:00:00.000000000 Z
11
+ date: 2026-10-13 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Ruby API and CLI for serving local open-in-editor requests during development.
14
14
  email: