mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 16:59:12 +00:00
feat(logs): sanitize basic auth in urls (#1188)
* Added regex pattern to capture credentials used to bypass auth * Updated test case for log sanitisation * Changed replacement pattern * Update logs_sanitize_test.go * fix: reorder regex patterns --------- Co-authored-by: soup <soup@r4tio.dev>
This commit is contained in:
parent
69f7cce116
commit
5225c1e956
2 changed files with 9 additions and 1 deletions
|
@ -153,6 +153,10 @@ func TestSanitizeLogFile(t *testing.T) {
|
|||
input: "\"module\":\"filter\" \\\"id\\\": 3855,\\n \\\"apikey\\\": \\\"ad789a9s8d.asdpoiasdpojads09sad809\\\",\\n \\\"minratio\\\": 10.0\\n",
|
||||
expected: "\"module\":\"filter\" \\\"id\\\": 3855,\\n \\\"apikey\\\": \\\"REDACTED\\\",\\n \\\"minratio\\\": 10.0\\n",
|
||||
},
|
||||
{
|
||||
input: "\"module\":\"filter\" request: https://username:password@111.server.name.here/qbittorrent/api/v2/torrents/info: error making request",
|
||||
expected: "\"module\":\"filter\" request: https://REDACTED_USER:REDACTED_PW@111.server.name.here/qbittorrent/api/v2/torrents/info: error making request",
|
||||
},
|
||||
}
|
||||
|
||||
for _, testCase := range testCases {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue