Skip to content

protondrive: scope proxy auth cache by client headers#6

Closed
tdawe1 wants to merge 4 commits intorclone:masterfrom
tdawe1:fix/protondrive-sdk-cache-rclone
Closed

protondrive: scope proxy auth cache by client headers#6
tdawe1 wants to merge 4 commits intorclone:masterfrom
tdawe1:fix/protondrive-sdk-cache-rclone

Conversation

@tdawe1
Copy link
Copy Markdown

@tdawe1 tdawe1 commented Mar 14, 2026

Support the rclone Proton Drive backend update by fixing the proxy auth cache behavior used during SDK-era client identification.

This change is intentionally narrow. It does three things:

  • scope the built-in proxy auth cache by username, x-pm-appversion, and x-pm-drive-sdk-version instead of username alone
  • preserve raw username keys for custom AuthCacher implementations so external caches keep working as before
  • update the live proxy tests to use a valid external Drive client identity now that the old web-account@... identity no longer works on /auth/v4/info

Without this, one client identity can reuse cached auth information created for another, which makes the proxy behavior inaccurate and can hide real upstream auth problems.

This PR is split from the underlying SDK plumbing and from the broader route/retry hardening work so the cache fix can be reviewed on its own merits.

Testing:

go test ./server

GO_PROTON_API_TEST_USERNAME=... \
GO_PROTON_API_TEST_PASSWORD=... \
go test ./server -run '^(TestServer_RealProxy|TestServer_RealProxy_Cache)$' -count=1 -v

This PR should be reviewed on top of the companion go-proton-api SDK base compatibility PR.

Companion base PR: #5

tdawe1 added 4 commits March 1, 2026 15:36
Align the Proton Drive client with the SDK-era API contract by adding Drive SDK version header support, v2 volume move endpoint support, and revision verification data for upload blocks.

Also treat DeleteChildren code 2501 as idempotent stale-state success to avoid failing cleanup paths.
Separate cached auth state by app and Drive SDK headers so the proxy does not reuse tokens across incompatible Proton clients. This keeps SDK migration testing honest instead of hiding scope mismatches behind a username-only cache.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant