mirror of
https://github.com/Glitchy-Sheep/boosty-downloader.git
synced 2026-10-14 21:33:23 +00:00
[PR #167] [MERGED] [security] Keep the account token off media downloads #169
Labels
No labels
api-drift
bug
ci
documentation
enhancement
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Glitchy-Sheep/boosty-downloader#169
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Glitchy-Sheep/boosty-downloader/pull/167
Author: @Glitchy-Sheep
Created: 8/21/2026
Status: ✅ Merged
Merged: 8/21/2026
Merged by: @Glitchy-Sheep
Base:
main← Head:fix/token-scope📝 Commits (3)
7ee3861fix: Sign image and audio urls like file urls9dac809fix: Keep account credentials off the download sessionfdf68fedocs: Changelog the credential-scope fix📊 Changes
8 files changed (+139 additions, -17 deletions)
View changed files
📝
CHANGELOG.md(+5 -0)📝
boosty_downloader/application/di/app_environment.py(+29 -9)📝
boosty_downloader/application/mappers/audio.py(+2 -2)📝
boosty_downloader/application/mappers/image.py(+4 -2)📝
boosty_downloader/application/mappers/post_mapper.py(+6 -2)➕
test/e2e/credentials_scope_test.py(+65 -0)📝
test/fixtures/single_post_domain.json(+2 -2)📝
test/unit/mappers/post_mapper_test.py(+26 -0)📄 Description
[security] Keep the account token off media downloads
Summary
One shared aiohttp session carried the Boosty
Authorizationheader and cookies on every request - including media downloads from CDN and third-party video hosts (OK.ru). Only the API needs the credentials; media access is guarded by the signed query inside each url. Downloads now run on a separate credential-free session.Why this is safe - measured, not assumed
A live access matrix on real paid posts (bare curl, no credentials):
Changes
signed_queryreaches every media mapper (image/audio, files had it already); the domain golden pins the signature on all three kindsAppEnvironmentbuilds two sessions: authorized (API only, "Credentials live ONLY here") and a clean download session with the same timeouts/tracing/retries plusDummyCookieJar- it neither stores nor sends any cookie, so CDN redirects cannot attach anythingAppEnvironment: a local server asserts the API request arrives withAuthorization+ cookie and the media request arrives with neitherVerification
task check+task testgreen: 176 passed + 1 xfail🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.