Repository navigation
fix(site-deploy): forward the signed uploadHeaders on every PUT - #1985
Merged
Merged
Conversation
Contributor
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
Review complete. No blocking issues — approved ✅; 3 nitpicks below. 🧹 Nitpicks (3) — 🟢 3 low
The change closes a signature-fidelity gap: the client previously PUT to a presigned URL without the headers the URL was signed over, so the implementation now selects
Reviewed commit: b3573e3 |
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
Since #1983 the presigned PUT URL is signed over
x-amz-meta-upload-id. The presigned-url plugin hands the exact headers back asuploadHeaders, but@constructive-io/site-deploy(0.4.1) never selected them: its bulk mutation asked foruploadUrl fileId key deduplicatedonly anddefaultPutsent just Content-Type + checksum. Every site deploy now fails against S3/RustFS:(seen in constructive-db's
knative-e2e (2)/site-deploy-client.e2e.test.tson the e0fcfb4 bump, constructive-db#4336).Changes, no signing change:
buildBulkUploadMutationselectsuploadHeaders.diffCascarriesuploadHeaderswith each missing file and throwsUPLOAD_FAILEDwhen a non-deduplicated file comes back without them (no guessing headers).PutObjectgains a trailingheaders?: Record<string, string>;uploadMissingpasses them, anddefaultPutforwards them toputToPresignedUrl(url, body, contentType, { signal, contentHash, headers }), which sends them as-is.Tests: both mock servers (
packages/site-deploy/__tests__/mock-api.ts,examples/site-deploy-ssg/__tests__/mock-server.ts) now return plugin-shapeduploadHeadersand reject a PUT that lacks the signed upload id, as S3 does. A new test checks that a payload without headers fails before any PUT or release write. Without thesrcchange the site-deploy suite fails to compile and the SSG example fails 4/5; with it, 45/45 and 5/5.Link to Devin session: https://app.devin.ai/sessions/bbd6fe90213a42bebc60256a795675b5
Open in Devin Desktop: https://app.devin.ai/desktop/session/bbd6fe90213a42bebc60256a795675b5?variant=devin
Requested by: @pyramation