Repository navigation
Conversation
|
Review complete. 🟠 2 high 💬 Inline comments (1)
📍 Findings outside the diff (1) — 🟠 1 high — defects on lines GitHub can't attach comments to🟠 High — Provisioned CORS rules omit // packages/bucket-provisioner/src/cors.ts
36 allowedHeaders: [
37 'Content-Type',
38 'Content-Length',
39 'Content-MD5',
40 'x-amz-content-sha256',
41 'x-amz-checksum-sha256',
42 'x-amz-meta-upload-id',
43 'x-amz-date',
44 'x-amz-security-token',
45 'Authorization',
46 ],The create-only presigned PUT now requires the client to send This PR lets clients reserve specific object keys in S3: the plugin now acquires
Reviewed commit: 01973e0 |
There was a problem hiding this comment.
Adds custom-key upload reservations to the presigned-URL plugin via transaction-scoped advisory locks, create-only (If-None-Match) presigned PUTs, UPLOAD_KEY_CONFLICT semantics, and an allow_custom_keys bucket flag with matching seed and test coverage.
Key findings
- 🟠 Content-addressed path skips the advisory lock entirely — plugin.ts:588
- 🟠 Provisioned CORS rules omit
If-None-Match, breaking browser PUTs — cors.ts:36
Uploading a file should return a reference to its contents. Once a file is confirmed, another upload must not change what its existing references read. For example, changing a site's logo means obtaining a reference to the new image and updating the site to use it. Uploading the image alone should leave the site unchanged.
The current custom-key flow already compares content hashes when checking for reuse. The problem is what happens on a mismatch: an upload can receive a write URL for a location already in use.
Proposed API contract
Implementation scope and concurrency
Keep the implementation in CNC. CNC DB changes and bucket policy changes are out of scope. If CNC can reliably detect that another upload already holds the same key in the same bucket, it should decline the competing request without issuing a write URL. Document which concurrent cases the implementation protects and which races remain with the existing database. Do not claim that a preflight check alone guarantees exclusive access across requests.
This is a design-only draft with an empty commit. It proposes no code, schema, or bucket policy changes. The implementation and the exact response for an in-flight duplicate are left open. No tests were run because there are no file changes.