Skip to content

Replace toxiproxy_rust with an in-repo Toxiproxy HTTP client - #98

Merged
makrisoft merged 1 commit into
mainfrom
ernie.am-4-replace-toxiproxy-rust-with-an-in-repo-toxi-thr_55kjsxa42f
Nov 6, 2026
Merged

makrisoft merged 1 commit into
mainfrom
ernie.am-4-replace-toxiproxy-rust-with-an-in-repo-toxi-thr_55kjsxa42f

Conversation

@makrisoft

Copy link
Copy Markdown
Contributor

TL;DR - What are you trying to accomplish?

Remove the toxiproxy_rust dev-dependency. It pulls in reqwest 0.11, which depends on the vulnerable h2 0.3 (RUSTSEC-2026-0258) and the unmaintained rustls-pemfile (RUSTSEC-2025-0134).

Details - How are you making this change? What are the effects of this change?

  • tests/support/toxiproxy.rs replaces toxiproxy_rust with a small Toxiproxy HTTP client: HTTP/1.0 over std::net::TcpStream, with serde_json bodies. The fixture and proxy methods keep their names. Stream names are now &str.
  • tests/support/toxiproxy.rs is the toxiproxy_rust half of Fix cargo audit findings #96 (32dcffb) with these changes:
    • with_down sends PATCH, because Toxiproxy 2.11.0 deprecates POST for proxy updates.
    • Transport errors name the request, for example PATCH /proxies/memcached failed: Connection refused (os error 61).
    • Proxy::listen is private. dsn() gives the address.
    • The apply doc comment says that the reset also enables the proxy.
    • It keeps the main comment above ToxicMemcached::new, which 32dcffb removed. The client still does blocking I/O.
  • A non-2xx Toxiproxy response now fails the test. toxiproxy_rust ignored HTTP errors, so a rejected toxic went unnoticed. For example, the slicer test passes without its toxic. toxiproxy_api_errors_fail_the_test covers this case and fails on main.
  • apply resets the fixture's own Toxiproxy process. The reset removes all toxics and enables the proxy. toxiproxy_rust only deleted the toxics.
  • No library code changes, so there are no benchmarks.
Fresh resolve main this PR
Cargo.lock packages 221 144
cargo audit RUSTSEC-2026-0258, RUSTSEC-2025-0134 no findings
cargo tree -i toxiproxy_rust / reqwest / hyper / h2 / rustls-pemfile present did not match any packages

./scripts/test-integration.sh passes with memcached 1.6.41 and Toxiproxy 2.11.0. All 12 resiliency tests pass.

@makrisoft
makrisoft requested a review from a team as a code owner November 6, 2026 10:44
@makrisoft makrisoft self-assigned this Nov 6, 2026
@makrisoft
makrisoft requested a review from mkcny November 6, 2026 11:00
toxiproxy_rust depends on reqwest 0.11, which pulls in the vulnerable
h2 0.3 (RUSTSEC-2026-0258) and the unmaintained rustls-pemfile
(RUSTSEC-2025-0134). toxiproxy_rust has been a dev-dependency since
0.8.1, so this change does not affect users of 0.8.1 or later.
Versions 0.5.0 to 0.8.0 list it as a normal dependency; their users
drop it by upgrading.

tests/support/toxiproxy.rs now sends Toxiproxy API requests itself:
HTTP/1.0 over std::net::TcpStream, with serde_json bodies. The fixture
and proxy methods keep their names. Stream names are now &str.

A non-2xx Toxiproxy response now fails the test. toxiproxy_rust
ignored HTTP errors, so a test could pass without its toxic.
toxiproxy_api_errors_fail_the_test covers this case.

with_down sends PATCH, because Toxiproxy 2.11.0 deprecates POST for
proxy updates. apply resets the fixture's own Toxiproxy process, which
removes all toxics and enables the proxy.
@makrisoft
makrisoft force-pushed the ernie.am-4-replace-toxiproxy-rust-with-an-in-repo-toxi-thr_55kjsxa42f branch from cd8d3c2 to 0ad0dc2 Compare November 6, 2026 11:03
@makrisoft
makrisoft merged commit ecc1e1a into main Nov 6, 2026
4 checks passed
@makrisoft
makrisoft deleted the ernie.am-4-replace-toxiproxy-rust-with-an-in-repo-toxi-thr_55kjsxa42f branch November 6, 2026 15:42
@makrisoft makrisoft mentioned this pull request Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants