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: better URL sanitization in ape-geth connection [APE-1233] #1568

Merged
merged 3 commits into from
Jul 27, 2023

Conversation

antazoey
Copy link
Member

@antazoey antazoey commented Jul 27, 2023

What I did

Noticed that if your URL contains API keys, they would not get sanitized properly.
I think the only way we can really do this in such a generic way to just always sanitize the path when they exist.

How I did it

Check if there is a path.
If there is, do with_path("") and put [hidden] at the end of the URL.
(I borrowed this from some AWS logs I happened to see).
Otherwise, keep as normal, so [hidden] is only appended when actually hiding the path.

How to verify it

This was my log before (except im not actually pasting my API key, but it was where apikeythatwasnotactuallyhidden is):

INFO: Starting 'Hardhat node' process.
INFO: Connecting to existing Geth node at  https://eth-mainnet.g.alchemy.com/v2/apikeythatwasnotactuallyhidden.

This is in it now, so the whole path is just [hidden] now.

INFO: Starting 'Hardhat node' process.
INFO: Connecting to existing Geth node at  https://eth-mainnet.g.alchemy.com/[hidden].

Checklist

  • All changes are completed
  • New test cases have been added
  • Documentation has been updated

@vany365 vany365 changed the title fix: better URL sanitization in ape-geth connection fix: better URL sanitization in ape-geth connection [APE-1233] Jul 27, 2023
@antazoey antazoey merged commit 97c1fac into ApeWorX:main Jul 27, 2023
15 checks passed
@antazoey antazoey deleted the fix/better-url-sanitize branch July 27, 2023 21:43
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.

2 participants