Skip to content

Support POST Object requests #2344

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 21, 2025
Merged

Support POST Object requests #2344

merged 2 commits into from
Apr 21, 2025

Conversation

afranken
Copy link
Member

Description

Not all parameters are supported right now.

Also adds tests for large uploads through presigned URLs.

Related Issue

Fixes #2200

Tasks

  • I have signed the CLA.
  • I have written tests and verified that they fail without my change.

Not all parameters are supported right now.

Fixes #2200
@afranken afranken self-assigned this Apr 21, 2025
@afranken afranken requested a review from Copilot April 21, 2025 22:09
Copy link
Contributor

@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 adds support for POST object requests and enhances test coverage for large uploads via presigned URLs.

  • Consolidates HTTP parameter constants for DELETE operations.
  • Adds an overloaded toTempFile method in ServiceBase for processing POST object uploads.
  • Implements the new postObject endpoint in ObjectController along with updated integration tests for both POST and PUT presigned URL workflows.

Reviewed Changes

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

Show a summary per file
File Description
server/src/main/java/com/adobe/testing/s3mock/util/AwsHttpParameters.java Reorders and groups DELETE-related constants to support POST requests.
server/src/main/java/com/adobe/testing/s3mock/service/ServiceBase.java Introduces a new toTempFile(InputStream) method for POST object handling.
server/src/main/java/com/adobe/testing/s3mock/ObjectController.java Implements a new postObject endpoint for POST object requests.
server/src/main/java/com/adobe/testing/s3mock/BucketController.java Cleans up unused import declarations.
integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/S3TestBase.kt Adjusts test utilities and adds S3PostObjectPresigner support.
integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/PresignedUrlIT.kt Adds integration tests for both POST and PUT presigned URL operations.
README.md Updates documentation to reflect support for PostObject.
CHANGELOG.md Updates changelog for the 4.1.0 release.
Files not reviewed (12)
  • build-config/pom.xml: Language not supported
  • docker/pom.xml: Language not supported
  • integration-tests/pom.xml: Language not supported
  • pom.xml: Language not supported
  • server/pom.xml: Language not supported
  • server/src/main/resources/application.properties: Language not supported
  • testsupport/common/pom.xml: Language not supported
  • testsupport/junit4/pom.xml: Language not supported
  • testsupport/junit5/pom.xml: Language not supported
  • testsupport/pom.xml: Language not supported
  • testsupport/testcontainers/pom.xml: Language not supported
  • testsupport/testng/pom.xml: Language not supported
Comments suppressed due to low confidence (2)

server/src/main/java/com/adobe/testing/s3mock/util/AwsHttpParameters.java:37

  • [nitpick] Consider grouping the DELETE constant declaration together with its corresponding NOT_DELETE constant to improve code clarity and maintainability.
public static final String DELETE = "delete";

integration-tests/src/test/kotlin/com/adobe/testing/s3mock/its/PresignedUrlIT.kt:86

  • [nitpick] Using randomMBytes.inputStream() multiple times to compute the digest may introduce issues if the underlying source is not repeatable. Consider computing and caching the digest once for use in subsequent comparisons to improve test stability.
val expectedEtag = "\"${DigestUtil.hexDigest(randomMBytes.inputStream())}\""

@afranken afranken merged commit 7e55dfa into main Apr 21, 2025
6 checks passed
@afranken afranken deleted the 2200-add-postobject-api branch April 21, 2025 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

413 PAYLOAD_TOO_LARGE using a pre-signed URL
1 participant