Skip to content

feat(BA-6158): support TUS Checksum extension#11769

Draft
jopemachine wants to merge 1 commit into
fix/BA-6156-rewire-tus-handlersfrom
feat/BA-6158-tus-checksum-extension
Draft

feat(BA-6158): support TUS Checksum extension#11769
jopemachine wants to merge 1 commit into
fix/BA-6156-rewire-tus-handlersfrom
feat/BA-6158-tus-checksum-extension

Conversation

@jopemachine
Copy link
Copy Markdown
Member

@jopemachine jopemachine commented May 22, 2026

📚 Stacked PRs

This PR is part of a 5-PR stack implementing BA-3974 (epic: BA-6153). Merge in order:

  1. ⬇️ feat(BA-6155): add metadata-driven chunk-store upload session engine #11766feat(BA-6155): add metadata-driven chunk-store upload session engine
  2. ⬇️ fix(BA-6156): rewire TUS PATCH/HEAD to chunk-based store #11767fix(BA-6156): rewire TUS PATCH/HEAD to chunk-based store (actual user-visible fix)
  3. ⬇️ test(BA-6157): add multi-proxy NFS race regression test #11768test(BA-6157): add multi-proxy NFS race regression test
  4. 👉 feat(BA-6158): support TUS Checksum extension #11769feat(BA-6158): support TUS Checksum extension ← you are here
  5. ⬇️ feat(BA-6159): add /upload/status endpoint and progress headers #11770feat(BA-6159): add /upload/status endpoint + progress headers

Summary

  • Parse `Upload-Checksum: sha256 ` on PATCH and compare to the SHA-256 computed while streaming the chunk body. Mismatch returns HTTP 460 (`ChunkChecksumMismatchError`).
  • Reject malformed header values (missing digest, unsupported algorithm, invalid base64, wrong digest length) with 400 (`InvalidUploadChecksumHeaderError`).
  • Advertise the extension in OPTIONS via `Tus-Extension: checksum` and `Tus-Checksum-Algorithm: sha256`.
  • Clients that do not send the header observe no behavior change.

Resolves BA-6158.

@github-actions github-actions Bot added size:L 100~500 LoC comp:storage-proxy Related to Storage proxy component labels May 22, 2026
@jopemachine jopemachine force-pushed the feat/BA-6158-tus-checksum-extension branch from 8bd46b7 to 1b3c6b7 Compare May 22, 2026 07:04
@jopemachine jopemachine force-pushed the fix/BA-6156-rewire-tus-handlers branch from dada14e to 0d1bf13 Compare May 26, 2026 05:55
@jopemachine jopemachine force-pushed the feat/BA-6158-tus-checksum-extension branch from 1b3c6b7 to c18c069 Compare May 26, 2026 05:55
@jopemachine jopemachine force-pushed the fix/BA-6156-rewire-tus-handlers branch from 0d1bf13 to 7dcbab8 Compare May 26, 2026 08:29
@jopemachine jopemachine force-pushed the feat/BA-6158-tus-checksum-extension branch 2 times, most recently from 0b8250b to 638c33f Compare May 26, 2026 08:50
@jopemachine jopemachine force-pushed the fix/BA-6156-rewire-tus-handlers branch 2 times, most recently from 84e303d to fc4dc36 Compare May 26, 2026 09:04
@jopemachine jopemachine force-pushed the feat/BA-6158-tus-checksum-extension branch from 638c33f to 4be1e1d Compare May 26, 2026 09:04
@jopemachine jopemachine force-pushed the fix/BA-6156-rewire-tus-handlers branch from fc4dc36 to 968d6c3 Compare May 26, 2026 09:11
@jopemachine jopemachine force-pushed the feat/BA-6158-tus-checksum-extension branch 2 times, most recently from 8b88451 to da3f5cf Compare May 26, 2026 09:13
@jopemachine jopemachine force-pushed the fix/BA-6156-rewire-tus-handlers branch 2 times, most recently from b40ebc8 to a94454f Compare May 26, 2026 09:19
@jopemachine jopemachine force-pushed the feat/BA-6158-tus-checksum-extension branch 2 times, most recently from a1f3ce9 to 80b06c6 Compare May 26, 2026 09:31
@jopemachine jopemachine force-pushed the fix/BA-6156-rewire-tus-handlers branch from a94454f to 583cb92 Compare May 26, 2026 09:31
@jopemachine jopemachine force-pushed the feat/BA-6158-tus-checksum-extension branch from 80b06c6 to 9cf8e25 Compare May 28, 2026 05:02
@jopemachine jopemachine force-pushed the fix/BA-6156-rewire-tus-handlers branch from 583cb92 to 1f2fc01 Compare May 28, 2026 05:02
@jopemachine jopemachine force-pushed the feat/BA-6158-tus-checksum-extension branch from 9cf8e25 to a2bde01 Compare May 28, 2026 05:10
@jopemachine jopemachine force-pushed the fix/BA-6156-rewire-tus-handlers branch from 1f2fc01 to 4c07f47 Compare May 28, 2026 05:10
@jopemachine jopemachine force-pushed the fix/BA-6156-rewire-tus-handlers branch from 9ecba5c to 0d1a512 Compare June 1, 2026 05:43
@jopemachine jopemachine force-pushed the feat/BA-6158-tus-checksum-extension branch from 7a5736b to b4b7c83 Compare June 1, 2026 05:48
@jopemachine jopemachine force-pushed the fix/BA-6156-rewire-tus-handlers branch 2 times, most recently from e37ca75 to cf51fc2 Compare June 1, 2026 05:51
@jopemachine jopemachine force-pushed the feat/BA-6158-tus-checksum-extension branch from b4b7c83 to f46941b Compare June 1, 2026 05:51
@jopemachine jopemachine force-pushed the fix/BA-6156-rewire-tus-handlers branch from cf51fc2 to c171fa4 Compare June 1, 2026 06:15
@jopemachine jopemachine force-pushed the feat/BA-6158-tus-checksum-extension branch 2 times, most recently from 6a94d31 to 794895f Compare June 1, 2026 06:19
@jopemachine jopemachine force-pushed the fix/BA-6156-rewire-tus-handlers branch from c171fa4 to e517c70 Compare June 1, 2026 06:19
@jopemachine jopemachine force-pushed the feat/BA-6158-tus-checksum-extension branch from 794895f to ded76e9 Compare June 1, 2026 06:21
@jopemachine jopemachine force-pushed the fix/BA-6156-rewire-tus-handlers branch from 6acff68 to e14f59f Compare June 1, 2026 06:30
@jopemachine jopemachine force-pushed the feat/BA-6158-tus-checksum-extension branch 2 times, most recently from b1e94f6 to 1f3eb55 Compare June 1, 2026 06:35
@jopemachine jopemachine force-pushed the fix/BA-6156-rewire-tus-handlers branch 2 times, most recently from 51181ab to fccee9f Compare June 1, 2026 06:44
@jopemachine jopemachine force-pushed the feat/BA-6158-tus-checksum-extension branch from 1f3eb55 to 4d873d5 Compare June 1, 2026 06:44
@jopemachine jopemachine force-pushed the fix/BA-6156-rewire-tus-handlers branch from fccee9f to ee1e510 Compare June 1, 2026 06:52
@jopemachine jopemachine force-pushed the feat/BA-6158-tus-checksum-extension branch from 4d873d5 to 3830b87 Compare June 1, 2026 06:52
@jopemachine jopemachine force-pushed the fix/BA-6156-rewire-tus-handlers branch from ee1e510 to 087b43d Compare June 1, 2026 07:29
@jopemachine jopemachine force-pushed the feat/BA-6158-tus-checksum-extension branch 2 times, most recently from 43bced8 to 8dde2c9 Compare June 1, 2026 07:33
@jopemachine jopemachine force-pushed the fix/BA-6156-rewire-tus-handlers branch from 087b43d to 5dd870e Compare June 1, 2026 07:33
@jopemachine jopemachine force-pushed the feat/BA-6158-tus-checksum-extension branch from 8dde2c9 to d09efa6 Compare June 1, 2026 07:45
@jopemachine jopemachine force-pushed the fix/BA-6156-rewire-tus-handlers branch 2 times, most recently from c9c67a8 to e35aee1 Compare June 1, 2026 07:55
@jopemachine jopemachine force-pushed the feat/BA-6158-tus-checksum-extension branch 2 times, most recently from 4381705 to 93418d2 Compare June 1, 2026 08:00
@jopemachine jopemachine force-pushed the fix/BA-6156-rewire-tus-handlers branch 2 times, most recently from 8482a07 to b761e68 Compare June 1, 2026 08:19
Opt-in per-chunk integrity verification on storage proxy uploads.

  - Parse \`Upload-Checksum: sha256 <base64-digest>\` on PATCH; compare to
    the sha256 computed while streaming the chunk body. On mismatch,
    raise \`ChunkChecksumMismatchError\` (HTTP 460 per TUS Checksum
    extension) and discard the temp chunk file.
  - Reject malformed header values (missing digest, non-sha256 algorithm,
    invalid base64, wrong digest length) with
    \`InvalidUploadChecksumHeaderError\` (400).
  - Advertise the extension in OPTIONS via \`Tus-Extension: checksum\` and
    \`Tus-Checksum-Algorithm: sha256\`. Add \`Upload-Checksum\` to the
    Access-Control-Allow-Headers / Expose-Headers lists.

Clients that do not send the header observe no behavior change.

Tests cover matching / mismatched / malformed header cases.

Resolves BA-6158. Part of epic BA-6153 (implements BA-3974).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp:storage-proxy Related to Storage proxy component size:L 100~500 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant