Repository navigation
fix(rivetkit-client): keep the engine token out of gateway request errors - #5987
Open
atharvamhaske wants to merge 1 commit into
Open
atharvamhaske wants to merge 1 commit into
atharvamhaske wants to merge 1 commit into
Conversation
…rors A gateway request carries the engine token in its `rvt-token` query parameter, and `reqwest` quotes the request URL when a send fails. Any caller that logged the error logged the token. `send_request` now strips the URL from a failed send with `reqwest::Error::without_url`. Body read errors from `reqwest` carry no URL, and `connect_async` dial errors do not quote it either. Fixes rivet-dev#5985
abcxff
self-requested a review
November 12, 2026 03:25
Contributor
|
The changes look good; no high-confidence issues found.
No Copy prompt to fix all |
abcxff
approved these changes
Nov 12, 2026
abcxff
left a comment
Contributor
There was a problem hiding this comment.
Thanks! will work on upstreaming this and some of your other prs
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5985.
The Rust client puts the engine token in a gateway request's
rvt-tokenquery parameter (build_gateway_urlinremote_manager.rs). When the send fails,reqwestquotes the full request URL in its error, so the token ended up in any log or message that printed the error:send_requestnow callsreqwest::Error::without_urlon a failed send. The error keeps its cause (error sending request: client error (Connect): ...) but not the URL.Why only this call
reqwestattaches the URL only to errors raised while sending: connect failures, timeouts, redirects and builder errors. Errors from reading the body (bytes,text,json) carry no URL, so the response reads inhandle.rswere not leaking.send()calls inremote_manager.rsgo to/metadataand/actors. Those send the token in thex-rivet-tokenheader, and their URLs hold only the namespace, actor name, key and IDs.tokio-tungstenite'sconnect_asyncreports a failed dial as an I/O or HTTP error, without the URL. Only the blockingtungstenite::connect, which this client does not use, builds theUnable to connect to {url}error.Testing
rivetkit-rust/packages/client/tests/error_redaction.rsbuilds a client with a token against a closed local port, calls an action throughget_or_create, and checks that neither{:#}nor{:?}of the error contains the token. It fails onmainwith the output above and passes with this change.cargo test -p rivetkit-clientpasses.