Skip to content

Conversation

jencymaryjoseph
Copy link
Contributor

Motivation and Context

This PR introduces support for multipart downloads using presigned URLs. Unlike the existing MultipartDownloaderSubscriber which relies on partNumber, this implementation uses HTTP range headers to achieve multipart functionality with pre-signed URLs.

Modifications

PresignedUrlMultipartDownloaderSubscriber: New reactive subscriber that handles size discovery through initial range requests, manages multipart state with thread-safe operations, and validates response consistency using ETag comparison.

Testing

PresignedUrlMultipartDownloaderSubscriberTckTest: Reactive Streams specification compliance test using SubscriberWhiteboxVerification with mocked S3AsyncClient for isolated testing.
PresignedUrlMultipartDownloaderSubscriberWiremockTest: WireMock tests covering multipart downloads with various part sizes, single-part downloads, and error scenarios.
PresignedUrlMultipartDownloadTestUtil: WireMock stubbing utilities for range request simulation and verification.

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the CONTRIBUTING document
  • Local run of mvn install succeeds
  • My code follows the code style of this project
  • My change requires a change to the Javadoc documentation
  • I have updated the Javadoc documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed
  • I have added a changelog entry. Adding a new entry must be accomplished by running the scripts/new-change script and following the instructions. Commit the new file created by the script in .changes/next-release with your changes.
  • My change is to implement 1.11 parity feature and I have updated LaunchChangelog

License

  • I confirm that this pull request can be released under the Apache 2 license

@jencymaryjoseph jencymaryjoseph requested a review from a team as a code owner August 11, 2025 22:33
@zoewangg zoewangg requested a review from Copilot August 13, 2025 00:37
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new implementation for multipart downloads using presigned URLs with HTTP range headers instead of S3's native partNumber-based multipart API. The implementation uses reactive streams to handle concurrent part downloads while maintaining thread safety and proper response validation.

  • Adds PresignedUrlMultipartDownloaderSubscriber class for range-based multipart downloads with presigned URLs
  • Implements size discovery through initial range requests and ETag validation for response consistency
  • Provides comprehensive test coverage including TCK compliance tests and WireMock integration tests

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
PresignedUrlMultipartDownloaderSubscriber.java Core subscriber implementation for presigned URL multipart downloads using HTTP range requests
PresignedUrlMultipartDownloaderSubscriberTckTest.java Reactive Streams TCK compliance test with mocked S3AsyncClient
PresignedUrlMultipartDownloaderSubscriberWiremockTest.java Integration tests using WireMock for various download scenarios
PresignedUrlMultipartDownloadTestUtil.java Test utility class for WireMock stubbing and verification
Comments suppressed due to low confidence (2)

services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/multipart/PresignedUrlMultipartDownloadTestUtil.java:138

  • The XML tag '' appears to be incomplete or truncated. It should likely be '' to match the pattern used in line 125.
                .withBody("<e><Code>400</Code><Message>test error message</Message></e>")));

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

@jencymaryjoseph jencymaryjoseph force-pushed the feature/multipartSubscriber branch from e9d282d to c12ea47 Compare August 14, 2025 15:56
Copy link

@joviegas joviegas merged commit 6466fcb into aws:feature/master/pre-signed-url-getobject Aug 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants