Repository navigation
Conversation
2 tasks done
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.
Summary
Follow-up to #916, from the review there.
categorize_reqwest_errorbuiltProviderError::RequestErrorandProviderError::Otherfromerr.to_string(), and reqwest appends the full request URL to its messages (error sending request for url (...)). That text ends up in theerror = %efields on the retrywarnlines and in error reasons, so a key in the path or query of an RPC URL could still be logged on connection failures and HTTP errors. The URL inside the text is now replaced with itsmask_urlform. I did it on the text rather than witherr.without_url()becausecategorize_reqwest_errorand theFrom<&reqwest::Error>andeyredowncast paths only hold a reference, andwithout_urltakes the error by value. The host stays visible, which keeps the messages useful for telling providers apart.mask_urlnow hides userinfo:https://user:pass@host/pathbecomeshttps://***@host/***, andhttps://user:pass@hostbecomeshttps://***@host. An@later in the path is not treated as userinfo.Testing Process
services::provider::tests::test_categorize_reqwest_error_masks_url_in_message: a connection error tohttp://127.0.0.1:9/v2/SECRET_KEY_PATH?apikey=SECRET_KEY_QUERY. reqwest's own message contains the key; theProviderErrortext does not, and showshttp://127.0.0.1:9/***.services::provider::tests::test_categorize_reqwest_error_status_masks_url_in_message: the same for an HTTP 500 from mockito, which takes theRequestErrorpath.utils::url::tests: three new cases for userinfo with a path, without a path (with and without a port, and with a query), and one for an@in the path.categorize_reqwest_errortests fail.RUST_TEST_THREADS=1 cargo test --lib utils::: 630 passed, 29 ignored.services::provider: 247 passed.models::relayer(its RPC config responses usemask_url): 216 passed.cargo fmt --all -- --checkandcargo clippy --all-features --workspace --lib --bins --no-deps -- -D warnings --allow deprecatedare clean on 1.93.0.Checklist
Summary by CodeRabbit
@characters in the URL path.