#3203 Hide sensitive values in urrlib3 exceptions
Merged by tkopecek. Opened by tkopecek.
tkopecek/koji issue2801  into  master

Download 3203.patch

Fixes: https://pagure.io/koji/issue/2801

Let's move this out of the if ... not is_conn_error(e): condition, so we sanitize what goes into the raise statement and the self.logger.debug() statement.

Let's move this out of the if ... not is_conn_error(e): condition, so we sanitize what goes into the raise statement and the self.logger.debug() statement.

Ah, you're right. My thought was that we (maybe) want these data in server's log (e.g. for kojid). But it is sadly logged also in client, so it is less harm to sanitize it everywhere.

rebased onto 8b0a0bb92ad0482695e432f3c7b50fd890742d43

What I don't like about this is that it is extremely fragile. It solves only one case when urllib3 exception is directly part of the requests exception. I'm not sure if there are no other possible variants (more nested exceptions, etc.). Theoretically I can do separate sanitize function which will iterate over all args and try to recursively check all of them whose inherit from Exception.

Agreed, I think we should write a general method to sanitize this from all .args... with unit tests to demonstrate it's working

I'll merge this one for current release with the followup issue #3246

Metadata Update from @tkopecek:
- Pull-request tagged with: testing-ready

Metadata Update from @tkopecek:
- Pull-request untagged with: testing-ready

rebased onto 06b5f7c188ec52619eb3ddc9624ab8311c0f4140

Metadata Update from @tkopecek:
- Pull-request tagged with: testing-ready

Commit 25d4f486 fixes this pull-request

Pull-Request has been merged by tkopecek

Metadata Update from @jobrauer:
- Pull-request tagged with: testing-done

Metadata