requests / requests-oauthlib

OAuthlib support for Python-Requests!
https://requests-oauthlib.readthedocs.org/
ISC License
1.71k stars 421 forks source link

Access tokens leaked in logs when using DEBUG level #536

Open erlendvollset opened 3 months ago

erlendvollset commented 3 months ago

Hi!

Request/response headers are currently being logged without any sanitizing being done upfront, which means that bearer tokens are logged. There are many scenarios in which we'd like to use DEBUG level, but still not log access tokens. Can we either redact the Authorization headers when logging, or add an option to disable logging of headers altogether.

I put up this suggested PR: https://github.com/requests/requests-oauthlib/pull/532