baton-proxy 0.7.3__tar.gz → 0.7.4__tar.gz

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.
Files changed (60) hide show
  1. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/CHANGELOG.md +7 -0
  2. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/PKG-INFO +1 -1
  3. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/src/baton_proxy/__init__.py +1 -1
  4. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/src/baton_proxy/wrap.py +4 -2
  5. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/tests/test_wrap_cmd.py +30 -10
  6. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/try/kit.py +1 -1
  7. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/.claude/settings.json +0 -0
  8. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/.github/workflows/release.yml +0 -0
  9. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/.github/workflows/test.yml +0 -0
  10. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/.gitignore +0 -0
  11. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/.gitmodules +0 -0
  12. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/CLAUDE.md +0 -0
  13. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/LICENSE +0 -0
  14. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/Makefile +0 -0
  15. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/README.md +0 -0
  16. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/SECURITY.md +0 -0
  17. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/examples/live-claude-invocation/instructions.md +0 -0
  18. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/examples/live-claude-invocation/result.md +0 -0
  19. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/examples/live-claude-invocation/setup.sh +0 -0
  20. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/examples/live-claude-invocation/unregister.sh +0 -0
  21. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/pyproject.toml +0 -0
  22. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/src/baton_proxy/__main__.py +0 -0
  23. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/src/baton_proxy/_llm_text.py +0 -0
  24. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/src/baton_proxy/config.py +0 -0
  25. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/src/baton_proxy/emitter.py +0 -0
  26. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/src/baton_proxy/identity.py +0 -0
  27. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/src/baton_proxy/mcp_error.py +0 -0
  28. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/src/baton_proxy/proxy.py +0 -0
  29. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/src/baton_proxy/scrub.py +0 -0
  30. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/src/baton_proxy/sinks.py +0 -0
  31. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/src/baton_proxy/transport_http.py +0 -0
  32. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/tests/__init__.py +0 -0
  33. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/tests/fixture_http_server.py +0 -0
  34. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/tests/fixture_responses.py +0 -0
  35. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/tests/fixture_server.py +0 -0
  36. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/tests/test_a1_emit_e2e.py +0 -0
  37. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/tests/test_a1_proxy.py +0 -0
  38. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/tests/test_config.py +0 -0
  39. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/tests/test_emitter.py +0 -0
  40. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/tests/test_http_bridge.py +0 -0
  41. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/tests/test_identity.py +0 -0
  42. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/tests/test_injection.py +0 -0
  43. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/tests/test_intent_param.py +0 -0
  44. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/tests/test_iserror_reclassification.py +0 -0
  45. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/tests/test_llm_text.py +0 -0
  46. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/tests/test_pending_eviction.py +0 -0
  47. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/tests/test_proxy_env.py +0 -0
  48. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/tests/test_residency_sinks.py +0 -0
  49. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/tests/test_scrub.py +0 -0
  50. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/tests/test_sinks.py +0 -0
  51. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/tests/test_spec_conformance.py +0 -0
  52. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/tests/test_surface_snapshot.py +0 -0
  53. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/tests/test_tool_list_events.py +0 -0
  54. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/tests/test_tooling.py +0 -0
  55. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/tests/test_try_kit.py +0 -0
  56. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/try/.gitignore +0 -0
  57. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/try/CLAUDE.md +0 -0
  58. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/try/PROMPT.md +0 -0
  59. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/try/SECURITY.md +0 -0
  60. {baton_proxy-0.7.3 → baton_proxy-0.7.4}/uv.lock +0 -0
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/).
7
7
 
8
+ ## [0.7.4] — 2026-11-16
9
+
10
+ ### Fixed
11
+
12
+ - **`wrap --dsn` accepts a test key (`baton_tk_`),** and never repeats one in an error, as for `baton_pk_` and `baton_sk_` keys. It used to refuse a DSN carrying one.
13
+ - **An older key with no type letters (`baton_` and 43 characters) is never repeated in an error.** These keys were issued before `baton_pk_` and `baton_sk_`. `wrap --dsn` still refuses a DSN carrying one, as before.
14
+
8
15
  ## [0.7.3] — 2026-11-09
9
16
 
10
17
  ### Added
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: baton-proxy
3
- Version: 0.7.3
3
+ Version: 0.7.4
4
4
  Summary: MCP proxy that wraps a stdio server or bridges to a remote one, injects an annotation tool, and emits friction events.
5
5
  Author: Good Timing, Inc.
6
6
  License: Apache License
@@ -7,7 +7,7 @@ handshake, and emits friction events to a collector.
7
7
  See README.md for usage.
8
8
  """
9
9
 
10
- __version__ = "0.7.3"
10
+ __version__ = "0.7.4"
11
11
 
12
12
  # The product/version token, single-sourced here so the emitter's `sdk_version`
13
13
  # field and the HTTP bridge's outbound `User-Agent` header can never drift.
@@ -24,9 +24,11 @@ _SHOWN_ENV = frozenset({"BATON_EVENT_SINK", "BATON_TENANT_ID", "BATON_VENDOR_ID"
24
24
  _VAR_REF = re.compile(r"^\$\{[^}]*\}$")
25
25
  # http keys that carry auth the proxy cannot: dropping them would lose it silently.
26
26
  _UNCARRIED_AUTH = ("headersHelper", "oauth")
27
- _KEY = r"baton_(?:pk|sk)_[A-Za-z0-9_%-]"
27
+ _TAIL = r"[A-Za-z0-9_%-]"
28
+ _KEY = r"baton_(?:pk|sk|tk)_" + _TAIL
28
29
  _DSN_KEY = re.compile(_KEY + "{8,}")
29
- _KEY_IN_TEXT = re.compile(_KEY + "+")
30
+ # An older key has no type letters. It is hidden here, but a DSN still needs a typed key.
31
+ _KEY_IN_TEXT = re.compile(_KEY + "+|baton_" + _TAIL + "{43,}")
30
32
  _DSN_WORKSPACE = re.compile(r"ten_(?:[0-9a-fA-F]{8}|[0-9a-fA-F]{32})")
31
33
  _DSN_SERVER = re.compile(r"[a-zA-Z0-9_-]{1,48}")
32
34
  # No underscore in a host, so a key pasted into the host slot is refused, not printed as the sink.
@@ -247,22 +247,40 @@ def test_refusal_exits_1_and_leaves_the_file(cfg, capsys):
247
247
 
248
248
 
249
249
  KEY = "baton_pk_" + "A" * 43
250
+ TEST_KEY = "baton_tk_" + "E" * 43
251
+ OLD_KEY = "baton_" + "L" * 43
250
252
  DSN = f"https://{KEY}@baton.example.com/ten_0a1b2c3d/srv-1f2e3d4c"
251
253
 
252
254
 
253
- def test_dsn_writes_every_value_the_console_needs(cfg, capsys):
255
+ @pytest.mark.parametrize("key", [KEY, TEST_KEY], ids=["publishable", "test"])
256
+ def test_dsn_writes_every_value_the_console_needs(cfg, capsys, key):
254
257
  _write(cfg, {"mcpServers": {"fs": {"command": "npx"}}})
255
- assert run(cfg, "wrap", "fs", "--dsn", DSN) == 0
258
+ assert run(cfg, "wrap", "fs", "--dsn", DSN.replace(KEY, key)) == 0
256
259
  env = json.loads(cfg.read_text())["mcpServers"]["fs"]["env"]
257
260
  assert env == {
258
261
  "BATON_EVENT_SINK": "https://baton.example.com",
259
- "BATON_API_KEY": KEY,
262
+ "BATON_API_KEY": key,
260
263
  "BATON_TENANT_ID": "ten_0a1b2c3d",
261
264
  "BATON_VENDOR_ID": "srv-1f2e3d4c",
262
265
  "BATON_CONSENT_TOKEN": "customer-consented",
263
266
  }
264
267
  out = capsys.readouterr()
265
- assert KEY not in out.out + out.err
268
+ assert key not in out.out + out.err
269
+
270
+
271
+ @pytest.mark.parametrize("key", [KEY, TEST_KEY, OLD_KEY], ids=["publishable", "test", "old"])
272
+ def test_a_dsn_given_without_dsn_flag_is_not_echoed(cfg, capsys, key):
273
+ _write(cfg, {"mcpServers": {"fs": {"command": "npx"}}})
274
+ with pytest.raises(SystemExit):
275
+ run(cfg, "wrap", "fs", DSN.replace(KEY, key))
276
+ assert key not in capsys.readouterr().err
277
+
278
+
279
+ def test_a_dsn_with_an_untyped_key_is_refused_without_printing_it(cfg, capsys):
280
+ before = _write(cfg, {"mcpServers": {"fs": {"command": "npx"}}})
281
+ assert run(cfg, "wrap", "fs", "--dsn", DSN.replace(KEY, OLD_KEY)) == 1
282
+ assert cfg.read_text() == before
283
+ assert OLD_KEY not in capsys.readouterr().err
266
284
 
267
285
 
268
286
  def test_dsn_tolerates_doubled_slashes_and_a_port(cfg):
@@ -308,13 +326,14 @@ def test_the_dsn_is_the_only_way_to_name_a_console(cfg, flag):
308
326
  "",
309
327
  ],
310
328
  )
311
- def test_a_malformed_dsn_is_refused_without_printing_the_key(cfg, capsys, bad):
329
+ @pytest.mark.parametrize("key", [KEY, TEST_KEY], ids=["publishable", "test"])
330
+ def test_a_malformed_dsn_is_refused_without_printing_the_key(cfg, capsys, bad, key):
312
331
  before = _write(cfg, {"mcpServers": {"fs": {"command": "npx"}}})
313
- assert run(cfg, "wrap", "fs", "--dsn", bad) == 1
332
+ assert run(cfg, "wrap", "fs", "--dsn", bad.replace(KEY, key)) == 1
314
333
  assert cfg.read_text() == before
315
334
  err = capsys.readouterr().err
316
335
  assert "dsn" in err.lower()
317
- assert KEY not in err
336
+ assert key not in err
318
337
 
319
338
 
320
339
  def test_desktop_is_the_default_config_on_macos(home, monkeypatch):
@@ -563,12 +582,13 @@ def test_wrap_entry_refuses_an_env_that_is_not_strings(home, monkeypatch, capsys
563
582
  assert "env" in err
564
583
 
565
584
 
566
- def test_a_mistyped_flag_does_not_print_the_dsns_key(home, monkeypatch, capsys):
585
+ @pytest.mark.parametrize("key", [KEY, TEST_KEY, OLD_KEY], ids=["publishable", "test", "old"])
586
+ def test_a_mistyped_flag_does_not_print_the_dsns_key(home, monkeypatch, capsys, key):
567
587
  monkeypatch.setattr(wrap.sys, "stdin", io.StringIO(json.dumps({"command": "npx"})))
568
588
  with pytest.raises(SystemExit):
569
- proxy_main(["wrap-entry", "--dns", DSN])
589
+ proxy_main(["wrap-entry", "--dns", DSN.replace(KEY, key)])
570
590
  out = capsys.readouterr()
571
- assert KEY not in out.out + out.err
591
+ assert key not in out.out + out.err
572
592
 
573
593
 
574
594
  def test_a_typed_http_entry_comes_back_typed_stdio(home, monkeypatch, capsys):
@@ -163,7 +163,7 @@ SETUP_URL = "https://baton.goodtiming.ai/setup/proxy"
163
163
  # it equal to `baton_proxy.__version__`. Editing the paste breaks the hash;
164
164
  # re-pinning the hash without bumping the version breaks the pair. The release
165
165
  # then carries a version the console can be updated to and named by.
166
- PASTE_VERSION = "0.7.3"
166
+ PASTE_VERSION = "0.7.4"
167
167
  PASTE_SHA256 = "6e0dbeb917a2ad6bf66aa3cfde69b516664e484b14c6a163af23114e035ad659"
168
168
 
169
169
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes