Title: DownloadManager: add redact_url= kwarg to hide auth-bearing URLs in logs by bitcoin3us · Pull Request #136 · MicroPythonOS/MicroPythonOS · GitHub
Open Graph Title: DownloadManager: add redact_url= kwarg to hide auth-bearing URLs in logs by bitcoin3us · Pull Request #136 · MicroPythonOS/MicroPythonOS
X Title: DownloadManager: add redact_url= kwarg to hide auth-bearing URLs in logs by bitcoin3us · Pull Request #136 · MicroPythonOS/MicroPythonOS
Description: Summary
DownloadManager.download_url prints the full request URL three times per download (start, finished, exception path) plus the entire response-headers dict. Great for the typical callers fetching public URLs (app icons, OS updates, weather), but it silently leaks any auth secret embedded in the URL's path or query string.
Two real cases motivating this PR:
Lightning Piggy's on-chain wallet (LightningPiggyApp PR #25) queries
https://btc1.trezor.io/api/v2/xpub/zpub6q…?details=txs&tokens=derived to fetch balance + transactions for a watch-only xpub. The xpub itself sits in the URL path. A leaked xpub exposes the wallet's entire past + future address derivation tree to whoever reads the log — non-recoverable confidentiality damage even though funds custody is unaffected. The app already scrubs xpubs from its own print() calls, but DownloadManager's prints sit below that and re-leak on every poll.
Any future caller using API-key-in-URL or token-in-URL auth. Common pattern (LNBits, BlueWallet's LNDHub, some HTTPS RPC endpoints) — the leak surface is wider than just Lightning Piggy.
Behaviour
Adds a redact_url=False kwarg (default preserves current behaviour). When True:
URL logged as scheme://host[:port]/...REDACTED... instead of full. The host is intentionally kept so failure triage (DNS / connectivity / wrong endpoint) is still possible.
Response-headers dump is suppressed entirely (replaced with
Open Graph Description: Summary DownloadManager.download_url prints the full request URL three times per download (start, finished, exception path) plus the entire response-headers dict. Great for the typical callers fetc...
X Description: Summary DownloadManager.download_url prints the full request URL three times per download (start, finished, exception path) plus the entire response-headers dict. Great for the typical callers fetc...
Opengraph URL: https://github.com/MicroPythonOS/MicroPythonOS/pull/136
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:ee5742e7-0c14-b3aa-2ee9-d990a0445259 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | C310:E2378:754075D:A44D64E:6A4FDFB6 |
| html-safe-nonce | a897f6495119abfad651ce4de26580e942030e6f3fe85a7057700f3b438fed9f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMzEwOkUyMzc4Ojc1NDA3NUQ6QTQ0RDY0RTo2QTRGREZCNiIsInZpc2l0b3JfaWQiOiI2Mjg5NDYwMTA0NzExMzY0NTM0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 5ecb7d646357cab022be7ac31ed315003ce2e5d284c6b0c0900258b82b5ee6bb |
| hovercard-subject-tag | pull_request:3676791738 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/MicroPythonOS/MicroPythonOS/pull/136/files |
| twitter:image | https://avatars.githubusercontent.com/u/115934595?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/115934595?s=400&v=4 |
| og:image:alt | Summary DownloadManager.download_url prints the full request URL three times per download (start, finished, exception path) plus the entire response-headers dict. Great for the typical callers fetc... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 19b98c3d9767bb8a56238a89ff8401d1cbdf3bc5c353799aacf49fe6c76b4b7c |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/MicroPythonOS/MicroPythonOS git https://github.com/MicroPythonOS/MicroPythonOS.git |
| octolytics-dimension-user_id | 213598128 |
| octolytics-dimension-user_login | MicroPythonOS |
| octolytics-dimension-repository_id | 975472483 |
| octolytics-dimension-repository_nwo | MicroPythonOS/MicroPythonOS |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 975472483 |
| octolytics-dimension-repository_network_root_nwo | MicroPythonOS/MicroPythonOS |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 142593e66413bbae27fd485859993597d5a3b104 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width