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
Fully Redact Password #138
Fully Redact Password #138
Conversation
…onnection string to keep password out of logs. also redacted in 2 other logging positions for when special characters in linux break current redacting
for more information, see https://pre-commit.ci
Codecov Report
@@ Coverage Diff @@
## master #138 +/- ##
==========================================
+ Coverage 94.02% 94.13% +0.10%
==========================================
Files 4 4
Lines 268 273 +5
==========================================
+ Hits 252 257 +5
Misses 16 16
|
This will fix issue #118 |
Thanks so much for the contribution! This looks good to merge, just one small request - are you able to also write a (small) unit test that verifies this? Something simple that creates a credentials object, and verifies that the logs redact it - I recommend using pytests's caplog fixture https://docs.pytest.org/en/7.1.x/how-to/logging.html |
Certainly, I will create the unit test for SqlCreds This will also have an impact on the to_sql function, but I am not aware of how to create a unit test for something that would be inserting into a database. |
@yehoshuadimarsky |
Merged, thank you for your contribution! |
In main.py
In utils.py
password
becomes'password'
and this line fails to redact the passwordThe solution in all cases: