Add per-block verification token support for uploads#7
Open
pwnorbitals wants to merge 1 commit intorclone:masterfrom
Open
Add per-block verification token support for uploads#7pwnorbitals wants to merge 1 commit intorclone:masterfrom
pwnorbitals wants to merge 1 commit intorclone:masterfrom
Conversation
Proton's storage API now requires a per-block verification token when
uploading file blocks. Without it, all uploads fail with HTTP 422
(Code=200501, "Operation failed: Please retry").
Changes:
- Add GetUploadVerification() to fetch verification code from the
/drive/v2/volumes/{}/links/{}/revisions/{}/verification endpoint
- Add BlockVerifier and UploadVerification types to block_types.go
- Add VolumeID field to BlockUploadReq (now required by the API)
- Fix UploadBlock() to use a plain HTTP client instead of the
authenticated API client, as storage servers only accept the
pm-storage-token header
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GetUploadVerification()to fetch the verification code from the/drive/v2/volumes/{}/links/{}/revisions/{}/verificationendpointBlockVerifierandUploadVerificationtypes toblock_types.goVolumeIDfield toBlockUploadReq(now required by the API)UploadBlock()to use a plain HTTP client instead of the authenticated API client, as storage servers only accept thepm-storage-tokenheaderContext
Since late 2025, Proton has been rolling out a breaking change to their block upload API that requires a per-block verification token. This is computed by XORing the verification code (fetched from a new endpoint) with the first 32 bytes of each encrypted block.
Without this change, all file uploads via rclone fail. See rclone/rclone#8870 and forum discussion.
Test plan
Made with the help of Claude Opus 4.6 (claude-opus-4-6)