Split S3/R2 conditional capabilities and add conformance tests - #21
Merged
Conversation
Contributor
Author
|
Artifact Studio consumer draft: https://github.com/nestm-dev/artifact-studio/pull/20 This draft consumes the merged Storage #21 API and closes artifact-studio issue #5 when merged. Storage PR #20 is the separate issue-#4 cursor track and is not a dependency of this consumer. |
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
${filename}policy expansionSupports nestm-dev/artifact-studio#5
Required coordinated consumer PR: pending. Artifact Studio will be rebased and tested against the merged Storage API, then linked here; this PR intentionally does not close the Artifact Studio issue.
Provider matrix
Custom endpoints may enable only operations and signed-upload constraints proven by their conformance evidence. Undeclared operations fail before provider dispatch.
withS3Capabilities()is single-use per raw SDK client, and generic composition rejects undecorated structural S3 adapters.Security and correctness
configJson.contentTypeincludecontent-typeinX-Amz-SignedHeaders. Bounded AWS uploads use exactcontent-length-rangeand MIME POST conditions. S3 lower-onlyminSize, R2 size bounds, and undeclared custom constraints fail before credentials resolve or a signer runs.${filename}fail before signing, preventing AWS SDK template expansion from widening an exact key into a prefix policy.etag,version) × destination (create,replace) promotion pair is exercised; provider evidence remains required for a private one-linearization-point claim.No credentials, database migration, RLS change, tenant-model change, or authorization-policy change is included. Tenant isolation is unchanged; key, ETag, endpoint, error, and signing boundaries are stricter.
API and deployment migration
This includes a minor Changeset.
conditionalMutation/conditionalCopychecks with exact capability fields.s3()+withS3Capabilities()orcreateS3StorageDriver().{contentType:false,sizeRange:false}.@aws-sdk/client-s3 >= 3.919.0, the first release that serializes destination CopyObject conditions. Other AWS signing peers retain their declared>=3.700.0floors, verified independently by the packed consumer.Verification
Final local evidence on
0ac8922:pnpm run test: 216 unit tests passed; 55 E2E tests passed, 4 live-provider tests skipped explicitlypnpm run check: oxlint, full Prettier check, andtsc --noEmitpassedpnpm run build: passedpnpm exec publint --strict: passedpnpm run test:packed: passed with exact peer minima (client-s3@3.919.0;lib-storage,s3-presigned-post, ands3-request-presignerat3.700.0), real serialized copy headers, MIME-bound PUT signatures, decoded bounded POST conditions, and fail-closed R2/template pathsgit diff --check: passedAWS S3, Cloudflare R2, and custom live-provider suites remain explicit opt-in skips without disposable credentials. Filesystem conformance and deterministic versioned/fail-closed fixtures run in the default suite; live claims remain disclosed pending credentialed execution.