Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: support auto URLs in _sanitize_web3_url() helper func #1952

Merged
merged 1 commit into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/ape/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,8 @@ def _get_level(level: Optional[Union[str, int]] = None) -> str:


def sanitize_url(url: str) -> str:
"""Removes sensitive information from given URL"""

url_obj = URL(url).with_user(None).with_password(None)

# If there is a path, hide it but show that you are hiding it.
Expand Down
5 changes: 4 additions & 1 deletion src/ape_ethereum/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@


def _sanitize_web3_url(msg: str) -> str:
if "URI: " not in msg:
"""Sanitize RPC URI from given log string"""

# `auto` used by some providers to figure it out automatically
if "URI: " not in msg or "URI: auto" in msg:
return msg

parts = msg.split("URI: ")
Expand Down
Loading