fix: enforce S3 limits and reject negative/fractionals - #1237
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aligns the S3-compatible API with S3 limits by defaulting/capping list-multipart-uploads behavior and tightening request validation to reject negative and fractional values (and enforce known S3 ranges for multipart part numbers and paging parameters).
Changes:
- Default
ListMultipartUploadsMaxUploadsto 1000 and add a handler-level unit test for the default. - Update S3 route JSON schemas from
numbertointegerand add min/max bounds for multipart-related parameters. - Add router validation tests covering integer-only constraints and S3 ranges across multipart/list operations.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/storage/protocols/s3/s3-handler.ts | Updates ListMultipartUploads default limit behavior. |
| src/storage/protocols/s3/s3-handler.test.ts | Adds coverage for the 1000 default behavior. |
| src/http/routes/s3/router.test.ts | Adds validation tests for integer-only and S3-range constraints. |
| src/http/routes/s3/commands/upload-part.ts | Enforces partNumber as integer within 1–10000. |
| src/http/routes/s3/commands/upload-part-copy.ts | Enforces partNumber as integer within 1–10000. |
| src/http/routes/s3/commands/list-parts.ts | Enforces max-parts as integer within 1–1000. |
| src/http/routes/s3/commands/list-objects.ts | Enforces max-keys as a non-negative integer. |
| src/http/routes/s3/commands/list-multipart-uploads.ts | Enforces max-uploads as integer within 1–1000. |
| src/http/routes/s3/commands/complete-multipart-upload.ts | Enforces completed part numbers within 1–10000. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Coverage Report for CI Build 29491592036Coverage decreased (-0.1%) to 79.48%Details
Uncovered ChangesNo uncovered changes found. Coverage Regressions20 previously-covered lines in 3 files lost coverage.
Coverage Stats💛 - Coveralls |
ferhatelmas
force-pushed
the
ferhat/s3-amend
branch
from
July 16, 2026 10:32
991a38a to
2d96775
Compare
Signed-off-by: ferhat elmas <elmas.ferhat@gmail.com>
ferhatelmas
force-pushed
the
ferhat/s3-amend
branch
from
July 16, 2026 10:39
2d96775 to
6b0ec46
Compare
fenos
approved these changes
Jul 16, 2026
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.
What kind of change does this PR introduce?
Bug fix
What is the current behavior?
Part number caps or default didn't honor S3 expectations.
Validator is using number, not integer so it can accept floats.
What is the new behavior?
Align them with S3.
Change number type to integer where applicable.
Additional context
List objects has an old behavior to change 0 to 1000 but kept old behavior.
Get/Head object doesn't support part at the moment. Would be nice to add separately.